diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-23 10:55:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-23 10:55:15 +0000 |
commit | 5f9e272e632e951b1efe824cd16acb4d96077930 (patch) | |
tree | 3268557d12b85d0c2e72de5329ec83d4fc0bca48 /lib/Analysis | |
parent | d47d3b0cfeb7e8564ff77f48130fe63282b6d127 (diff) |
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/CFG.cpp | 22 | ||||
-rw-r--r-- | lib/Analysis/CFGReachabilityAnalysis.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/CocoaConventions.cpp | 19 | ||||
-rw-r--r-- | lib/Analysis/FormatString.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/PrintfFormatString.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/ReachableCode.cpp | 8 | ||||
-rw-r--r-- | lib/Analysis/UninitializedValues.cpp | 4 |
8 files changed, 29 insertions, 32 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 2a13450b4d..be6ffee668 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -1333,7 +1333,7 @@ CFGBlock *CFGBuilder::VisitDeclStmt(DeclStmt *DS) { CFGBlock *B = 0; // FIXME: Add a reverse iterator for DeclStmt to avoid this extra copy. - typedef llvm::SmallVector<Decl*,10> BufTy; + typedef SmallVector<Decl*,10> BufTy; BufTy Buf(DS->decl_begin(), DS->decl_end()); for (BufTy::reverse_iterator I = Buf.rbegin(), E = Buf.rend(); I != E; ++I) { @@ -2776,7 +2776,7 @@ CFGBlock *CFGBuilder::VisitChildrenForTemporaryDtors(Stmt *E) { // When visiting children for destructors we want to visit them in reverse // order. Because there's no reverse iterator for children must to reverse // them in helper vector. - typedef llvm::SmallVector<Stmt *, 4> ChildrenVect; + typedef SmallVector<Stmt *, 4> ChildrenVect; ChildrenVect ChildrenRev; for (Stmt::child_range I = E->children(); I; ++I) { if (*I) ChildrenRev.push_back(*I); @@ -3225,7 +3225,7 @@ public: void setBlockID(signed i) { currentBlock = i; } void setStmtID(unsigned i) { currentStmt = i; } - virtual bool handledStmt(Stmt* S, llvm::raw_ostream& OS) { + virtual bool handledStmt(Stmt* S, raw_ostream& OS) { StmtMapTy::iterator I = StmtMap.find(S); if (I == StmtMap.end()) @@ -3240,7 +3240,7 @@ public: return true; } - bool handleDecl(const Decl* D, llvm::raw_ostream& OS) { + bool handleDecl(const Decl* D, raw_ostream& OS) { DeclMapTy::iterator I = DeclMap.find(D); if (I == DeclMap.end()) @@ -3262,11 +3262,11 @@ namespace { class CFGBlockTerminatorPrint : public StmtVisitor<CFGBlockTerminatorPrint,void> { - llvm::raw_ostream& OS; + raw_ostream& OS; StmtPrinterHelper* Helper; PrintingPolicy Policy; public: - CFGBlockTerminatorPrint(llvm::raw_ostream& os, StmtPrinterHelper* helper, + CFGBlockTerminatorPrint(raw_ostream& os, StmtPrinterHelper* helper, const PrintingPolicy &Policy) : OS(os), Helper(helper), Policy(Policy) {} @@ -3356,7 +3356,7 @@ public: }; } // end anonymous namespace -static void print_elem(llvm::raw_ostream &OS, StmtPrinterHelper* Helper, +static void print_elem(raw_ostream &OS, StmtPrinterHelper* Helper, const CFGElement &E) { if (const CFGStmt *CS = E.getAs<CFGStmt>()) { Stmt *S = CS->getStmt(); @@ -3447,7 +3447,7 @@ static void print_elem(llvm::raw_ostream &OS, StmtPrinterHelper* Helper, } } -static void print_block(llvm::raw_ostream& OS, const CFG* cfg, +static void print_block(raw_ostream& OS, const CFG* cfg, const CFGBlock& B, StmtPrinterHelper* Helper, bool print_edges) { @@ -3573,7 +3573,7 @@ static void print_block(llvm::raw_ostream& OS, const CFG* cfg, void CFG::dump(const LangOptions &LO) const { print(llvm::errs(), LO); } /// print - A simple pretty printer of a CFG that outputs to an ostream. -void CFG::print(llvm::raw_ostream &OS, const LangOptions &LO) const { +void CFG::print(raw_ostream &OS, const LangOptions &LO) const { StmtPrinterHelper Helper(this, LO); // Print the entry block. @@ -3600,14 +3600,14 @@ void CFGBlock::dump(const CFG* cfg, const LangOptions &LO) const { /// print - A simple pretty printer of a CFGBlock that outputs to an ostream. /// Generally this will only be called from CFG::print. -void CFGBlock::print(llvm::raw_ostream& OS, const CFG* cfg, +void CFGBlock::print(raw_ostream& OS, const CFG* cfg, const LangOptions &LO) const { StmtPrinterHelper Helper(cfg, LO); print_block(OS, cfg, *this, &Helper, true); } /// printTerminator - A simple pretty printer of the terminator of a CFGBlock. -void CFGBlock::printTerminator(llvm::raw_ostream &OS, +void CFGBlock::printTerminator(raw_ostream &OS, const LangOptions &LO) const { CFGBlockTerminatorPrint TPrinter(OS, NULL, PrintingPolicy(LO)); TPrinter.Visit(const_cast<Stmt*>(getTerminator().getStmt())); diff --git a/lib/Analysis/CFGReachabilityAnalysis.cpp b/lib/Analysis/CFGReachabilityAnalysis.cpp index 65cd089857..e77e72fa9f 100644 --- a/lib/Analysis/CFGReachabilityAnalysis.cpp +++ b/lib/Analysis/CFGReachabilityAnalysis.cpp @@ -40,7 +40,7 @@ bool CFGReverseBlockReachabilityAnalysis::isReachable(const CFGBlock *Src, // Maps reachability to a common node by walking the predecessors of the // destination node. void CFGReverseBlockReachabilityAnalysis::mapReachability(const CFGBlock *Dst) { - llvm::SmallVector<const CFGBlock *, 11> worklist; + SmallVector<const CFGBlock *, 11> worklist; llvm::BitVector visited(analyzed.size()); ReachableSet &DstReachability = reachable[Dst->getBlockID()]; diff --git a/lib/Analysis/CocoaConventions.cpp b/lib/Analysis/CocoaConventions.cpp index 90f7092f90..176701a3ef 100644 --- a/lib/Analysis/CocoaConventions.cpp +++ b/lib/Analysis/CocoaConventions.cpp @@ -17,12 +17,9 @@ #include "clang/AST/DeclObjC.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/ErrorHandling.h" - using namespace clang; using namespace ento; -using llvm::StringRef; - // The "fundamental rule" for naming conventions of methods: // (url broken into two lines) // http://developer.apple.com/documentation/Cocoa/Conceptual/ @@ -63,11 +60,11 @@ cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S, return NoConvention; } -bool cocoa::isRefType(QualType RetTy, llvm::StringRef Prefix, - llvm::StringRef Name) { +bool cocoa::isRefType(QualType RetTy, StringRef Prefix, + StringRef Name) { // Recursively walk the typedef stack, allowing typedefs of reference types. while (const TypedefType *TD = dyn_cast<TypedefType>(RetTy.getTypePtr())) { - llvm::StringRef TDName = TD->getDecl()->getIdentifier()->getName(); + StringRef TDName = TD->getDecl()->getIdentifier()->getName(); if (TDName.startswith(Prefix) && TDName.endswith("Ref")) return true; @@ -127,10 +124,10 @@ bool cocoa::isCocoaObjectRef(QualType Ty) { return false; } -bool coreFoundation::followsCreateRule(llvm::StringRef functionName) { - llvm::StringRef::iterator it = functionName.begin(); - llvm::StringRef::iterator start = it; - llvm::StringRef::iterator endI = functionName.end(); +bool coreFoundation::followsCreateRule(StringRef functionName) { + StringRef::iterator it = functionName.begin(); + StringRef::iterator start = it; + StringRef::iterator endI = functionName.end(); while (true) { // Scan for the start of 'create' or 'copy'. @@ -149,7 +146,7 @@ bool coreFoundation::followsCreateRule(llvm::StringRef functionName) { // Scan for *lowercase* 'reate' or 'opy', followed by no lowercase // character. - llvm::StringRef suffix = functionName.substr(it - start); + StringRef suffix = functionName.substr(it - start); if (suffix.startswith("reate")) { it += 5; } diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index 5f3cd4c615..3550a5415c 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -379,7 +379,7 @@ analyze_format_string::LengthModifier::toString() const { // Methods on OptionalAmount. //===----------------------------------------------------------------------===// -void OptionalAmount::toString(llvm::raw_ostream &os) const { +void OptionalAmount::toString(raw_ostream &os) const { switch (hs) { case Invalid: case NotSpecified: diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 7b36f85ab6..b7ae141781 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -43,7 +43,7 @@ class RegisterDecls LiveVariables::AnalysisDataTy& AD; - typedef llvm::SmallVector<VarDecl*, 20> AlwaysLiveTy; + typedef SmallVector<VarDecl*, 20> AlwaysLiveTy; AlwaysLiveTy AlwaysLive; diff --git a/lib/Analysis/PrintfFormatString.cpp b/lib/Analysis/PrintfFormatString.cpp index 00b0b279e4..8b23a071d9 100644 --- a/lib/Analysis/PrintfFormatString.cpp +++ b/lib/Analysis/PrintfFormatString.cpp @@ -469,7 +469,7 @@ bool PrintfSpecifier::fixType(QualType QT) { return true; } -void PrintfSpecifier::toString(llvm::raw_ostream &os) const { +void PrintfSpecifier::toString(raw_ostream &os) const { // Whilst some features have no defined order, we are using the order // appearing in the C99 standard (ISO/IEC 9899:1999 (E) 7.19.6.1) os << "%"; diff --git a/lib/Analysis/ReachableCode.cpp b/lib/Analysis/ReachableCode.cpp index c5b17fc77b..12dfac56fd 100644 --- a/lib/Analysis/ReachableCode.cpp +++ b/lib/Analysis/ReachableCode.cpp @@ -125,7 +125,7 @@ static SourceLocation MarkLiveTop(const CFGBlock *Start, SourceManager &SM) { // Prep work worklist. - llvm::SmallVector<const CFGBlock*, 32> WL; + SmallVector<const CFGBlock*, 32> WL; WL.push_back(Start); SourceRange R1, R2; @@ -197,7 +197,7 @@ namespace clang { namespace reachable_code { unsigned ScanReachableFromBlock(const CFGBlock &Start, llvm::BitVector &Reachable) { unsigned count = 0; - llvm::SmallVector<const CFGBlock*, 32> WL; + SmallVector<const CFGBlock*, 32> WL; // Prep work queue Reachable.set(Start.getBlockID()); @@ -242,7 +242,7 @@ void FindUnreachableCode(AnalysisContext &AC, Callback &CB) { SourceRange R1, R2; - llvm::SmallVector<ErrLoc, 24> lines; + SmallVector<ErrLoc, 24> lines; bool AddEHEdges = AC.getAddEHEdges(); // First, give warnings for blocks with no predecessors, as they @@ -287,7 +287,7 @@ void FindUnreachableCode(AnalysisContext &AC, Callback &CB) { llvm::array_pod_sort(lines.begin(), lines.end(), LineCmp); - for (llvm::SmallVectorImpl<ErrLoc>::iterator I=lines.begin(), E=lines.end(); + for (SmallVectorImpl<ErrLoc>::iterator I=lines.begin(), E=lines.end(); I != E; ++I) if (I->Loc.isValid()) CB.HandleUnreachable(I->Loc, I->R1, I->R2); diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index 4301ca1293..7df2dc27b8 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -178,7 +178,7 @@ static BinaryOperator *getLogicalOperatorInChain(const CFGBlock *block) { if (!cstmt) return 0; - BinaryOperator *b = llvm::dyn_cast_or_null<BinaryOperator>(cstmt->getStmt()); + BinaryOperator *b = dyn_cast_or_null<BinaryOperator>(cstmt->getStmt()); if (!b || !b->isLogicalOp()) return 0; @@ -283,7 +283,7 @@ ValueVector::reference CFGBlockValues::operator[](const VarDecl *vd) { namespace { class DataflowWorklist { - llvm::SmallVector<const CFGBlock *, 20> worklist; + SmallVector<const CFGBlock *, 20> worklist; llvm::BitVector enqueuedBlocks; public: DataflowWorklist(const CFG &cfg) : enqueuedBlocks(cfg.getNumBlockIDs()) {} |