summaryrefslogtreecommitdiffstats
path: root/clang/Lex/MacroExpander.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Lex/MacroExpander.cpp')
-rw-r--r--clang/Lex/MacroExpander.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/clang/Lex/MacroExpander.cpp b/clang/Lex/MacroExpander.cpp
index aa16352816b..26be1cb25c5 100644
--- a/clang/Lex/MacroExpander.cpp
+++ b/clang/Lex/MacroExpander.cpp
@@ -79,18 +79,13 @@ void MacroExpander::Lex(LexerToken &Tok) {
// Otherwise, return a normal token.
}
-/// NextTokenIsKnownNotLParen - If the next token lexed will pop this macro
-/// off the expansion stack, return false and set RanOffEnd to true.
-/// Otherwise, return true if we know for sure that the next token returned
-/// will not be a '(' token. Return false if it is a '(' token or if we are
-/// not sure. This is used when determining whether to expand a function-like
-/// macro.
-bool MacroExpander::NextTokenIsKnownNotLParen(bool &RanOffEnd) const {
+/// isNextTokenLParen - If the next token lexed will pop this macro off the
+/// expansion stack, return 2. If the next unexpanded token is a '(', return
+/// 1, otherwise return 0.
+unsigned MacroExpander::isNextTokenLParen() const {
// Out of tokens?
- if (CurToken == Macro.getNumTokens()) {
- RanOffEnd = true;
- return false;
- }
+ if (CurToken == Macro.getNumTokens())
+ return 2;
- return Macro.getReplacementToken(CurToken).getKind() != tok::l_paren;
+ return Macro.getReplacementToken(CurToken).getKind() == tok::l_paren;
}
OpenPOWER on IntegriCloud