From: Eric Liu Date: Mon, 9 Jul 2018 19:02:41 +0000 (+0000) Subject: [Index] Ignore noop #undef's when handling macro occurrences. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f983ca81222092615a93802c6820e9a46b5b9ac2;p=clang [Index] Ignore noop #undef's when handling macro occurrences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336584 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Index/IndexingAction.cpp b/lib/Index/IndexingAction.cpp index b8faf7075e..16f6c21745 100644 --- a/lib/Index/IndexingAction.cpp +++ b/lib/Index/IndexingAction.cpp @@ -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());