aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-23 10:55:15 +0000
committerChris Lattner <sabre@nondot.org>2011-07-23 10:55:15 +0000
commit5f9e272e632e951b1efe824cd16acb4d96077930 (patch)
tree3268557d12b85d0c2e72de5329ec83d4fc0bca48 /lib/StaticAnalyzer/Core
parentd47d3b0cfeb7e8564ff77f48130fe63282b6d127 (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/StaticAnalyzer/Core')
-rw-r--r--lib/StaticAnalyzer/Core/BasicConstraintManager.cpp4
-rw-r--r--lib/StaticAnalyzer/Core/BasicStore.cpp8
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp34
-rw-r--r--lib/StaticAnalyzer/Core/CFRefCount.cpp51
-rw-r--r--lib/StaticAnalyzer/Core/CXXExprEngine.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/CheckerManager.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/CoreEngine.cpp15
-rw-r--r--lib/StaticAnalyzer/Core/Environment.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/ExplodedGraph.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp15
-rw-r--r--lib/StaticAnalyzer/Core/FlatStore.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/GRState.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp18
-rw-r--r--lib/StaticAnalyzer/Core/MemRegion.cpp36
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp13
-rw-r--r--lib/StaticAnalyzer/Core/PlistDiagnostics.cpp45
-rw-r--r--lib/StaticAnalyzer/Core/RangeConstraintManager.cpp6
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp24
-rw-r--r--lib/StaticAnalyzer/Core/SVals.cpp9
-rw-r--r--lib/StaticAnalyzer/Core/SymbolManager.cpp16
-rw-r--r--lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp4
21 files changed, 154 insertions, 172 deletions
diff --git a/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp b/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
index 3050ca3ce3..0518740dad 100644
--- a/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
+++ b/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
@@ -92,7 +92,7 @@ public:
const GRState* removeDeadBindings(const GRState* state, SymbolReaper& SymReaper);
- void print(const GRState* state, llvm::raw_ostream& Out,
+ void print(const GRState* state, raw_ostream& Out,
const char* nl, const char *sep);
};
@@ -301,7 +301,7 @@ BasicConstraintManager::removeDeadBindings(const GRState* state,
return state->set<ConstNotEq>(CNE);
}
-void BasicConstraintManager::print(const GRState* state, llvm::raw_ostream& Out,
+void BasicConstraintManager::print(const GRState* state, raw_ostream& Out,
const char* nl, const char *sep) {
// Print equality constraints.
diff --git a/lib/StaticAnalyzer/Core/BasicStore.cpp b/lib/StaticAnalyzer/Core/BasicStore.cpp
index 7c9f45a474..c8ac7220c6 100644
--- a/lib/StaticAnalyzer/Core/BasicStore.cpp
+++ b/lib/StaticAnalyzer/Core/BasicStore.cpp
@@ -77,7 +77,7 @@ public:
/// It updatees the GRState object in place with the values removed.
StoreRef removeDeadBindings(Store store, const StackFrameContext *LCtx,
SymbolReaper& SymReaper,
- llvm::SmallVectorImpl<const MemRegion*>& RegionRoots);
+ SmallVectorImpl<const MemRegion*>& RegionRoots);
void iterBindings(Store store, BindingsHandler& f);
@@ -95,7 +95,7 @@ public:
return BindingsTy(static_cast<const BindingsTy::TreeTy*>(store));
}
- void print(Store store, llvm::raw_ostream& Out, const char* nl,
+ void print(Store store, raw_ostream& Out, const char* nl,
const char *sep);
private:
@@ -283,7 +283,7 @@ StoreRef BasicStoreManager::Remove(Store store, Loc loc) {
StoreRef BasicStoreManager::removeDeadBindings(Store store,
const StackFrameContext *LCtx,
SymbolReaper& SymReaper,
- llvm::SmallVectorImpl<const MemRegion*>& RegionRoots)
+ SmallVectorImpl<const MemRegion*>& RegionRoots)
{
BindingsTy B = GetBindings(store);
typedef SVal::symbol_iterator symbol_iterator;
@@ -499,7 +499,7 @@ StoreRef BasicStoreManager::BindDeclInternal(Store store, const VarRegion* VR,
return newStore;
}
-void BasicStoreManager::print(Store store, llvm::raw_ostream& Out,
+void BasicStoreManager::print(Store store, raw_ostream& Out,
const char* nl, const char *sep) {
BindingsTy B = GetBindings(store);
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 8b5d383ed0..2f7b67aa06 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1312,10 +1312,10 @@ void BugReporter::FlushReports() {
// warnings and new BugTypes.
// FIXME: Only NSErrorChecker needs BugType's FlushReports.
// Turn NSErrorChecker into a proper checker and remove this.
- llvm::SmallVector<const BugType*, 16> bugTypes;
+ SmallVector<const BugType*, 16> bugTypes;
for (BugTypesTy::iterator I=BugTypes.begin(), E=BugTypes.end(); I!=E; ++I)
bugTypes.push_back(*I);
- for (llvm::SmallVector<const BugType*, 16>::iterator
+ for (SmallVector<const BugType*, 16>::iterator
I = bugTypes.begin(), E = bugTypes.end(); I != E; ++I)
const_cast<BugType*>(*I)->FlushReports(*this);
@@ -1344,7 +1344,7 @@ void BugReporter::FlushReports() {
static std::pair<std::pair<ExplodedGraph*, NodeBackMap*>,
std::pair<ExplodedNode*, unsigned> >
MakeReportGraph(const ExplodedGraph* G,
- llvm::SmallVectorImpl<const ExplodedNode*> &nodes) {
+ SmallVectorImpl<const ExplodedNode*> &nodes) {
// Create the trimmed graph. It will contain the shortest paths from the
// error nodes to the root. In the new graph we should only have one
@@ -1569,11 +1569,11 @@ static void CompactPathDiagnostic(PathDiagnostic &PD, const SourceManager& SM) {
}
void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
- llvm::SmallVectorImpl<BugReport *> &bugReports) {
+ SmallVectorImpl<BugReport *> &bugReports) {
assert(!bugReports.empty());
- llvm::SmallVector<const ExplodedNode *, 10> errorNodes;
- for (llvm::SmallVectorImpl<BugReport*>::iterator I = bugReports.begin(),
+ SmallVector<const ExplodedNode *, 10> errorNodes;
+ for (SmallVectorImpl<BugReport*>::iterator I = bugReports.begin(),
E = bugReports.end(); I != E; ++I) {
errorNodes.push_back((*I)->getErrorNode());
}
@@ -1655,7 +1655,7 @@ struct FRIEC_WLItem {
static BugReport *
FindReportInEquivalenceClass(BugReportEquivClass& EQ,
- llvm::SmallVectorImpl<BugReport*> &bugReports) {
+ SmallVectorImpl<BugReport*> &bugReports) {
BugReportEquivClass::iterator I = EQ.begin(), E = EQ.end();
assert(I != E);
@@ -1706,7 +1706,7 @@ FindReportInEquivalenceClass(BugReportEquivClass& EQ,
// At this point we know that 'N' is not a sink and it has at least one
// successor. Use a DFS worklist to find a non-sink end-of-path node.
typedef FRIEC_WLItem WLItem;
- typedef llvm::SmallVector<WLItem, 10> DFSWorkList;
+ typedef SmallVector<WLItem, 10> DFSWorkList;
llvm::DenseMap<const ExplodedNode *, unsigned> Visited;
DFSWorkList WL;
@@ -1798,7 +1798,7 @@ static bool IsCachedDiagnostic(BugReport *R, PathDiagnostic *PD) {
}
void BugReporter::FlushReport(BugReportEquivClass& EQ) {
- llvm::SmallVector<BugReport*, 10> bugReports;
+ SmallVector<BugReport*, 10> bugReports;
BugReport *exampleReport = FindReportInEquivalenceClass(EQ, bugReports);
if (!exampleReport)
return;
@@ -1836,12 +1836,12 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) {
// Search the description for '%', as that will be interpretted as a
// format character by FormatDiagnostics.
- llvm::StringRef desc = exampleReport->getShortDescription();
+ StringRef desc = exampleReport->getShortDescription();
unsigned ErrorDiag;
{
llvm::SmallString<512> TmpStr;
llvm::raw_svector_ostream Out(TmpStr);
- for (llvm::StringRef::iterator I=desc.begin(), E=desc.end(); I!=E; ++I)
+ for (StringRef::iterator I=desc.begin(), E=desc.end(); I!=E; ++I)
if (*I == '%')
Out << "%%";
else
@@ -1872,15 +1872,15 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) {
PD->HandlePathDiagnostic(D.take());
}
-void BugReporter::EmitBasicReport(llvm::StringRef name, llvm::StringRef str,
+void BugReporter::EmitBasicReport(StringRef name, StringRef str,
SourceLocation Loc,
SourceRange* RBeg, unsigned NumRanges) {
EmitBasicReport(name, "", str, Loc, RBeg, NumRanges);
}
-void BugReporter::EmitBasicReport(llvm::StringRef name,
- llvm::StringRef category,
- llvm::StringRef str, SourceLocation Loc,
+void BugReporter::EmitBasicReport(StringRef name,
+ StringRef category,
+ StringRef str, SourceLocation Loc,
SourceRange* RBeg, unsigned NumRanges) {
// 'BT' is owned by BugReporter.
@@ -1891,8 +1891,8 @@ void BugReporter::EmitBasicReport(llvm::StringRef name,
EmitReport(R);
}
-BugType *BugReporter::getBugTypeForName(llvm::StringRef name,
- llvm::StringRef category) {
+BugType *BugReporter::getBugTypeForName(StringRef name,
+ StringRef category) {
llvm::SmallString<136> fullDesc;
llvm::raw_svector_ostream(fullDesc) << name << ":" << category;
llvm::StringMapEntry<BugType *> &
diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp
index 7eb65cef19..80e1102411 100644
--- a/lib/StaticAnalyzer/Core/CFRefCount.cpp
+++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp
@@ -34,11 +34,10 @@
#include "llvm/ADT/ImmutableMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
-#include <stdarg.h>
+#include <cstdarg>
using namespace clang;
using namespace ento;
-using llvm::StringRef;
using llvm::StrInStrNoCase;
namespace {
@@ -305,10 +304,10 @@ public:
ID.Add(T);
}
- void print(llvm::raw_ostream& Out) const;
+ void print(raw_ostream& Out) const;
};
-void RefVal::print(llvm::raw_ostream& Out) const {
+void RefVal::print(raw_ostream& Out) const {
if (!T.isNull())
Out << "Tracked Type:" << T.getAsString() << '\n';
@@ -739,7 +738,7 @@ private:
}
Selector generateSelector(va_list argp) {
- llvm::SmallVector<IdentifierInfo*, 10> II;
+ SmallVector<IdentifierInfo*, 10> II;
while (const char* s = va_arg(argp, const char*))
II.push_back(&Ctx.Idents.get(s));
@@ -1654,7 +1653,7 @@ class CFRefCount : public TransferFuncs {
public:
class BindingsPrinter : public GRState::Printer {
public:
- virtual void Print(llvm::raw_ostream& Out, const GRState* state,
+ virtual void Print(raw_ostream& Out, const GRState* state,
const char* nl, const char* sep);
};
@@ -1684,10 +1683,10 @@ public:
RefVal::Kind hasErr, SymbolRef Sym);
const GRState * HandleSymbolDeath(const GRState * state, SymbolRef sid, RefVal V,
- llvm::SmallVectorImpl<SymbolRef> &Leaked);
+ SmallVectorImpl<SymbolRef> &Leaked);
ExplodedNode* ProcessLeaks(const GRState * state,
- llvm::SmallVectorImpl<SymbolRef> &Leaked,
+ SmallVectorImpl<SymbolRef> &Leaked,
GenericNodeBuilderRefCount &Builder,
ExprEngine &Eng,
ExplodedNode *Pred = 0);
@@ -1787,7 +1786,7 @@ public:
} // end anonymous namespace
-static void PrintPool(llvm::raw_ostream &Out, SymbolRef Sym,
+static void PrintPool(raw_ostream &Out, SymbolRef Sym,
const GRState *state) {
Out << ' ';
if (Sym)
@@ -1804,7 +1803,7 @@ static void PrintPool(llvm::raw_ostream &Out, SymbolRef Sym,
Out << '}';
}
-void CFRefCount::BindingsPrinter::Print(llvm::raw_ostream& Out,
+void CFRefCount::BindingsPrinter::Print(raw_ostream& Out,
const GRState* state,
const char* nl, const char* sep) {
@@ -1844,7 +1843,7 @@ namespace {
protected:
CFRefCount& TF;
- CFRefBug(CFRefCount* tf, llvm::StringRef name)
+ CFRefBug(CFRefCount* tf, StringRef name)
: BugType(name, "Memory (Core Foundation/Objective-C)"), TF(*tf) {}
public:
@@ -1920,7 +1919,7 @@ namespace {
class Leak : public CFRefBug {
const bool isReturn;
protected:
- Leak(CFRefCount* tf, llvm::StringRef name, bool isRet)
+ Leak(CFRefCount* tf, StringRef name, bool isRet)
: CFRefBug(tf, name), isReturn(isRet) {}
public:
@@ -1931,13 +1930,13 @@ namespace {
class LeakAtReturn : public Leak {
public:
- LeakAtReturn(CFRefCount* tf, llvm::StringRef name)
+ LeakAtReturn(CFRefCount* tf, StringRef name)
: Leak(tf, name, true) {}
};
class LeakWithinFunction : public Leak {
public:
- LeakWithinFunction(CFRefCount* tf, llvm::StringRef name)
+ LeakWithinFunction(CFRefCount* tf, StringRef name)
: Leak(tf, name, false) {}
};
@@ -1955,7 +1954,7 @@ namespace {
: RangedBugReport(D, D.getDescription(), n), Sym(sym), TF(tf) {}
CFRefReport(CFRefBug& D, const CFRefCount &tf,
- ExplodedNode *n, SymbolRef sym, llvm::StringRef endText)
+ ExplodedNode *n, SymbolRef sym, StringRef endText)
: RangedBugReport(D, D.getDescription(), endText, n), Sym(sym), TF(tf) {}
virtual ~CFRefReport() {}
@@ -2036,9 +2035,9 @@ std::pair<const char**,const char**> CFRefReport::getExtraDescriptiveText() {
}
}
-static inline bool contains(const llvm::SmallVectorImpl<ArgEffect>& V,
+static inline bool contains(const SmallVectorImpl<ArgEffect>& V,
ArgEffect X) {
- for (llvm::SmallVectorImpl<ArgEffect>::const_iterator I=V.begin(), E=V.end();
+ for (SmallVectorImpl<ArgEffect>::const_iterator I=V.begin(), E=V.end();
I!=E; ++I)
if (*I == X) return true;
@@ -2114,7 +2113,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N,
// Gather up the effects that were performed on the object at this
// program point
- llvm::SmallVector<ArgEffect, 2> AEffects;
+ SmallVector<ArgEffect, 2> AEffects;
if (const RetainSummary *Summ =
TF.getSummaryOfNode(BRC.getNodeResolver().getOriginalNode(N))) {
@@ -2249,7 +2248,7 @@ PathDiagnosticPiece* CFRefReport::VisitNode(const ExplodedNode* N,
}
// Emit any remaining diagnostics for the argument effects (if any).
- for (llvm::SmallVectorImpl<ArgEffect>::iterator I=AEffects.begin(),
+ for (SmallVectorImpl<ArgEffect>::iterator I=AEffects.begin(),
E=AEffects.end(); I != E; ++I) {
// A bunch of things have alternate behavior under GC.
@@ -2555,7 +2554,7 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
SourceRange ErrorRange;
SymbolRef ErrorSym = 0;
- llvm::SmallVector<const MemRegion*, 10> RegionsToInvalidate;
+ SmallVector<const MemRegion*, 10> RegionsToInvalidate;
// Use RAII to make sure the whitelist is properly cleared.
ResetWhiteList resetWhiteList;
@@ -3309,7 +3308,7 @@ CFRefCount::HandleAutoreleaseCounts(const GRState * state,
const GRState *
CFRefCount::HandleSymbolDeath(const GRState * state, SymbolRef sid, RefVal V,
- llvm::SmallVectorImpl<SymbolRef> &Leaked) {
+ SmallVectorImpl<SymbolRef> &Leaked) {
bool hasLeak = V.isOwned() ||
((V.isNotOwned() || V.isReturnedOwned()) && V.getCount() > 0);
@@ -3323,7 +3322,7 @@ CFRefCount::HandleSymbolDeath(const GRState * state, SymbolRef sid, RefVal V,
ExplodedNode*
CFRefCount::ProcessLeaks(const GRState * state,
- llvm::SmallVectorImpl<SymbolRef> &Leaked,
+ SmallVectorImpl<SymbolRef> &Leaked,
GenericNodeBuilderRefCount &Builder,
ExprEngine& Eng,
ExplodedNode *Pred) {
@@ -3335,7 +3334,7 @@ CFRefCount::ProcessLeaks(const GRState * state,
ExplodedNode *N = Builder.MakeNode(state, Pred);
if (N) {
- for (llvm::SmallVectorImpl<SymbolRef>::iterator
+ for (SmallVectorImpl<SymbolRef>::iterator
I = Leaked.begin(), E = Leaked.end(); I != E; ++I) {
CFRefBug *BT = static_cast<CFRefBug*>(Pred ? leakWithinFunction
@@ -3368,7 +3367,7 @@ void CFRefCount::evalEndPath(ExprEngine& Eng,
}
B = state->get<RefBindings>();
- llvm::SmallVector<SymbolRef, 10> Leaked;
+ SmallVector<SymbolRef, 10> Leaked;
for (RefBindings::iterator I = B.begin(), E = B.end(); I != E; ++I)
state = HandleSymbolDeath(state, (*I).first, (*I).second, Leaked);
@@ -3402,7 +3401,7 @@ void CFRefCount::evalDeadSymbols(ExplodedNodeSet& Dst,
}
B = state->get<RefBindings>();
- llvm::SmallVector<SymbolRef, 10> Leaked;
+ SmallVector<SymbolRef, 10> Leaked;
for (SymbolReaper::dead_iterator I = SymReaper.dead_begin(),
E = SymReaper.dead_end(); I != E; ++I) {
@@ -3540,7 +3539,7 @@ void RetainReleaseChecker::checkPostStmt(const BlockExpr *BE,
// FIXME: For now we invalidate the tracking of all symbols passed to blocks
// via captured variables, even though captured variables result in a copy
// and in implicit increment/decrement of a retain count.
- llvm::SmallVector<const MemRegion*, 10> Regions;
+ SmallVector<const MemRegion*, 10> Regions;
const LocationContext *LC = C.getPredecessor()->getLocationContext();
MemRegionManager &MemMgr = C.getSValBuilder().getRegionManager();
diff --git a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
index ef7bc2016c..137aa2ab64 100644
--- a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
@@ -36,7 +36,7 @@ void ExprEngine::evalArguments(ConstExprIterator AI, ConstExprIterator AE,
bool FstArgAsLValue) {
- llvm::SmallVector<CallExprWLItem, 20> WorkList;
+ SmallVector<CallExprWLItem, 20> WorkList;
WorkList.reserve(AE - AI);
WorkList.push_back(CallExprWLItem(AI, Pred));
@@ -197,7 +197,7 @@ void ExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E,
#endif
// Default semantics: invalidate all regions passed as arguments.
- llvm::SmallVector<const MemRegion*, 10> regionsToInvalidate;
+ SmallVector<const MemRegion*, 10> regionsToInvalidate;
// FIXME: We can have collisions on the conjured symbol if the
// expression *I also creates conjured symbols. We probably want
@@ -303,7 +303,7 @@ void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
// Accumulate list of regions that are invalidated.
// FIXME: Eventually we should unify the logic for constructor
// processing in one place.
- llvm::SmallVector<const MemRegion*, 10> regionsToInvalidate;
+ SmallVector<const MemRegion*, 10> regionsToInvalidate;
for (CXXNewExpr::const_arg_iterator
ai = CNE->constructor_arg_begin(), ae = CNE->constructor_arg_end();
ai != ae; ++ai)
diff --git a/lib/StaticAnalyzer/Core/CheckerManager.cpp b/lib/StaticAnalyzer/Core/CheckerManager.cpp
index ba7c384e5c..6dae640b23 100644
--- a/lib/StaticAnalyzer/Core/CheckerManager.cpp
+++ b/lib/StaticAnalyzer/Core/CheckerManager.cpp
@@ -122,7 +122,7 @@ static void expandGraphWithCheckers(CHECK_CTX checkCtx,
namespace {
struct CheckStmtContext {
- typedef llvm::SmallVectorImpl<CheckerManager::CheckStmtFunc> CheckersTy;
+ typedef SmallVectorImpl<CheckerManager::CheckStmtFunc> CheckersTy;
bool IsPreVisit;
const CheckersTy &Checkers;
const Stmt *S;
diff --git a/lib/StaticAnalyzer/Core/CoreEngine.cpp b/lib/StaticAnalyzer/Core/CoreEngine.cpp
index 9fcc04e2e4..1103ac65de 100644
--- a/lib/StaticAnalyzer/Core/CoreEngine.cpp
+++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp
@@ -19,9 +19,6 @@
#include "clang/AST/Expr.h"
#include "llvm/Support/Casting.h"
#include "llvm/ADT/DenseMap.h"
-
-using llvm::cast;
-using llvm::isa;
using namespace clang;
using namespace ento;
@@ -41,7 +38,7 @@ WorkList::Visitor::~Visitor() {}
namespace {
class DFS : public WorkList {
- llvm::SmallVector<WorkListUnit,20> Stack;
+ SmallVector<WorkListUnit,20> Stack;
public:
virtual bool hasWork() const {
return !Stack.empty();
@@ -59,7 +56,7 @@ public:
}
virtual bool visitItemsInWorkList(Visitor &V) {
- for (llvm::SmallVectorImpl<WorkListUnit>::iterator
+ for (SmallVectorImpl<WorkListUnit>::iterator
I = Stack.begin(), E = Stack.end(); I != E; ++I) {
if (V.visit(*I))
return true;
@@ -107,7 +104,7 @@ WorkList *WorkList::makeBFS() { return new BFS(); }
namespace {
class BFSBlockDFSContents : public WorkList {
std::deque<WorkListUnit> Queue;
- llvm::SmallVector<WorkListUnit,20> Stack;
+ SmallVector<WorkListUnit,20> Stack;
public:
virtual bool hasWork() const {
return !Queue.empty() || !Stack.empty();
@@ -136,7 +133,7 @@ namespace {
return U;
}
virtual bool visitItemsInWorkList(Visitor &V) {
- for (llvm::SmallVectorImpl<WorkListUnit>::iterator
+ for (SmallVectorImpl<WorkListUnit>::iterator
I = Stack.begin(), E = Stack.end(); I != E; ++I) {
if (V.visit(*I))
return true;
@@ -250,7 +247,7 @@ void CoreEngine::ExecuteWorkListWithInitialState(const LocationContext *L,
const GRState *InitState,
ExplodedNodeSet &Dst) {
ExecuteWorkList(L, Steps, InitState);
- for (llvm::SmallVectorImpl<ExplodedNode*>::iterator I = G->EndNodes.begin(),
+ for (SmallVectorImpl<ExplodedNode*>::iterator I = G->EndNodes.begin(),
E = G->EndNodes.end(); I != E; ++I) {
Dst.Add(*I);
}
@@ -305,7 +302,7 @@ void CoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) {
}
}
- for (llvm::SmallVectorImpl<ExplodedNode*>::const_iterator
+ for (SmallVectorImpl<ExplodedNode*>::const_iterator
I = nodeBuilder.sinks().begin(), E = nodeBuilder.sinks().end();
I != E; ++I) {
blocksExhausted.push_back(std::make_pair(L, *I));
diff --git a/lib/StaticAnalyzer/Core/Environment.cpp b/lib/StaticAnalyzer/Core/Environment.cpp
index 3961c7b952..4af8bb07cc 100644
--- a/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/lib/StaticAnalyzer/Core/Environment.cpp
@@ -159,7 +159,7 @@ Environment
EnvironmentManager::removeDeadBindings(Environment Env,
SymbolReaper &SymReaper,
const GRState *ST,
- llvm::SmallVectorImpl<const MemRegion*> &DRoots) {
+ SmallVectorImpl<const MemRegion*> &DRoots) {
CFG &C = *SymReaper.getLocationContext()->getCFG();
@@ -168,7 +168,7 @@ EnvironmentManager::removeDeadBindings(Environment Env,
// outnumber block-level expression bindings).
Environment NewEnv = getInitialEnvironment();
- llvm::SmallVector<std::pair<const Stmt*, SVal>, 10> deferredLocations;
+ SmallVector<std::pair<const Stmt*, SVal>, 10> deferredLocations;
// Iterate over the block-expr bindings.
for (Environment::iterator I = Env.begin(), E = Env.end();
@@ -233,7 +233,7 @@ EnvironmentManager::removeDeadBindings(Environment Env,
// Go through he deferred locations and add them to the new environment if
// the correspond Stmt* is in the map as well.
- for (llvm::SmallVectorImpl<std::pair<const Stmt*, SVal> >::iterator
+ for (SmallVectorImpl<std::pair<const Stmt*, SVal> >::iterator
I = deferredLocations.begin(), E = deferredLocations.end(); I != E; ++I) {
const Stmt *S = (Stmt*) (((uintptr_t) I->first) & (uintptr_t) ~0x1);
if (NewEnv.ExprBindings.lookup(S))
diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
index fa16fead9f..5cc0a97d93 100644
--- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -285,7 +285,7 @@ ExplodedGraph::TrimInternal(const ExplodedNode* const* BeginSources,
typedef llvm::DenseMap<const ExplodedNode*, ExplodedNode*> Pass2Ty;
Pass2Ty& Pass2 = M->M;
- llvm::SmallVector<const ExplodedNode*, 10> WL1, WL2;
+ SmallVector<const ExplodedNode*, 10> WL1, WL2;
// ===- Pass 1 (reverse DFS) -===
for (const ExplodedNode* const* I = BeginSources; I != EndSources; ++I) {
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index ffe5f0b6cd..79a6356552 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -35,9 +35,6 @@
using namespace clang;
using namespace ento;
-using llvm::dyn_cast;
-using llvm::dyn_cast_or_null;
-using llvm::cast;
using llvm::APSInt;
namespace {
@@ -162,11 +159,11 @@ ExprEngine::doesInvalidateGlobals(const CallOrObjCMessage &callOrMessage) const
if (callOrMessage.isFunctionCall() && !callOrMessage.isCXXCall()) {
SVal calleeV = callOrMessage.getFunctionCallee();
if (const FunctionTextRegion *codeR =
- llvm::dyn_cast_or_null<FunctionTextRegion>(calleeV.getAsRegion())) {
+ dyn_cast_or_null<FunctionTextRegion>(calleeV.getAsRegion())) {
const FunctionDecl *fd = codeR->getDecl();
if (const IdentifierInfo *ii = fd->getIdentifier()) {
- llvm::StringRef fname = ii->getName();
+ StringRef fname = ii->getName();
if (fname == "strlen")
return false;
}
@@ -1627,7 +1624,7 @@ bool ExprEngine::InlineCall(ExplodedNodeSet &Dst, const CallExpr *CE,
case Stmt::CXXOperatorCallExprClass: {
const CXXOperatorCallExpr *opCall = cast<CXXOperatorCallExpr>(CE);
methodDecl =
- llvm::dyn_cast_or_null<CXXMethodDecl>(opCall->getCalleeDecl());
+ dyn_cast_or_null<CXXMethodDecl>(opCall->getCalleeDecl());
break;
}
case Stmt::CXXMemberCallExprClass: {
@@ -2000,7 +1997,7 @@ void ExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME,
ExplodedNodeSet& Dst){
// Create a worklist to process both the arguments.
- llvm::SmallVector<ObjCMsgWLItem, 20> WL;
+ SmallVector<ObjCMsgWLItem, 20> WL;
// But first evaluate the receiver (if any).
ObjCMessageExpr::const_arg_iterator AI = ME->arg_begin(), AE = ME->arg_end();
@@ -2112,7 +2109,7 @@ void ExprEngine::VisitObjCMessage(const ObjCMessage &msg,
ASTContext& Ctx = getContext();
NSExceptionInstanceRaiseSelectors =
new Selector[NUM_RAISE_SELECTORS];
- llvm::SmallVector<IdentifierInfo*, NUM_RAISE_SELECTORS> II;
+ SmallVector<IdentifierInfo*, NUM_RAISE_SELECTORS> II;
unsigned idx = 0;
// raise:format:
@@ -2401,7 +2398,7 @@ void ExprEngine::VisitInitListExpr(const InitListExpr* E, ExplodedNode* Pred,
}
// Create a worklist to process the initializers.
- llvm::SmallVector<InitListWLItem, 10> WorkList;
+ SmallVector<InitListWLItem, 10> WorkList;
WorkList.reserve(NumInitElements);
WorkList.push_back(InitListWLItem(Pred, StartVals, E->rbegin()));
InitListExpr::const_reverse_iterator ItrEnd = E->rend();
diff --git a/lib/StaticAnalyzer/Core/FlatStore.cpp b/lib/StaticAnalyzer/Core/FlatStore.cpp
index ca867aebde..b6515dab81 100644
--- a/lib/StaticAnalyzer/Core/FlatStore.cpp
+++ b/lib/StaticAnalyzer/Core/FlatStore.cpp
@@ -47,7 +47,7 @@ public:
SVal ArrayToPointer(Loc Array);
StoreRef removeDeadBindings(Store store, const StackFrameContext *LCtx,
SymbolReaper& SymReaper,
- llvm::SmallVectorImpl<const MemRegion*>& RegionRoots){
+ SmallVectorImpl<const MemRegion*>& RegionRoots){
return StoreRef(store, *this);
}
@@ -63,7 +63,7 @@ public:
bool invalidateGlobals,
InvalidatedRegions *Regions);
- void print(Store store, llvm::raw_ostream& Out, const char* nl,
+ void print(Store store, raw_ostream& Out, const char* nl,
const char *sep);
void iterBindings(Store store, BindingsHandler& f);
@@ -182,7 +182,7 @@ StoreRef FlatStoreManager::invalidateRegions(Store store,
return StoreRef(store, *this);
}
-void FlatStoreManager::print(Store store, llvm::raw_ostream& Out,
+void FlatStoreManager::print(Store store, raw_ostream& Out,
const char* nl, const char *sep) {
}
diff --git a/lib/StaticAnalyzer/Core/GRState.cpp b/lib/StaticAnalyzer/Core/GRState.cpp
index 0f6ff1ef58..cbc4909490 100644
--- a/lib/StaticAnalyzer/Core/GRState.cpp
+++ b/lib/StaticAnalyzer/Core/GRState.cpp
@@ -71,7 +71,7 @@ GRStateManager::removeDeadBindings(const GRState* state,
// those around. This code more than likely can be made faster, and the
// frequency of which this method is called should be experimented with
// for optimum performance.
- llvm::SmallVector<const MemRegion*, 10> RegionRoots;
+ SmallVector<const MemRegion*, 10> RegionRoots;
GRState NewState = *state;
NewState.Env = EnvMgr.removeDeadBindings(NewState.Env, SymReaper,
@@ -384,7 +384,7 @@ static bool IsEnvLoc(const Stmt *S) {
return (bool) (((uintptr_t) S) & 0x1);
}
-void GRState::print(llvm::raw_ostream& Out, CFG &C, const char* nl,
+void GRState::print(raw_ostream& Out, CFG &C, const char* nl,
const char* sep) const {
// Print the store.
GRStateManager &Mgr = getStateManager();
@@ -459,7 +459,7 @@ void GRState::print(llvm::raw_ostream& Out, CFG &C, const char* nl,
}
}
-void GRState::printDOT(llvm::raw_ostream& Out, CFG &C) const {
+void GRState::printDOT(raw_ostream& Out, CFG &C) const {
print(Out, C, "\\l", "\\|");
}
diff --git a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
index 1ebc28c044..56cdee6545 100644
--- a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -45,15 +45,15 @@ public:
virtual ~HTMLDiagnostics() { FlushDiagnostics(NULL); }
- virtual void FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade);
+ virtual void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade);
virtual void HandlePathDiagnostic(const PathDiagnostic* D);
- virtual llvm::StringRef getName() const {
+ virtual StringRef getName() const {
return "HTMLDiagnostics";
}