VitaNuo created this revision. Herald added a project: All. VitaNuo requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D138564 Files: clang-tools-extra/include-cleaner/lib/Record.cpp clang-tools-extra/include-cleaner/unittests/RecordTest.cpp Index: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp =================================================================== --- clang-tools-extra/include-cleaner/unittests/RecordTest.cpp +++ clang-tools-extra/include-cleaner/unittests/RecordTest.cpp @@ -232,7 +232,8 @@ ASSERT_THAT(Recorded.MacroReferences, Not(IsEmpty())); SourceManager &SM = AST.sourceManager(); - SourceLocation Def = SM.getComposedLoc(SM.getMainFileID(), MainFile.point("def")); + SourceLocation Def = + SM.getComposedLoc(SM.getMainFileID(), MainFile.point("def")); SymbolReference XRef = Recorded.MacroReferences.front(); EXPECT_EQ(XRef.RT, RefType::Ambiguous); Index: clang-tools-extra/include-cleaner/lib/Record.cpp =================================================================== --- clang-tools-extra/include-cleaner/lib/Record.cpp +++ clang-tools-extra/include-cleaner/lib/Record.cpp @@ -84,7 +84,7 @@ } void Ifdef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDefinition &MD) override { + const MacroDefinition &MD) override { if (!Active) return; if (const auto *MI = MD.getMacroInfo()) @@ -95,10 +95,9 @@ void recordMacroRef(const Token &Tok, const MacroInfo &MI, RefType RT) { if (MI.isBuiltinMacro()) return; // __FILE__ is not a reference. - Recorded.MacroReferences.push_back( - SymbolReference{Tok.getLocation(), - Macro{Tok.getIdentifierInfo(), MI.getDefinitionLoc()}, - RT}); + Recorded.MacroReferences.push_back(SymbolReference{ + Tok.getLocation(), + Macro{Tok.getIdentifierInfo(), MI.getDefinitionLoc()}, RT}); } bool Active = false;
Index: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp =================================================================== --- clang-tools-extra/include-cleaner/unittests/RecordTest.cpp +++ clang-tools-extra/include-cleaner/unittests/RecordTest.cpp @@ -232,7 +232,8 @@ ASSERT_THAT(Recorded.MacroReferences, Not(IsEmpty())); SourceManager &SM = AST.sourceManager(); - SourceLocation Def = SM.getComposedLoc(SM.getMainFileID(), MainFile.point("def")); + SourceLocation Def = + SM.getComposedLoc(SM.getMainFileID(), MainFile.point("def")); SymbolReference XRef = Recorded.MacroReferences.front(); EXPECT_EQ(XRef.RT, RefType::Ambiguous); Index: clang-tools-extra/include-cleaner/lib/Record.cpp =================================================================== --- clang-tools-extra/include-cleaner/lib/Record.cpp +++ clang-tools-extra/include-cleaner/lib/Record.cpp @@ -84,7 +84,7 @@ } void Ifdef(SourceLocation Loc, const Token &MacroNameTok, - const MacroDefinition &MD) override { + const MacroDefinition &MD) override { if (!Active) return; if (const auto *MI = MD.getMacroInfo()) @@ -95,10 +95,9 @@ void recordMacroRef(const Token &Tok, const MacroInfo &MI, RefType RT) { if (MI.isBuiltinMacro()) return; // __FILE__ is not a reference. - Recorded.MacroReferences.push_back( - SymbolReference{Tok.getLocation(), - Macro{Tok.getIdentifierInfo(), MI.getDefinitionLoc()}, - RT}); + Recorded.MacroReferences.push_back(SymbolReference{ + Tok.getLocation(), + Macro{Tok.getIdentifierInfo(), MI.getDefinitionLoc()}, RT}); } bool Active = false;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits