[clang][Index] Fix msan failure
authorKadir Cetinkaya <kadircet@google.com>
Fri, 8 Mar 2019 10:18:40 +0000 (10:18 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Fri, 8 Mar 2019 10:18:40 +0000 (10:18 +0000)
llvm-svn: 355683

clang/unittests/Index/IndexTests.cpp

index 59b4b2e..bbd5db3 100644 (file)
@@ -91,10 +91,15 @@ public:
     return true;
   }
 
-  bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *,
-                            SymbolRoleSet, SourceLocation) override {
+  bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI,
+                            SymbolRoleSet Roles, SourceLocation Loc) override {
     TestSymbol S;
+    S.SymInfo = getSymbolInfoForMacro(*MI);
     S.QName = Name->getName();
+    S.WrittenPos = Position::fromSourceLocation(Loc, AST->getSourceManager());
+    S.DeclPos = Position::fromSourceLocation(MI->getDefinitionLoc(),
+                                             AST->getSourceManager());
+    S.Roles = Roles;
     Symbols.push_back(std::move(S));
     return true;
   }