summaryrefslogtreecommitdiffstats
path: root/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-09-07 21:53:17 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-09-07 21:53:17 +0000
commit76355613f3428003e0ab14dd2b78dabbb666c550 (patch)
treeac5eb89270fa3de369c5e004008871e30a063dc1 /lib/Lex/PPExpressions.cpp
parent72f585e6910136ad0abe5f11ae211127cf3e35ea (diff)
Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D24115 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r--lib/Lex/PPExpressions.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 94075ece35..862a4713e4 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/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)