summaryrefslogtreecommitdiffstats
path: root/clang/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema')
-rw-r--r--clang/Sema/ASTStreamer.cpp12
-rw-r--r--clang/Sema/Sema.cpp1
-rw-r--r--clang/Sema/Sema.h4
-rw-r--r--clang/Sema/SemaDecl.cpp20
-rw-r--r--clang/Sema/SemaExpr.cpp12
-rw-r--r--clang/Sema/SemaExprCXX.cpp1
-rw-r--r--clang/Sema/SemaStmt.cpp1
-rw-r--r--clang/Sema/SemaType.cpp3
8 files changed, 22 insertions, 32 deletions
diff --git a/clang/Sema/ASTStreamer.cpp b/clang/Sema/ASTStreamer.cpp
index 4ff2ba9af5f..1057d932818 100644
--- a/clang/Sema/ASTStreamer.cpp
+++ b/clang/Sema/ASTStreamer.cpp
@@ -16,7 +16,6 @@
#include "Sema.h"
#include "clang/Parse/Action.h"
#include "clang/Parse/Parser.h"
-using namespace llvm;
using namespace clang;
namespace {
@@ -87,27 +86,26 @@ void ASTStreamer::PrintStats() const {
/// ASTStreamer_Init - Create an ASTStreamer with the specified preprocessor
/// and FileID.
-ASTStreamerTy *llvm::clang::ASTStreamer_Init(Preprocessor &pp,
- ASTContext &ctxt,
- unsigned MainFileID) {
+ASTStreamerTy *clang::ASTStreamer_Init(Preprocessor &pp, ASTContext &ctxt,
+ unsigned MainFileID) {
return new ASTStreamer(pp, ctxt, MainFileID);
}
/// ASTStreamer_ReadTopLevelDecl - Parse and return one top-level declaration. This
/// returns null at end of file.
-Decl *llvm::clang::ASTStreamer_ReadTopLevelDecl(ASTStreamerTy *Streamer) {
+Decl *clang::ASTStreamer_ReadTopLevelDecl(ASTStreamerTy *Streamer) {
return static_cast<ASTStreamer*>(Streamer)->ReadTopLevelDecl();
}
/// ASTStreamer_PrintStats - Emit statistic information to stderr.
///
-void llvm::clang::ASTStreamer_PrintStats(ASTStreamerTy *Streamer) {
+void clang::ASTStreamer_PrintStats(ASTStreamerTy *Streamer) {
return static_cast<ASTStreamer*>(Streamer)->PrintStats();
}
/// ASTStreamer_Terminate - Gracefully shut down the streamer.
///
-void llvm::clang::ASTStreamer_Terminate(ASTStreamerTy *Streamer) {
+void clang::ASTStreamer_Terminate(ASTStreamerTy *Streamer) {
delete static_cast<ASTStreamer*>(Streamer);
}
diff --git a/clang/Sema/Sema.cpp b/clang/Sema/Sema.cpp
index 91d0ec6d26d..64c18a80c0e 100644
--- a/clang/Sema/Sema.cpp
+++ b/clang/Sema/Sema.cpp
@@ -16,7 +16,6 @@
#include "clang/AST/ASTContext.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Basic/Diagnostic.h"
-using namespace llvm;
using namespace clang;
Sema::Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup)
diff --git a/clang/Sema/Sema.h b/clang/Sema/Sema.h
index 54cc87e8566..e4b7f18d0d4 100644
--- a/clang/Sema/Sema.h
+++ b/clang/Sema/Sema.h
@@ -20,7 +20,6 @@
#include <vector>
#include <string>
-namespace llvm {
namespace clang {
class ASTContext;
class Preprocessor;
@@ -57,7 +56,7 @@ class Sema : public Action {
/// LabelMap - This is a mapping from label identifiers to the LabelStmt for
/// it (which acts like the label decl in some ways). Forward referenced
/// labels have a LabelStmt created for them with a null location & SubStmt.
- DenseMap<IdentifierInfo*, LabelStmt*> LabelMap;
+ llvm::DenseMap<IdentifierInfo*, LabelStmt*> LabelMap;
public:
Sema(Preprocessor &pp, ASTContext &ctxt, std::vector<Decl*> &prevInGroup);
@@ -347,6 +346,5 @@ private:
} // end namespace clang
-} // end namespace llvm
#endif
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp
index 40b82c71c74..802685b930d 100644
--- a/clang/Sema/SemaDecl.cpp
+++ b/clang/Sema/SemaDecl.cpp
@@ -24,8 +24,6 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallSet.h"
-
-using namespace llvm;
using namespace clang;
// C99: 6.7.5p3: Used by ParseDeclarator/ParseField to make sure we have
@@ -43,7 +41,7 @@ bool Sema::VerifyConstantArrayType(const ArrayType *Array,
// Verify that the size of the array is an integer constant expr.
SourceLocation Loc;
- APSInt SizeVal(32);
+ llvm::APSInt SizeVal(32);
if (!Size->isIntegerConstantExpr(SizeVal, &Loc)) {
// FIXME: This emits the diagnostic to enforce 6.7.2.1p8, but the message
// is wrong. It is also wrong for static variables.
@@ -61,7 +59,7 @@ bool Sema::VerifyConstantArrayType(const ArrayType *Array,
// elsewhere or replicated. 'int X[-1];' inside a function should emit an
// error.
if (SizeVal.isSigned()) {
- APSInt Zero(SizeVal.getBitWidth());
+ llvm::APSInt Zero(SizeVal.getBitWidth());
Zero.setIsUnsigned(false);
if (SizeVal < Zero) {
Diag(DeclLoc, diag::err_typecheck_negative_array_size,
@@ -504,7 +502,7 @@ Sema::DeclTy *Sema::ParseStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
CurFunctionDecl = FD;
// Create Decl objects for each parameter, adding them to the FunctionDecl.
- SmallVector<ParmVarDecl*, 16> Params;
+ llvm::SmallVector<ParmVarDecl*, 16> Params;
// Check for C99 6.7.5.3p10 - foo(void) is a non-varargs function that takes
// no arguments, not a function that takes a single void argument.
@@ -531,8 +529,8 @@ Sema::DeclTy *Sema::ParseFunctionDefBody(DeclTy *D, StmtTy *Body) {
// Verify and clean out per-function state.
// Check goto/label use.
- for (DenseMap<IdentifierInfo*, LabelStmt*>::iterator I = LabelMap.begin(),
- E = LabelMap.end(); I != E; ++I) {
+ for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator
+ I = LabelMap.begin(), E = LabelMap.end(); I != E; ++I) {
// Verify that we have no forward references left. If so, there was a goto
// or address of a label taken, but no definition of it. Label fwd
// definitions are indicated with a null substmt.
@@ -753,8 +751,8 @@ void Sema::ParseRecordBody(SourceLocation RecLoc, DeclTy *RecDecl,
// Verify that all the fields are okay.
unsigned NumNamedMembers = 0;
- SmallVector<FieldDecl*, 32> RecFields;
- SmallSet<const IdentifierInfo*, 32> FieldIDs;
+ llvm::SmallVector<FieldDecl*, 32> RecFields;
+ llvm::SmallSet<const IdentifierInfo*, 32> FieldIDs;
for (unsigned i = 0; i != NumFields; ++i) {
FieldDecl *FD = cast_or_null<FieldDecl>(static_cast<Decl*>(Fields[i]));
@@ -872,7 +870,7 @@ Sema::DeclTy *Sema::ParseEnumConstant(Scope *S, DeclTy *theEnumDecl,
}
}
- APSInt EnumVal(32);
+ llvm::APSInt EnumVal(32);
QualType EltTy;
if (Val) {
// C99 6.7.2.2p2: Make sure we have an integer constant expression.
@@ -975,7 +973,7 @@ void *Sema::HandleVectorTypeAttribute(QualType curType,
return 0;
}
Expr *sizeExpr = static_cast<Expr *>(rawAttr->getArg(0));
- APSInt vecSize(32);
+ llvm::APSInt vecSize(32);
if (!sizeExpr->isIntegerConstantExpr(vecSize)) {
Diag(rawAttr->getAttributeLoc(), diag::err_attribute_vector_size_not_int,
sizeExpr->getSourceRange());
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 53c5b048db7..57830ca1b16 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -22,7 +22,6 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallString.h"
-using namespace llvm;
using namespace clang;
/// ParseStringLiteral - The specified tokens were lexed as pasted string
@@ -39,7 +38,7 @@ Sema::ParseStringLiteral(const LexerToken *StringToks, unsigned NumStringToks) {
if (Literal.hadError)
return ExprResult(true);
- SmallVector<SourceLocation, 4> StringTokLocs;
+ llvm::SmallVector<SourceLocation, 4> StringTokLocs;
for (unsigned i = 0; i != NumStringToks; ++i)
StringTokLocs.push_back(StringToks[i].getLocation());
@@ -97,7 +96,7 @@ Sema::ExprResult Sema::ParseSimplePrimaryExpr(SourceLocation Loc,
}
Sema::ExprResult Sema::ParseCharacterConstant(const LexerToken &Tok) {
- SmallString<16> CharBuffer;
+ llvm::SmallString<16> CharBuffer;
CharBuffer.resize(Tok.getLength());
const char *ThisTokBegin = &CharBuffer[0];
unsigned ActualLength = PP.getSpelling(Tok, ThisTokBegin);
@@ -117,10 +116,11 @@ Action::ExprResult Sema::ParseNumericConstant(const LexerToken &Tok) {
const char *t = PP.getSourceManager().getCharacterData(Tok.getLocation());
unsigned IntSize = Context.Target.getIntWidth(Tok.getLocation());
- return ExprResult(new IntegerLiteral(APInt(IntSize, *t-'0'), Context.IntTy,
+ return ExprResult(new IntegerLiteral(llvm::APInt(IntSize, *t-'0'),
+ Context.IntTy,
Tok.getLocation()));
}
- SmallString<512> IntegerBuffer;
+ llvm::SmallString<512> IntegerBuffer;
IntegerBuffer.resize(Tok.getLength());
const char *ThisTokBegin = &IntegerBuffer[0];
@@ -135,7 +135,7 @@ Action::ExprResult Sema::ParseNumericConstant(const LexerToken &Tok) {
QualType t;
// Get the value in the widest-possible width.
- APInt ResultVal(Context.Target.getIntMaxTWidth(Tok.getLocation()), 0);
+ llvm::APInt ResultVal(Context.Target.getIntMaxTWidth(Tok.getLocation()), 0);
if (Literal.GetIntegerValue(ResultVal)) {
// If this value didn't fit into uintmax_t, warn and force to ull.
diff --git a/clang/Sema/SemaExprCXX.cpp b/clang/Sema/SemaExprCXX.cpp
index 5b0c17086d5..15e77464417 100644
--- a/clang/Sema/SemaExprCXX.cpp
+++ b/clang/Sema/SemaExprCXX.cpp
@@ -13,7 +13,6 @@
#include "Sema.h"
#include "clang/AST/ExprCXX.h"
-using namespace llvm;
using namespace clang;
/// ParseCXXCasts - Parse {dynamic,static,reinterpret,const}_cast's.
diff --git a/clang/Sema/SemaStmt.cpp b/clang/Sema/SemaStmt.cpp
index c7b752bd307..4a270162fa7 100644
--- a/clang/Sema/SemaStmt.cpp
+++ b/clang/Sema/SemaStmt.cpp
@@ -18,7 +18,6 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
using namespace clang;
Sema::StmtResult Sema::ParseNullStmt(SourceLocation SemiLoc) {
diff --git a/clang/Sema/SemaType.cpp b/clang/Sema/SemaType.cpp
index 46a0022b7f6..cdb767f58c7 100644
--- a/clang/Sema/SemaType.cpp
+++ b/clang/Sema/SemaType.cpp
@@ -16,7 +16,6 @@
#include "clang/AST/Decl.h"
#include "clang/Parse/DeclSpec.h"
#include "clang/Lex/IdentifierTable.h"
-using namespace llvm;
using namespace clang;
/// ConvertDeclSpecToType - Convert the specified declspec to the appropriate
@@ -193,7 +192,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
} else {
// Otherwise, we have a function with an argument list that is
// potentially variadic.
- SmallVector<QualType, 16> ArgTys;
+ llvm::SmallVector<QualType, 16> ArgTys;
for (unsigned i = 0, e = FTI.NumArgs; i != e; ++i) {
QualType ArgTy = QualType::getFromOpaquePtr(FTI.ArgInfo[i].TypeInfo);
OpenPOWER on IntegriCloud