aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-24 00:05:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-24 00:05:14 +0000
commitc515978bd3a703aa733f846a0094ffa84d149074 (patch)
tree575f1660e68d74b4268c6a1460f2fbb4245da518 /include/clang/Lex/Preprocessor.h
parent82a29af8cbc4b117af83c5c5dfa875b5699c97c4 (diff)
[preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index c1c55db41a..eccd449869 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -303,10 +303,10 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
struct MacroExpandsInfo {
Token Tok;
- MacroInfo *MI;
+ MacroDirective *MD;
SourceRange Range;
- MacroExpandsInfo(Token Tok, MacroInfo *MI, SourceRange Range)
- : Tok(Tok), MI(MI), Range(Range) { }
+ MacroExpandsInfo(Token Tok, MacroDirective *MD, SourceRange Range)
+ : Tok(Tok), MD(MD), Range(Range) { }
};
SmallVector<MacroExpandsInfo, 2> DelayedMacroExpandsCallbacks;
@@ -560,10 +560,10 @@ public:
MacroDirective *getMacroDirectiveHistory(const IdentifierInfo *II) const;
/// \brief Specify a macro for this identifier.
- void setMacroDirective(IdentifierInfo *II, MacroInfo *MI,
- SourceLocation Loc, bool isImported);
- void setMacroDirective(IdentifierInfo *II, MacroInfo *MI) {
- setMacroDirective(II, MI, MI->getDefinitionLoc(), false);
+ MacroDirective *setMacroDirective(IdentifierInfo *II, MacroInfo *MI,
+ SourceLocation Loc, bool isImported);
+ MacroDirective *setMacroDirective(IdentifierInfo *II, MacroInfo *MI) {
+ return setMacroDirective(II, MI, MI->getDefinitionLoc(), false);
}
/// \brief Add a MacroInfo that was loaded from an AST file.
void addLoadedMacroInfo(IdentifierInfo *II, MacroDirective *MD,
@@ -1333,7 +1333,7 @@ private:
/// HandleMacroExpandedIdentifier - If an identifier token is read that is to
/// be expanded as a macro, handle it and return the next token as 'Tok'. If
/// the macro should not be expanded return true, otherwise return false.
- bool HandleMacroExpandedIdentifier(Token &Tok, MacroInfo *MI);
+ bool HandleMacroExpandedIdentifier(Token &Tok, MacroDirective *MD);
/// \brief Cache macro expanded tokens for TokenLexers.
//