summaryrefslogtreecommitdiffstats
path: root/clang/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-06-15 23:05:46 +0000
committerChris Lattner <sabre@nondot.org>2007-06-15 23:05:46 +0000
commit23b7eb677d87a79179d5e71aba547c4c7794b215 (patch)
treeb53780d6f65b69236a0d25f0508d410c938303d4 /clang/Lex/PPExpressions.cpp
parent2b228c95aa9bf69f27af12294149f57459ef41b1 (diff)
downloadbcm5719-llvm-23b7eb677d87a79179d5e71aba547c4c7794b215.tar.gz
bcm5719-llvm-23b7eb677d87a79179d5e71aba547c4c7794b215.zip
Finally bite the bullet and make the major change: split the clang namespace
out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
Diffstat (limited to 'clang/Lex/PPExpressions.cpp')
-rw-r--r--clang/Lex/PPExpressions.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp
index 83679423a4b..b3457e79271 100644
--- a/clang/Lex/PPExpressions.cpp
+++ b/clang/Lex/PPExpressions.cpp
@@ -24,10 +24,9 @@
#include "clang/Basic/Diagnostic.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/SmallString.h"
-using namespace llvm;
using namespace clang;
-static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
+static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
LexerToken &PeekTok, bool ValueLive,
Preprocessor &PP);
@@ -61,7 +60,7 @@ struct DefinedTracker {
/// If ValueLive is false, then this value is being evaluated in a context where
/// the result is not used. As such, avoid diagnostics that relate to
/// evaluation.
-static bool EvaluateValue(APSInt &Result, LexerToken &PeekTok,
+static bool EvaluateValue(llvm::APSInt &Result, LexerToken &PeekTok,
DefinedTracker &DT, bool ValueLive,
Preprocessor &PP) {
Result = 0;
@@ -153,7 +152,7 @@ static bool EvaluateValue(APSInt &Result, LexerToken &PeekTok,
PP.Diag(PeekTok, diag::err_pp_expected_value_in_expr);
return true;
case tok::numeric_constant: {
- SmallString<64> IntegerBuffer;
+ llvm::SmallString<64> IntegerBuffer;
IntegerBuffer.resize(PeekTok.getLength());
const char *ThisTokBegin = &IntegerBuffer[0];
unsigned ActualLength = PP.getSpelling(PeekTok, ThisTokBegin);
@@ -193,7 +192,7 @@ static bool EvaluateValue(APSInt &Result, LexerToken &PeekTok,
return false;
}
case tok::char_constant: { // 'x'
- SmallString<32> CharBuffer;
+ llvm::SmallString<32> CharBuffer;
CharBuffer.resize(PeekTok.getLength());
const char *ThisTokBegin = &CharBuffer[0];
unsigned ActualLength = PP.getSpelling(PeekTok, ThisTokBegin);
@@ -211,7 +210,7 @@ static bool EvaluateValue(APSInt &Result, LexerToken &PeekTok,
NumBits = TI.getCharWidth(PeekTok.getLocation());
// Set the width.
- APSInt Val(NumBits);
+ llvm::APSInt Val(NumBits);
// Set the value.
Val = Literal.getValue();
// Set the signedness.
@@ -360,7 +359,7 @@ static unsigned getPrecedence(tok::TokenKind Kind) {
/// If ValueLive is false, then this value is being evaluated in a context where
/// the result is not used. As such, avoid diagnostics that relate to
/// evaluation.
-static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
+static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
LexerToken &PeekTok, bool ValueLive,
Preprocessor &PP) {
unsigned PeekPrec = getPrecedence(PeekTok.getKind());
@@ -397,7 +396,7 @@ static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
LexerToken OpToken = PeekTok;
PP.LexNonComment(PeekTok);
- APSInt RHS(LHS.getBitWidth());
+ llvm::APSInt RHS(LHS.getBitWidth());
// Parse the RHS of the operator.
DefinedTracker DT;
if (EvaluateValue(RHS, PeekTok, DT, RHSIsLive, PP)) return true;
@@ -427,7 +426,7 @@ static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
// Usual arithmetic conversions (C99 6.3.1.8p1): result is unsigned if
// either operand is unsigned. Don't do this for x and y in "x ? y : z".
- APSInt Res(LHS.getBitWidth());
+ llvm::APSInt Res(LHS.getBitWidth());
if (Operator != tok::question) {
Res.setIsUnsigned(LHS.isUnsigned()|RHS.isUnsigned());
// If this just promoted something from signed to unsigned, and if the
@@ -564,7 +563,7 @@ static bool EvaluateDirectiveSubExpr(APSInt &LHS, unsigned MinPrec,
// Evaluate the value after the :.
bool AfterColonLive = ValueLive && LHS == 0;
- APSInt AfterColonVal(LHS.getBitWidth());
+ llvm::APSInt AfterColonVal(LHS.getBitWidth());
DefinedTracker DT;
if (EvaluateValue(AfterColonVal, PeekTok, DT, AfterColonLive, PP))
return true;
@@ -613,7 +612,7 @@ EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro) {
// C99 6.10.1p3 - All expressions are evaluated as intmax_t or uintmax_t.
unsigned BitWidth = getTargetInfo().getIntMaxTWidth(Tok.getLocation());
- APSInt ResVal(BitWidth);
+ llvm::APSInt ResVal(BitWidth);
DefinedTracker DT;
if (EvaluateValue(ResVal, Tok, DT, true, *this)) {
// Parse error, skip the rest of the macro line.
OpenPOWER on IntegriCloud