summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPMacroExpansion.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-03 22:31:32 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-03 22:31:32 +0000
commit37e48ff547a9b27231e37757c07c11d068fe7e21 (patch)
tree6140cd279a7c27b60a84729e326753989dcd43fb /clang/lib/Lex/PPMacroExpansion.cpp
parent5d2ce840c1bdfc88da6473314fe9ab521948f195 (diff)
downloadbcm5719-llvm-37e48ff547a9b27231e37757c07c11d068fe7e21.tar.gz
bcm5719-llvm-37e48ff547a9b27231e37757c07c11d068fe7e21.zip
[Preprocessor] For the MacroExpands preprocessor callback, also pass the MacroArgs object that provides information about
the argument tokens for a function macro. llvm-svn: 181065
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r--clang/lib/Lex/PPMacroExpansion.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index e5b00d6bb88..167823358af 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
#include "clang/Lex/Preprocessor.h"
-#include "MacroArgs.h"
+#include "clang/Lex/MacroArgs.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
@@ -223,7 +223,7 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// If this is a builtin macro, like __LINE__ or _Pragma, handle it specially.
if (MI->isBuiltinMacro()) {
if (Callbacks) Callbacks->MacroExpands(Identifier, MD,
- Identifier.getLocation());
+ Identifier.getLocation(),/*Args=*/0);
ExpandBuiltinMacro(Identifier);
return false;
}
@@ -277,11 +277,12 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
DelayedMacroExpandsCallbacks.push_back(
MacroExpandsInfo(Identifier, MD, ExpansionRange));
} else {
- Callbacks->MacroExpands(Identifier, MD, ExpansionRange);
+ Callbacks->MacroExpands(Identifier, MD, ExpansionRange, Args);
if (!DelayedMacroExpandsCallbacks.empty()) {
for (unsigned i=0, e = DelayedMacroExpandsCallbacks.size(); i!=e; ++i) {
MacroExpandsInfo &Info = DelayedMacroExpandsCallbacks[i];
- Callbacks->MacroExpands(Info.Tok, Info.MD, Info.Range);
+ // FIXME: We lose macro args info with delayed callback.
+ Callbacks->MacroExpands(Info.Tok, Info.MD, Info.Range, /*Args=*/0);
}
DelayedMacroExpandsCallbacks.clear();
}
OpenPOWER on IntegriCloud