projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2d44de
)
[modules] Don't bother creating a ModuleMacro representing a #undef that overrides...
author
Richard Smith
<richard-llvm@metafoo.co.uk>
Sat, 2 May 2015 01:14:40 +0000
(
01:14
+0000)
committer
Richard Smith
<richard-llvm@metafoo.co.uk>
Sat, 2 May 2015 01:14:40 +0000
(
01:14
+0000)
llvm-svn: 236374
clang/lib/Lex/PPLexerChange.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Lex/PPLexerChange.cpp
b/clang/lib/Lex/PPLexerChange.cpp
index
d4defdd
..
a27bcd0
100644
(file)
--- a/
clang/lib/Lex/PPLexerChange.cpp
+++ b/
clang/lib/Lex/PPLexerChange.cpp
@@
-685,8
+685,11
@@
void Preprocessor::LeaveSubmodule() {
// FIXME: Issue a warning if multiple headers for the same submodule
// define a macro, rather than silently ignoring all but the first.
bool IsNew;
- addModuleMacro(Info.M, II, Def, Macro.second.getOverriddenMacros(),
- IsNew);
+ // Don't bother creating a module macro if it would represent a #undef
+ // that doesn't override anything.
+ if (Def || !Macro.second.getOverriddenMacros().empty())
+ addModuleMacro(Info.M, II, Def, Macro.second.getOverriddenMacros(),
+ IsNew);
break;
}
}