diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2019-01-15 17:20:05 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2019-01-15 17:20:05 +0000 |
commit | d4d77343e5d51d121c6e7b6cfc5b08510cb1430d (patch) | |
tree | 7a9ca16c2380ea0582fa032557ba50a9f685f168 /clang/lib/Lex/PPExpressions.cpp | |
parent | b709b600a55beec64192fa8a0174b7db9af75114 (diff) | |
download | bcm5719-llvm-d4d77343e5d51d121c6e7b6cfc5b08510cb1430d.tar.gz bcm5719-llvm-d4d77343e5d51d121c6e7b6cfc5b08510cb1430d.zip |
Revert "Correct the source range returned from preprocessor callbacks."
This reverts commit r350891. Also add a test case that would return an
empty string with r350891.
llvm-svn: 351209
Diffstat (limited to 'clang/lib/Lex/PPExpressions.cpp')
-rw-r--r-- | clang/lib/Lex/PPExpressions.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Lex/PPExpressions.cpp b/clang/lib/Lex/PPExpressions.cpp index d40cd5cba7d..ac01efad9bf 100644 --- a/clang/lib/Lex/PPExpressions.cpp +++ b/clang/lib/Lex/PPExpressions.cpp @@ -152,8 +152,8 @@ static bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT, return true; } // Consume the ). - PP.LexNonComment(PeekTok); Result.setEnd(PeekTok.getLocation()); + PP.LexNonComment(PeekTok); } else { // Consume identifier. Result.setEnd(PeekTok.getLocation()); @@ -849,7 +849,7 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) { // Restore 'DisableMacroExpansion'. DisableMacroExpansion = DisableMacroExpansionAtStartOfDirective; - return {false, DT.IncludedUndefinedIds, {}}; + return {false, DT.IncludedUndefinedIds}; } // If we are at the end of the expression after just parsing a value, there @@ -863,7 +863,7 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) { // Restore 'DisableMacroExpansion'. DisableMacroExpansion = DisableMacroExpansionAtStartOfDirective; - return {ResVal.Val != 0, DT.IncludedUndefinedIds, ResVal.getRange()}; + return {ResVal.Val != 0, DT.IncludedUndefinedIds}; } // Otherwise, we must have a binary operator (e.g. "#if 1 < 2"), so parse the @@ -876,7 +876,7 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) { // Restore 'DisableMacroExpansion'. DisableMacroExpansion = DisableMacroExpansionAtStartOfDirective; - return {false, DT.IncludedUndefinedIds, ResVal.getRange()}; + return {false, DT.IncludedUndefinedIds}; } // If we aren't at the tok::eod token, something bad happened, like an extra @@ -888,5 +888,5 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) { // Restore 'DisableMacroExpansion'. DisableMacroExpansion = DisableMacroExpansionAtStartOfDirective; - return {ResVal.Val != 0, DT.IncludedUndefinedIds, ResVal.getRange()}; + return {ResVal.Val != 0, DT.IncludedUndefinedIds}; } |