]> granicus.if.org Git - clang/commitdiff
[Index] Ignore noop #undef's when handling macro occurrences.
authorEric Liu <ioeric@google.com>
Mon, 9 Jul 2018 19:02:41 +0000 (19:02 +0000)
committerEric Liu <ioeric@google.com>
Mon, 9 Jul 2018 19:02:41 +0000 (19:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336584 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Index/IndexingAction.cpp

index b8faf7075e7a99d9a2c88e765831ee09647b9bb8..16f6c21745ef4d35761166b56615c1973acec7c8 100644 (file)
@@ -98,6 +98,8 @@ public:
 
   void MacroUndefined(const Token &MacroNameTok, const MacroDefinition &MD,
                       const MacroDirective *Undef) override {
+    if (!MD.getMacroInfo())  // Ignore noop #undef.
+      return;
     IndexCtx->handleMacroUndefined(*MacroNameTok.getIdentifierInfo(),
                                    MacroNameTok.getLocation(),
                                    *MD.getMacroInfo());