summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-05-04 03:15:40 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-05-04 03:15:40 +0000
commit36bd40df7252be541973580e27c7bcbd62e6a605 (patch)
tree7f34e5173bc70b18dea0591769976aaa75364466 /clang/lib/Lex/PPMacroExpansion.cpp
parent410a9e1e1e266ef6efe0ac6eb35b9933535ae33c (diff)
downloadbcm5719-llvm-36bd40df7252be541973580e27c7bcbd62e6a605.tar.gz
bcm5719-llvm-36bd40df7252be541973580e27c7bcbd62e6a605.zip
Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion.
llvm-svn: 236404
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index edeed42c17e..5af0205af37 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -419,10 +419,9 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// If this is a builtin macro, like __LINE__ or _Pragma, handle it specially.
if (MI->isBuiltinMacro()) {
- // FIXME: Tell callbacks about module macros.
- if (Callbacks) Callbacks->MacroExpands(Identifier, M.getLocalDirective(),
- Identifier.getLocation(),
- /*Args=*/nullptr);
+ if (Callbacks)
+ Callbacks->MacroExpands(Identifier, M, Identifier.getLocation(),
+ /*Args=*/nullptr);
ExpandBuiltinMacro(Identifier);
return true;
}
@@ -468,13 +467,10 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// reading the function macro arguments. To ensure, in that case, that
// MacroExpands callbacks still happen in source order, queue this
// callback to have it happen after the function macro callback.
- // FIXME: Tell callbacks about module macros.
DelayedMacroExpandsCallbacks.push_back(
- MacroExpandsInfo(Identifier, M.getLocalDirective(), ExpansionRange));
+ MacroExpandsInfo(Identifier, M, ExpansionRange));
} else {
- // FIXME: Tell callbacks about module macros.
- Callbacks->MacroExpands(Identifier, M.getLocalDirective(), ExpansionRange,
- Args);
+ Callbacks->MacroExpands(Identifier, M, ExpansionRange, Args);
if (!DelayedMacroExpandsCallbacks.empty()) {
for (unsigned i=0, e = DelayedMacroExpandsCallbacks.size(); i!=e; ++i) {
MacroExpandsInfo &Info = DelayedMacroExpandsCallbacks[i];
OpenPOWER on IntegriCloud