diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp b/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp index 94075ec..862a471 100644 --- a/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp +++ b/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp @@ -17,14 +17,24 @@ //===----------------------------------------------------------------------===// #include "clang/Lex/Preprocessor.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" +#include "clang/Basic/TokenKinds.h" #include "clang/Lex/CodeCompletionHandler.h" #include "clang/Lex/LexDiagnostic.h" #include "clang/Lex/LiteralSupport.h" #include "clang/Lex/MacroInfo.h" +#include "clang/Lex/PPCallbacks.h" +#include "clang/Lex/Token.h" #include "llvm/ADT/APSInt.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/SaveAndRestore.h" +#include <cassert> + using namespace clang; namespace { @@ -34,6 +44,7 @@ namespace { class PPValue { SourceRange Range; IdentifierInfo *II; + public: llvm::APSInt Val; @@ -58,7 +69,7 @@ public: void setEnd(SourceLocation L) { Range.setEnd(L); } }; -} +} // end anonymous namespace static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, Token &PeekTok, bool ValueLive, @@ -469,8 +480,6 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, } } - - /// getPrecedence - Return the precedence of the specified binary operator /// token. This returns: /// ~0 - Invalid token. @@ -531,7 +540,7 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, return true; } - while (1) { + while (true) { // If this token has a lower precedence than we are allowed to parse, return // it so that higher levels of the recursion can parse it. if (PeekPrec < MinPrec) |