summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexingAction.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-07-09 19:02:41 +0000
committerEric Liu <ioeric@google.com>2018-07-09 19:02:41 +0000
commit22a0c8dbc8bc008928b319d44ad296738940fe72 (patch)
tree2c5a23d91592e91353a75244e8248ebd2dbb4b02 /clang/lib/Index/IndexingAction.cpp
parent74c10e32368025b397cc3ca59271e7318fc696bd (diff)
downloadbcm5719-llvm-22a0c8dbc8bc008928b319d44ad296738940fe72.tar.gz
bcm5719-llvm-22a0c8dbc8bc008928b319d44ad296738940fe72.zip
[Index] Ignore noop #undef's when handling macro occurrences.
llvm-svn: 336584
Diffstat (limited to 'clang/lib/Index/IndexingAction.cpp')
-rw-r--r--clang/lib/Index/IndexingAction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Index/IndexingAction.cpp b/clang/lib/Index/IndexingAction.cpp
index b8faf7075e7..16f6c21745e 100644
--- a/clang/lib/Index/IndexingAction.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud