aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/Lexer.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-19 15:59:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-19 15:59:08 +0000
commit69bda4c027671df7163619f215209529eb236620 (patch)
tree7af67df24bd01174f113df8ec7416d04527ec5d2 /include/clang/Lex/Lexer.h
parent19d5aea478b4f542e1ef7c36741e719c660bcc20 (diff)
For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macro
start/end location. It is commonly needed after calling the function; with this way we avoid recalculating it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Lexer.h')
-rw-r--r--include/clang/Lex/Lexer.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h
index 1751d22b0b..99c16d292a 100644
--- a/include/clang/Lex/Lexer.h
+++ b/include/clang/Lex/Lexer.h
@@ -313,15 +313,23 @@ public:
/// \brief Returns true if the given MacroID location points at the first
/// token of the macro expansion.
+ ///
+ /// \param MacroBegin If non-null and function returns true, it is set to
+ /// begin location of the macro.
static bool isAtStartOfMacroExpansion(SourceLocation loc,
- const SourceManager &SM,
- const LangOptions &LangOpts);
+ const SourceManager &SM,
+ const LangOptions &LangOpts,
+ SourceLocation *MacroBegin = 0);
/// \brief Returns true if the given MacroID location points at the last
/// token of the macro expansion.
+ ///
+ /// \param MacroBegin If non-null and function returns true, it is set to
+ /// end location of the macro.
static bool isAtEndOfMacroExpansion(SourceLocation loc,
- const SourceManager &SM,
- const LangOptions &LangOpts);
+ const SourceManager &SM,
+ const LangOptions &LangOpts,
+ SourceLocation *MacroEnd = 0);
/// \brief Retrieve the name of the immediate macro expansion.
///