r355683 - [clang][Index] Fix msan failure

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 02:18:41 PST 2019


Author: kadircet
Date: Fri Mar  8 02:18:40 2019
New Revision: 355683

URL: http://llvm.org/viewvc/llvm-project?rev=355683&view=rev
Log:
[clang][Index] Fix msan failure

Modified:
    cfe/trunk/unittests/Index/IndexTests.cpp

Modified: cfe/trunk/unittests/Index/IndexTests.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Index/IndexTests.cpp?rev=355683&r1=355682&r2=355683&view=diff
==============================================================================
--- cfe/trunk/unittests/Index/IndexTests.cpp (original)
+++ cfe/trunk/unittests/Index/IndexTests.cpp Fri Mar  8 02:18:40 2019
@@ -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;
   }




More information about the cfe-commits mailing list