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
diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
index 65a6e63..c723ffd 100644
--- a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
+++ b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
@@ -58,7 +58,7 @@
                                          SVal location);
 
   void dump() const;
-  void dumpToStream(llvm::raw_ostream& os) const;
+  void dumpToStream(raw_ostream& os) const;
 };
 }
 
@@ -194,7 +194,7 @@
   dumpToStream(llvm::errs());
 }
 
-void RegionRawOffsetV2::dumpToStream(llvm::raw_ostream& os) const {
+void RegionRawOffsetV2::dumpToStream(raw_ostream& os) const {
   os << "raw_offset_v2{" << getRegion() << ',' << getByteOffset() << '}';
 }
 
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 9fc8163..85d74ac 100644
--- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -49,7 +49,7 @@
 }
 
 static bool isReceiverClassOrSuperclass(const ObjCInterfaceDecl *ID,
-                                        llvm::StringRef ClassName) {
+                                        StringRef ClassName) {
   if (ID->getIdentifier()->getName() == ClassName)
     return true;
 
@@ -114,7 +114,7 @@
     //  lexical comparisons.
     
     std::string NameStr = S.getAsString();
-    llvm::StringRef Name(NameStr);
+    StringRef Name(NameStr);
     assert(!Name.empty());
     
     // FIXME: Checking for initWithFormat: will not work in most cases
diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
index c5dac5d..ca15a74 100644
--- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
@@ -109,7 +109,7 @@
                                          const GRState *state,
                                          const Expr *Ex, SVal V);
 
-  static bool SummarizeRegion(llvm::raw_ostream& os, ASTContext& Ctx,
+  static bool SummarizeRegion(raw_ostream& os, ASTContext& Ctx,
                               const MemRegion *MR);
 
   // Re-usable checks
@@ -767,7 +767,7 @@
   return state->unbindLoc(*L);
 }
 
-bool CStringChecker::SummarizeRegion(llvm::raw_ostream& os, ASTContext& Ctx,
+bool CStringChecker::SummarizeRegion(raw_ostream& os, ASTContext& Ctx,
                                      const MemRegion *MR) {
   const TypedRegion *TR = dyn_cast<TypedRegion>(MR);
   if (!TR)
@@ -1575,8 +1575,8 @@
   bool canComputeResult = false;
 
   if (s1StrLiteral && s2StrLiteral) {
-    llvm::StringRef s1StrRef = s1StrLiteral->getString();
-    llvm::StringRef s2StrRef = s2StrLiteral->getString();
+    StringRef s1StrRef = s1StrLiteral->getString();
+    StringRef s2StrRef = s2StrLiteral->getString();
 
     if (isBounded) {
       // Get the max number of characters to compare.
@@ -1598,11 +1598,11 @@
     if (canComputeResult) {
       // Real strcmp stops at null characters.
       size_t s1Term = s1StrRef.find('\0');
-      if (s1Term != llvm::StringRef::npos)
+      if (s1Term != StringRef::npos)
         s1StrRef = s1StrRef.substr(0, s1Term);
 
       size_t s2Term = s2StrRef.find('\0');
-      if (s2Term != llvm::StringRef::npos)
+      if (s2Term != StringRef::npos)
         s2StrRef = s2StrRef.substr(0, s2Term);
 
       // Use StringRef's comparison methods to compute the actual result.
@@ -1651,7 +1651,7 @@
   IdentifierInfo *II = FD->getIdentifier();
   if (!II)   // if no identifier, not a simple C function
     return false;
-  llvm::StringRef Name = II->getName();
+  StringRef Name = II->getName();
   if (Name.startswith("__builtin_"))
     Name = Name.substr(10);
 
diff --git a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
index 6c3dfac..67db2d2 100644
--- a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
@@ -105,7 +105,7 @@
 
     class FindUninitializedField {
     public:
-      llvm::SmallVector<const FieldDecl *, 10> FieldChain;
+      SmallVector<const FieldDecl *, 10> FieldChain;
     private:
       ASTContext &C;
       StoreManager &StoreMgr;
@@ -161,7 +161,7 @@
         else {
           os << " (e.g., via the field chain: '";
           bool first = true;
-          for (llvm::SmallVectorImpl<const FieldDecl *>::iterator
+          for (SmallVectorImpl<const FieldDecl *>::iterator
                DI = F.FieldChain.begin(), DE = F.FieldChain.end(); DI!=DE;++DI){
             if (first)
               first = false;
diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
index 53810ee..b69c1a3 100644
--- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
+++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
@@ -103,7 +103,7 @@
   IdentifierInfo *II = FD->getIdentifier();
   if (!II)   // if no identifier, not a simple C function
     return;
-  llvm::StringRef Name = II->getName();
+  StringRef Name = II->getName();
   if (Name.startswith("__builtin_"))
     Name = Name.substr(10);
 
@@ -247,7 +247,7 @@
   // referenced the compared variable.
   const DeclRefExpr *drCond = vdLHS == drInc->getDecl() ? drLHS : drRHS;
 
-  llvm::SmallVector<SourceRange, 2> ranges;
+  SmallVector<SourceRange, 2> ranges;
   llvm::SmallString<256> sbuf;
   llvm::raw_svector_ostream os(sbuf);
 
diff --git a/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp b/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp
index 291f8e0..a6286cb 100644
--- a/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp
+++ b/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp
@@ -30,7 +30,7 @@
 public:
   virtual void registerCheckers(CheckerManager &checkerMgr,
                               CheckerOptInfo *checkOpts, unsigned numCheckOpts);
-  virtual void printHelp(llvm::raw_ostream &OS);
+  virtual void printHelp(raw_ostream &OS);
 };
 
 }
@@ -186,7 +186,7 @@
 // Printing Help.
 //===----------------------------------------------------------------------===//
 
-static void printPackageOption(llvm::raw_ostream &OS) {
+static void printPackageOption(raw_ostream &OS) {
   // Find the maximum option length.
   unsigned OptionFieldWidth = 0;
   for (unsigned i = 0; i != NumPackages; ++i) {
@@ -226,7 +226,7 @@
 
 typedef std::map<std::string, const StaticCheckerInfoRec *> SortedCheckers;
 
-static void printCheckerOption(llvm::raw_ostream &OS,SortedCheckers &checkers) {
+static void printCheckerOption(raw_ostream &OS,SortedCheckers &checkers) {
   // Find the maximum option length.
   unsigned OptionFieldWidth = 0;
   for (SortedCheckers::iterator
@@ -268,7 +268,7 @@
   }
 }
 
-void ClangSACheckerProvider::printHelp(llvm::raw_ostream &OS) {
+void ClangSACheckerProvider::printHelp(raw_ostream &OS) {
   OS << "USAGE: -analyzer-checker <CHECKER or PACKAGE or GROUP,...>\n";
 
   OS << "\nGROUPS:\n";
diff --git a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
index ec2a88a..2c5a1a2 100644
--- a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
@@ -50,7 +50,7 @@
   if (!cfg.getNumBlockIDs())
     return;
   
-  llvm::SmallVector<const CFGBlock*, 10> worklist;
+  SmallVector<const CFGBlock*, 10> worklist;
   worklist.push_back(&cfg.getEntry());
   
   while (!worklist.empty()) {
diff --git a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
index baaf8b3..3f3cacc 100644
--- a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
@@ -31,14 +31,14 @@
 public:
   void checkLocation(SVal location, bool isLoad, CheckerContext &C) const;
 
-  static void AddDerefSource(llvm::raw_ostream &os,
-                             llvm::SmallVectorImpl<SourceRange> &Ranges,
+  static void AddDerefSource(raw_ostream &os,
+                             SmallVectorImpl<SourceRange> &Ranges,
                              const Expr *Ex, bool loadedFrom = false);
 };
 } // end anonymous namespace
 
-void DereferenceChecker::AddDerefSource(llvm::raw_ostream &os,
-                                     llvm::SmallVectorImpl<SourceRange> &Ranges,
+void DereferenceChecker::AddDerefSource(raw_ostream &os,
+                                     SmallVectorImpl<SourceRange> &Ranges,
                                         const Expr *Ex,
                                         bool loadedFrom) {
   Ex = Ex->IgnoreParenLValueCasts();
@@ -107,7 +107,7 @@
         BT_null.reset(new BuiltinBug("Dereference of null pointer"));
 
       llvm::SmallString<100> buf;
-      llvm::SmallVector<SourceRange, 2> Ranges;
+      SmallVector<SourceRange, 2> Ranges;
       
       // Walk through lvalue casts to get the original expression
       // that syntactically caused the load.
@@ -165,7 +165,7 @@
       report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue,
                                 bugreporter::GetDerefExpr(N));
 
-      for (llvm::SmallVectorImpl<SourceRange>::iterator
+      for (SmallVectorImpl<SourceRange>::iterator
             I = Ranges.begin(), E = Ranges.end(); I!=E; ++I)
         report->addRange(*I);
 
diff --git a/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp b/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
index de6da4f..4c3961f 100644
--- a/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
@@ -162,7 +162,7 @@
       || nameSpace->getName() != "std")
     return NoKind;
   
-  llvm::StringRef name = td->getName();
+  StringRef name = td->getName();
   return llvm::StringSwitch<RefKind>(name)
     .Cases("vector", "deque", VectorKind)
     .Default(NoKind);
@@ -287,7 +287,7 @@
         return state;
       // Finally, see if it is one of the calls that will create
       // a valid iterator and mark it if so, else mark as Unknown.
-      llvm::StringRef mName = ME->getMemberDecl()->getName();
+      StringRef mName = ME->getMemberDecl()->getName();
       
       if (llvm::StringSwitch<bool>(mName)        
           .Cases("begin", "insert", "erase", true).Default(false)) {
@@ -572,7 +572,7 @@
   // If we are calling a function that invalidates iterators, mark them
   // appropriately by finding matching instances.
   const GRState *state = C.getState();
-  llvm::StringRef mName = ME->getMemberDecl()->getName();
+  StringRef mName = ME->getMemberDecl()->getName();
   if (llvm::StringSwitch<bool>(mName)
       .Cases("insert", "reserve", "push_back", true)
       .Cases("erase", "pop_back", "clear", "resize", true)
diff --git a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
index 3d1b5e2..fd8222e 100644
--- a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
@@ -32,13 +32,13 @@
   if (!RT)
     return false;
 
-  return llvm::StringRef(QualType(RT, 0).getAsString()) ==
-          "class llvm::StringRef";
+  return StringRef(QualType(RT, 0).getAsString()) ==
+          "class StringRef";
 }
 
 /// Check whether the declaration is semantically inside the top-level
 /// namespace named by ns.
-static bool InNamespace(const Decl *D, llvm::StringRef NS) {
+static bool InNamespace(const Decl *D, StringRef NS) {
   const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(D->getDeclContext());
   if (!ND)
     return false;
@@ -109,7 +109,7 @@
 }
 
 //===----------------------------------------------------------------------===//
-// CHECK: a llvm::StringRef should not be bound to a temporary std::string whose
+// CHECK: a StringRef should not be bound to a temporary std::string whose
 // lifetime is shorter than the StringRef's.
 //===----------------------------------------------------------------------===//
 
@@ -150,7 +150,7 @@
     return;
 
   // Pattern match for:
-  // llvm::StringRef x = call() (where call returns std::string)
+  // StringRef x = call() (where call returns std::string)
   if (!IsLLVMStringRef(VD->getType()))
     return;
   ExprWithCleanups *Ex1 = dyn_cast<ExprWithCleanups>(Init);
@@ -210,7 +210,7 @@
 
 namespace {
 class ASTFieldVisitor {
-  llvm::SmallVector<FieldDecl*, 10> FieldChain;
+  SmallVector<FieldDecl*, 10> FieldChain;
   const CXXRecordDecl *Root;
   BugReporter &BR;
 public:
@@ -260,7 +260,7 @@
   if (FieldChain.size() > 1) {
     os << " via the following chain: ";
     bool isFirst = true;
-    for (llvm::SmallVectorImpl<FieldDecl*>::iterator I=FieldChain.begin(),
+    for (SmallVectorImpl<FieldDecl*>::iterator I=FieldChain.begin(),
          E=FieldChain.end(); I!=E; ++I) {
       if (!isFirst)
         os << '.';
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 9100215..e49ff9f 100644
--- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -107,8 +107,8 @@
   void ReallocMem(CheckerContext &C, const CallExpr *CE) const;
   static void CallocMem(CheckerContext &C, const CallExpr *CE);
   
-  static bool SummarizeValue(llvm::raw_ostream& os, SVal V);
-  static bool SummarizeRegion(llvm::raw_ostream& os, const MemRegion *MR);
+  static bool SummarizeValue(raw_ostream& os, SVal V);
+  static bool SummarizeRegion(raw_ostream& os, const MemRegion *MR);
   void ReportBadFree(CheckerContext &C, SVal ArgVal, SourceRange range) const;
 };
 } // end anonymous namespace
@@ -364,7 +364,7 @@
   return notNullState->set<RegionState>(Sym, RefState::getReleased(CE));
 }
 
-bool MallocChecker::SummarizeValue(llvm::raw_ostream& os, SVal V) {
+bool MallocChecker::SummarizeValue(raw_ostream& os, SVal V) {
   if (nonloc::ConcreteInt *IntVal = dyn_cast<nonloc::ConcreteInt>(&V))
     os << "an integer (" << IntVal->getValue() << ")";
   else if (loc::ConcreteInt *ConstAddr = dyn_cast<loc::ConcreteInt>(&V))
@@ -377,7 +377,7 @@
   return true;
 }
 
-bool MallocChecker::SummarizeRegion(llvm::raw_ostream& os,
+bool MallocChecker::SummarizeRegion(raw_ostream& os,
                                     const MemRegion *MR) {
   switch (MR->getKind()) {
   case MemRegion::FunctionTextRegionKind: {
diff --git a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
index 2d0af9c..2669b32 100644
--- a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
@@ -50,7 +50,7 @@
       //  Here are a few hardwired ones.  If this takes too long, we can
       //  potentially cache these results.
       BuildSinks
-        = llvm::StringSwitch<bool>(llvm::StringRef(II->getName()))
+        = llvm::StringSwitch<bool>(StringRef(II->getName()))
             .Case("exit", true)
             .Case("panic", true)
             .Case("error", true)
diff --git a/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp b/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
index 7262bc3..b518ab4 100644
--- a/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
@@ -45,7 +45,7 @@
   if (!II)
     return false;
   
-  llvm::StringRef FName(II->getName());
+  StringRef FName(II->getName());
 
   // Check for compare and swap.
   if (FName.startswith("OSAtomicCompareAndSwap") ||
diff --git a/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp b/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
index a722c49..961600a 100644
--- a/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
@@ -67,7 +67,7 @@
   IdentifierInfo *II = FD->getIdentifier();
   if (!II)   // if no identifier, not a simple C function
     return;
-  llvm::StringRef FName = II->getName();
+  StringRef FName = II->getName();
 
   if (CE->getNumArgs() != 1)
     return;
diff --git a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
index 73ce359..bb889c8 100644
--- a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp
@@ -35,12 +35,12 @@
 private:
   void EmitStackError(CheckerContext &C, const MemRegion *R,
                       const Expr *RetE) const;
-  static SourceRange GenName(llvm::raw_ostream &os, const MemRegion *R,
+  static SourceRange GenName(raw_ostream &os, const MemRegion *R,
                              SourceManager &SM);
 };
 }
 
-SourceRange StackAddrEscapeChecker::GenName(llvm::raw_ostream &os,
+SourceRange StackAddrEscapeChecker::GenName(raw_ostream &os,
                                           const MemRegion *R,
                                           SourceManager &SM) {
     // Get the base region, stripping away fields and elements.
@@ -143,7 +143,7 @@
     ExprEngine &Eng;
     const StackFrameContext *CurSFC;
   public:
-    llvm::SmallVector<std::pair<const MemRegion*, const MemRegion*>, 10> V;
+    SmallVector<std::pair<const MemRegion*, const MemRegion*>, 10> V;
 
     CallBack(ExprEngine &Eng, const LocationContext *LCtx)
       : Eng(Eng), CurSFC(LCtx->getCurrentStackFrame()) {}
diff --git a/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp b/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
index 3050ca3..0518740 100644
--- a/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
+++ b/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
@@ -92,7 +92,7 @@
 
   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 @@
   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 7c9f45a..c8ac722 100644
--- a/lib/StaticAnalyzer/Core/BasicStore.cpp
+++ b/lib/StaticAnalyzer/Core/BasicStore.cpp
@@ -77,7 +77,7 @@
   ///  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 @@
     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::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 @@
   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 8b5d383..2f7b67a 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1312,10 +1312,10 @@
   // 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 @@
 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 @@
 }
 
 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 @@
 
 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 @@
     // 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 @@
 }
 
 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 @@
   
   // 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 @@
   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 @@
   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 7eb65ce..80e1102 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 @@
     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 @@
   }
 
   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 @@
 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 @@
                            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 @@
 
 } // 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 @@
   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 @@
   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 @@
   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 @@
 
   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 @@
       : 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 @@
   }
 }
 
-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 @@
 
   // 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 @@
       }
 
     // 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 @@
   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 @@
 
 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 @@
 
 ExplodedNode*
 CFRefCount::ProcessLeaks(const GRState * state,
-                         llvm::SmallVectorImpl<SymbolRef> &Leaked,
+                         SmallVectorImpl<SymbolRef> &Leaked,
                          GenericNodeBuilderRefCount &Builder,
                          ExprEngine& Eng,
                          ExplodedNode *Pred) {
@@ -3335,7 +3334,7 @@
   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 @@
   }
 
   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 @@
   }
 
   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 @@
   // 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 ef7bc20..137aa2a 100644
--- a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp
@@ -36,7 +36,7 @@
                                  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 @@
 #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 @@
     // 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 ba7c384..6dae640 100644
--- a/lib/StaticAnalyzer/Core/CheckerManager.cpp
+++ b/lib/StaticAnalyzer/Core/CheckerManager.cpp
@@ -122,7 +122,7 @@
 
 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 9fcc04e..1103ac6 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 @@
 
 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 @@
   }
   
   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 @@
 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 @@
       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 @@
                                                    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 @@
     }
   }
 
-  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 3961c7b..4af8bb0 100644
--- a/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/lib/StaticAnalyzer/Core/Environment.cpp
@@ -159,7 +159,7 @@
 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 @@
   // 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 @@
   
   // 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 fa16fea..5cc0a97 100644
--- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -285,7 +285,7 @@
   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 ffe5f0b..79a6356 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 @@
   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 @@
     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 @@
                                         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 @@
           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 @@
     }
 
     // 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 ca867ae..b6515da 100644
--- a/lib/StaticAnalyzer/Core/FlatStore.cpp
+++ b/lib/StaticAnalyzer/Core/FlatStore.cpp
@@ -47,7 +47,7 @@
   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 @@
                              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 @@
   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 0f6ff1e..cbc4909 100644
--- a/lib/StaticAnalyzer/Core/GRState.cpp
+++ b/lib/StaticAnalyzer/Core/GRState.cpp
@@ -71,7 +71,7 @@
   // 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 @@
   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::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 1ebc28c..56cdee6 100644
--- a/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -45,15 +45,15 @@
 
   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";
   }
 
-  unsigned ProcessMacroPiece(llvm::raw_ostream& os,
+  unsigned ProcessMacroPiece(raw_ostream& os,
                              const PathDiagnosticMacroPiece& P,
                              unsigned num);
 
@@ -65,7 +65,7 @@
                       const char *HighlightEnd = "</span>");
 
   void ReportDiag(const PathDiagnostic& D,
-                  llvm::SmallVectorImpl<std::string> *FilesMade);
+                  SmallVectorImpl<std::string> *FilesMade);
 };
 
 } // end anonymous namespace
@@ -102,7 +102,7 @@
 }
 
 void
-HTMLDiagnostics::FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade)
+HTMLDiagnostics::FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade)
 {
   while (!BatchedDiags.empty()) {
     const PathDiagnostic* D = BatchedDiags.back();
@@ -115,7 +115,7 @@
 }
 
 void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,
-                                 llvm::SmallVectorImpl<std::string> *FilesMade){
+                                 SmallVectorImpl<std::string> *FilesMade){
   // Create the HTML directory if it is missing.
   if (!createdDir) {
     createdDir = true;
@@ -443,7 +443,7 @@
     {
       FullSourceLoc L = MP->getLocation().asLocation().getInstantiationLoc();
       assert(L.isFileID());
-      llvm::StringRef BufferInfo = L.getBufferData();
+      StringRef BufferInfo = L.getBufferData();
       const char* MacroName = L.getDecomposedLoc().second + BufferInfo.data();
       Lexer rawLexer(L, PP.getLangOptions(), BufferInfo.begin(),
                      MacroName, BufferInfo.end());
@@ -504,7 +504,7 @@
 #endif
 }
 
-static void EmitAlphaCounter(llvm::raw_ostream& os, unsigned n) {
+static void EmitAlphaCounter(raw_ostream& os, unsigned n) {
   unsigned x = n % ('z' - 'a');
   n /= 'z' - 'a';
 
@@ -514,7 +514,7 @@
   os << char('a' + x);
 }
 
-unsigned HTMLDiagnostics::ProcessMacroPiece(llvm::raw_ostream& os,
+unsigned HTMLDiagnostics::ProcessMacroPiece(raw_ostream& os,
                                             const PathDiagnosticMacroPiece& P,
                                             unsigned num) {
 
diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp
index d9e884a..420e486 100644
--- a/lib/StaticAnalyzer/Core/MemRegion.cpp
+++ b/lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -398,69 +398,69 @@
   return os.str();
 }
 
-void MemRegion::dumpToStream(llvm::raw_ostream& os) const {
+void MemRegion::dumpToStream(raw_ostream& os) const {
   os << "<Unknown Region>";
 }
 
-void AllocaRegion::dumpToStream(llvm::raw_ostream& os) const {
+void AllocaRegion::dumpToStream(raw_ostream& os) const {
   os << "alloca{" << (void*) Ex << ',' << Cnt << '}';
 }
 
-void FunctionTextRegion::dumpToStream(llvm::raw_ostream& os) const {
+void FunctionTextRegion::dumpToStream(raw_ostream& os) const {
   os << "code{" << getDecl()->getDeclName().getAsString() << '}';
 }
 
-void BlockTextRegion::dumpToStream(llvm::raw_ostream& os) const {
+void BlockTextRegion::dumpToStream(raw_ostream& os) const {
   os << "block_code{" << (void*) this << '}';
 }
 
-void BlockDataRegion::dumpToStream(llvm::raw_ostream& os) const {
+void BlockDataRegion::dumpToStream(raw_ostream& os) const {
   os << "block_data{" << BC << '}';
 }
 
-void CompoundLiteralRegion::dumpToStream(llvm::raw_ostream& os) const {
+void CompoundLiteralRegion::dumpToStream(raw_ostream& os) const {
   // FIXME: More elaborate pretty-printing.
   os << "{ " << (void*) CL <<  " }";
 }
 
-void CXXTempObjectRegion::dumpToStream(llvm::raw_ostream &os) const {
+void CXXTempObjectRegion::dumpToStream(raw_ostream &os) const {
   os << "temp_object";
 }
 
-void CXXBaseObjectRegion::dumpToStream(llvm::raw_ostream &os) const {
+void CXXBaseObjectRegion::dumpToStream(raw_ostream &os) const {
   os << "base " << decl->getName();
 }
 
-void CXXThisRegion::dumpToStream(llvm::raw_ostream &os) const {
+void CXXThisRegion::dumpToStream(raw_ostream &os) const {
   os << "this";
 }
 
-void ElementRegion::dumpToStream(llvm::raw_ostream& os) const {
+void ElementRegion::dumpToStream(raw_ostream& os) const {
   os << "element{" << superRegion << ','
      << Index << ',' << getElementType().getAsString() << '}';
 }
 
-void FieldRegion::dumpToStream(llvm::raw_ostream& os) const {
+void FieldRegion::dumpToStream(raw_ostream& os) const {
   os << superRegion << "->" << getDecl();
 }
 
-void NonStaticGlobalSpaceRegion::dumpToStream(llvm::raw_ostream &os) const {
+void NonStaticGlobalSpaceRegion::dumpToStream(raw_ostream &os) const {
   os << "NonStaticGlobalSpaceRegion";
 }
 
-void ObjCIvarRegion::dumpToStream(llvm::raw_ostream& os) const {
+void ObjCIvarRegion::dumpToStream(raw_ostream& os) const {
   os << "ivar{" << superRegion << ',' << getDecl() << '}';
 }
 
-void StringRegion::dumpToStream(llvm::raw_ostream& os) const {
+void StringRegion::dumpToStream(raw_ostream& os) const {
   Str->printPretty(os, 0, PrintingPolicy(getContext().getLangOptions()));
 }
 
-void SymbolicRegion::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolicRegion::dumpToStream(raw_ostream& os) const {
   os << "SymRegion{" << sym << '}';
 }
 
-void VarRegion::dumpToStream(llvm::raw_ostream& os) const {
+void VarRegion::dumpToStream(raw_ostream& os) const {
   os << cast<VarDecl>(D);
 }
 
@@ -468,11 +468,11 @@
   dumpToStream(llvm::errs());
 }
 
-void RegionRawOffset::dumpToStream(llvm::raw_ostream& os) const {
+void RegionRawOffset::dumpToStream(raw_ostream& os) const {
   os << "raw_offset{" << getRegion() << ',' << getOffset().getQuantity() << '}';
 }
 
-void StaticGlobalSpaceRegion::dumpToStream(llvm::raw_ostream &os) const {
+void StaticGlobalSpaceRegion::dumpToStream(raw_ostream &os) const {
   os << "StaticGlobalsMemSpace{" << CR << '}';
 }
 
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index 872bbfe..7f95c95 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -17,12 +17,9 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/StmtCXX.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/Support/Casting.h"
 
 using namespace clang;
 using namespace ento;
-using llvm::dyn_cast;
-using llvm::isa;
 
 bool PathDiagnosticMacroPiece::containsEvent() const {
   for (const_iterator I = begin(), E = end(); I!=E; ++I) {
@@ -37,14 +34,14 @@
   return false;
 }
 
-static llvm::StringRef StripTrailingDots(llvm::StringRef s) {
-  for (llvm::StringRef::size_type i = s.size(); i != 0; --i)
+static StringRef StripTrailingDots(StringRef s) {
+  for (StringRef::size_type i = s.size(); i != 0; --i)
     if (s[i - 1] != '.')
       return s.substr(0, i);
   return "";
 }
 
-PathDiagnosticPiece::PathDiagnosticPiece(llvm::StringRef s,
+PathDiagnosticPiece::PathDiagnosticPiece(StringRef s,
                                          Kind k, DisplayHint hint)
   : str(StripTrailingDots(s)), kind(k), Hint(hint) {}
 
@@ -76,8 +73,8 @@
 }
 
 
-PathDiagnostic::PathDiagnostic(llvm::StringRef bugtype, llvm::StringRef desc,
-                               llvm::StringRef category)
+PathDiagnostic::PathDiagnostic(StringRef bugtype, StringRef desc,
+                               StringRef category)
   : Size(0),
     BugType(StripTrailingDots(bugtype)),
     Desc(StripTrailingDots(desc)),
diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index fbbbd46..9ebc256 100644
--- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -22,14 +22,9 @@
 #include "llvm/ADT/SmallVector.h"
 using namespace clang;
 using namespace ento;
-using llvm::cast;
 
 typedef llvm::DenseMap<FileID, unsigned> FIDMap;
 
-namespace clang {
-  class Preprocessor;
-}
-
 namespace {
 struct CompareDiagnostics {
   // Compare if 'X' is "<" than 'Y'.
@@ -43,16 +38,16 @@
       return false;
     
     // Next, compare by bug type.
-    llvm::StringRef XBugType = X->getBugType();
-    llvm::StringRef YBugType = Y->getBugType();
+    StringRef XBugType = X->getBugType();
+    StringRef YBugType = Y->getBugType();
     if (XBugType < YBugType)
       return true;
     if (XBugType != YBugType)
       return false;
     
     // Next, compare by bug description.
-    llvm::StringRef XDesc = X->getDescription();
-    llvm::StringRef YDesc = Y->getDescription();
+    StringRef XDesc = X->getDescription();
+    StringRef YDesc = Y->getDescription();
     if (XDesc < YDesc)
       return true;
     if (XDesc != YDesc)
@@ -77,11 +72,11 @@
 
     ~PlistDiagnostics() { FlushDiagnostics(NULL); }
 
-    void FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade);
+    void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade);
     
     void HandlePathDiagnostic(const PathDiagnostic* D);
     
-    virtual llvm::StringRef getName() const {
+    virtual StringRef getName() const {
       return "PlistDiagnostics";
     }
 
@@ -111,7 +106,7 @@
   return Extensive;
 }
 
-static void AddFID(FIDMap &FIDs, llvm::SmallVectorImpl<FileID> &V,
+static void AddFID(FIDMap &FIDs, SmallVectorImpl<FileID> &V,
                    const SourceManager* SM, SourceLocation L) {
 
   FileID FID = SM->getFileID(SM->getInstantiationLoc(L));
@@ -129,12 +124,12 @@
   return I->second;
 }
 
-static llvm::raw_ostream& Indent(llvm::raw_ostream& o, const unsigned indent) {
+static raw_ostream& Indent(raw_ostream& o, const unsigned indent) {
   for (unsigned i = 0; i < indent; ++i) o << ' ';
   return o;
 }
 
-static void EmitLocation(llvm::raw_ostream& o, const SourceManager &SM,
+static void EmitLocation(raw_ostream& o, const SourceManager &SM,
                          const LangOptions &LangOpts,
                          SourceLocation L, const FIDMap &FM,
                          unsigned indent, bool extend = false) {
@@ -155,14 +150,14 @@
   Indent(o, indent) << "</dict>\n";
 }
 
-static void EmitLocation(llvm::raw_ostream& o, const SourceManager &SM,
+static void EmitLocation(raw_ostream& o, const SourceManager &SM,
                          const LangOptions &LangOpts,
                          const PathDiagnosticLocation &L, const FIDMap& FM,
                          unsigned indent, bool extend = false) {
   EmitLocation(o, SM, LangOpts, L.asLocation(), FM, indent, extend);
 }
 
-static void EmitRange(llvm::raw_ostream& o, const SourceManager &SM,
+static void EmitRange(raw_ostream& o, const SourceManager &SM,
                       const LangOptions &LangOpts,
                       PathDiagnosticRange R, const FIDMap &FM,
                       unsigned indent) {
@@ -172,7 +167,7 @@
   Indent(o, indent) << "</array>\n";
 }
 
-static llvm::raw_ostream& EmitString(llvm::raw_ostream& o,
+static raw_ostream& EmitString(raw_ostream& o,
                                      const std::string& s) {
   o << "<string>";
   for (std::string::const_iterator I=s.begin(), E=s.end(); I!=E; ++I) {
@@ -190,7 +185,7 @@
   return o;
 }
 
-static void ReportControlFlow(llvm::raw_ostream& o,
+static void ReportControlFlow(raw_ostream& o,
                               const PathDiagnosticControlFlowPiece& P,
                               const FIDMap& FM,
                               const SourceManager &SM,
@@ -233,7 +228,7 @@
   Indent(o, indent) << "</dict>\n";
 }
 
-static void ReportEvent(llvm::raw_ostream& o, const PathDiagnosticPiece& P,
+static void ReportEvent(raw_ostream& o, const PathDiagnosticPiece& P,
                         const FIDMap& FM,
                         const SourceManager &SM,
                         const LangOptions &LangOpts,
@@ -280,7 +275,7 @@
   Indent(o, indent); o << "</dict>\n";
 }
 
-static void ReportMacro(llvm::raw_ostream& o,
+static void ReportMacro(raw_ostream& o,
                         const PathDiagnosticMacroPiece& P,
                         const FIDMap& FM, const SourceManager &SM,
                         const LangOptions &LangOpts,
@@ -304,7 +299,7 @@
   }
 }
 
-static void ReportDiag(llvm::raw_ostream& o, const PathDiagnosticPiece& P,
+static void ReportDiag(raw_ostream& o, const PathDiagnosticPiece& P,
                        const FIDMap& FM, const SourceManager &SM,
                        const LangOptions &LangOpts) {
 
@@ -342,7 +337,7 @@
   BatchedDiags.push_back(D);
 }
 
-void PlistDiagnostics::FlushDiagnostics(llvm::SmallVectorImpl<std::string>
+void PlistDiagnostics::FlushDiagnostics(SmallVectorImpl<std::string>
                                         *FilesMade) {
   
   if (flushed)
@@ -358,7 +353,7 @@
   // Build up a set of FIDs that we use by scanning the locations and
   // ranges of the diagnostics.
   FIDMap FM;
-  llvm::SmallVector<FileID, 10> Fids;
+  SmallVector<FileID, 10> Fids;
   const SourceManager* SM = 0;
 
   if (!BatchedDiags.empty())
@@ -401,7 +396,7 @@
        " <key>files</key>\n"
        " <array>\n";
 
-  for (llvm::SmallVectorImpl<FileID>::iterator I=Fids.begin(), E=Fids.end();
+  for (SmallVectorImpl<FileID>::iterator I=Fids.begin(), E=Fids.end();
        I!=E; ++I) {
     o << "  ";
     EmitString(o, SM->getFileEntryForID(*I)->getName()) << '\n';
@@ -444,7 +439,7 @@
     // Output the diagnostic to the sub-diagnostic client, if any.
     if (SubPD) {
       SubPD->HandlePathDiagnostic(OwnedD.take());
-      llvm::SmallVector<std::string, 1> SubFilesMade;
+      SmallVector<std::string, 1> SubFilesMade;
       SubPD->FlushDiagnostics(SubFilesMade);
 
       if (!SubFilesMade.empty()) {
diff --git a/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp b/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
index 389fff5..ecde983 100644
--- a/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
+++ b/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
@@ -170,7 +170,7 @@
     return newRanges;
   }
 
-  void print(llvm::raw_ostream &os) const {
+  void print(raw_ostream &os) const {
     bool isFirst = true;
     os << "{ ";
     for (iterator i = begin(), e = end(); i != e; ++i) {
@@ -244,7 +244,7 @@
 
   const GRState* removeDeadBindings(const GRState* St, SymbolReaper& SymReaper);
 
-  void print(const GRState* St, llvm::raw_ostream& Out,
+  void print(const GRState* St, raw_ostream& Out,
              const char* nl, const char *sep);
 
 private:
@@ -424,7 +424,7 @@
 // Pretty-printing.
 //===------------------------------------------------------------------------===/
 
-void RangeConstraintManager::print(const GRState* St, llvm::raw_ostream& Out,
+void RangeConstraintManager::print(const GRState* St, raw_ostream& Out,
                                    const char* nl, const char *sep) {
 
   ConstraintRangeTy Ranges = St->get<ConstraintRange>();
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp
index 23dd641..0e3537c 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -94,7 +94,7 @@
 
 namespace llvm {
   static inline
-  llvm::raw_ostream& operator<<(llvm::raw_ostream& os, BindingKey K) {
+  raw_ostream& operator<<(raw_ostream& os, BindingKey K) {
     os << '(' << K.getRegion() << ',' << K.getOffset()
        << ',' << (K.isDirect() ? "direct" : "default")
        << ')';
@@ -157,7 +157,7 @@
     return false;
   }
 
-  void process(llvm::SmallVectorImpl<const SubRegion*> &WL, const SubRegion *R);
+  void process(SmallVectorImpl<const SubRegion*> &WL, const SubRegion *R);
 
   ~RegionStoreSubRegionMap() {}
 
@@ -183,7 +183,7 @@
 };
 
 void
-RegionStoreSubRegionMap::process(llvm::SmallVectorImpl<const SubRegion*> &WL,
+RegionStoreSubRegionMap::process(SmallVectorImpl<const SubRegion*> &WL,
                                  const SubRegion *R) {
   const MemRegion *superR = R->getSuperRegion();
   if (add(superR, R))
@@ -372,7 +372,7 @@
   ///  It returns a new Store with these values removed.
   StoreRef removeDeadBindings(Store store, const StackFrameContext *LCtx,
                            SymbolReaper& SymReaper,
-                          llvm::SmallVectorImpl<const MemRegion*>& RegionRoots);
+                          SmallVectorImpl<const MemRegion*>& RegionRoots);
 
   StoreRef enterStackFrame(const GRState *state, const StackFrameContext *frame);
 
@@ -392,7 +392,7 @@
     return RegionBindings(static_cast<const RegionBindings::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);
 
   void iterBindings(Store store, BindingsHandler& f) {
@@ -433,7 +433,7 @@
   RegionBindings B = GetRegionBindings(store);
   RegionStoreSubRegionMap *M = new RegionStoreSubRegionMap();
 
-  llvm::SmallVector<const SubRegion*, 10> WL;
+  SmallVector<const SubRegion*, 10> WL;
 
   for (RegionBindings::iterator I=B.begin(), E=B.end(); I!=E; ++I)
     if (const SubRegion *R = dyn_cast<SubRegion>(I.getKey().getRegion()))
@@ -461,7 +461,7 @@
   typedef BumpVector<BindingKey> RegionCluster;
   typedef llvm::DenseMap<const MemRegion *, RegionCluster *> ClusterMap;
   llvm::DenseMap<const RegionCluster*, unsigned> Visited;
-  typedef llvm::SmallVector<std::pair<const MemRegion *, RegionCluster*>, 10>
+  typedef SmallVector<std::pair<const MemRegion *, RegionCluster*>, 10>
     WorkList;
 
   BumpVectorContext BVC;
@@ -1611,7 +1611,7 @@
 namespace {
 class removeDeadBindingsWorker :
   public ClusterAnalysis<removeDeadBindingsWorker> {
-  llvm::SmallVector<const SymbolicRegion*, 12> Postponed;
+  SmallVector<const SymbolicRegion*, 12> Postponed;
   SymbolReaper &SymReaper;
   const StackFrameContext *CurrentLCtx;
 
@@ -1736,7 +1736,7 @@
   // having done a scan.
   bool changed = false;
 
-  for (llvm::SmallVectorImpl<const SymbolicRegion*>::iterator
+  for (SmallVectorImpl<const SymbolicRegion*>::iterator
         I = Postponed.begin(), E = Postponed.end() ; I != E ; ++I) {
     if (const SymbolicRegion *SR = cast_or_null<SymbolicRegion>(*I)) {
       if (SymReaper.isLive(SR->getSymbol())) {
@@ -1752,14 +1752,14 @@
 StoreRef RegionStoreManager::removeDeadBindings(Store store,
                                                 const StackFrameContext *LCtx,
                                                 SymbolReaper& SymReaper,
-                           llvm::SmallVectorImpl<const MemRegion*>& RegionRoots)
+                           SmallVectorImpl<const MemRegion*>& RegionRoots)
 {
   RegionBindings B = GetRegionBindings(store);
   removeDeadBindingsWorker W(*this, StateMgr, B, SymReaper, LCtx);
   W.GenerateClusters();
 
   // Enqueue the region roots onto the worklist.
-  for (llvm::SmallVectorImpl<const MemRegion*>::iterator I=RegionRoots.begin(),
+  for (SmallVectorImpl<const MemRegion*>::iterator I=RegionRoots.begin(),
        E=RegionRoots.end(); I!=E; ++I)
     W.AddToWorkList(*I);
 
@@ -1831,7 +1831,7 @@
 // Utility methods.
 //===----------------------------------------------------------------------===//
 
-void RegionStoreManager::print(Store store, llvm::raw_ostream& OS,
+void RegionStoreManager::print(Store store, raw_ostream& OS,
                                const char* nl, const char *sep) {
   RegionBindings B = GetRegionBindings(store);
   OS << "Store (direct and default bindings):" << nl;
diff --git a/lib/StaticAnalyzer/Core/SVals.cpp b/lib/StaticAnalyzer/Core/SVals.cpp
index 4614e34..b74ceb7 100644
--- a/lib/StaticAnalyzer/Core/SVals.cpp
+++ b/lib/StaticAnalyzer/Core/SVals.cpp
@@ -15,11 +15,8 @@
 #include "clang/StaticAnalyzer/Core/PathSensitive/GRState.h"
 #include "clang/AST/ExprObjC.h"
 #include "clang/Basic/IdentifierTable.h"
-
 using namespace clang;
 using namespace ento;
-using llvm::dyn_cast;
-using llvm::cast;
 using llvm::APSInt;
 
 //===----------------------------------------------------------------------===//
@@ -270,7 +267,7 @@
 
 void SVal::dump() const { dumpToStream(llvm::errs()); }
 
-void SVal::dumpToStream(llvm::raw_ostream& os) const {
+void SVal::dumpToStream(raw_ostream& os) const {
   switch (getBaseKind()) {
     case UnknownKind:
       os << "Unknown";
@@ -289,7 +286,7 @@
   }
 }
 
-void NonLoc::dumpToStream(llvm::raw_ostream& os) const {
+void NonLoc::dumpToStream(raw_ostream& os) const {
   switch (getSubKind()) {
     case nonloc::ConcreteIntKind: {
       const nonloc::ConcreteInt& C = *cast<nonloc::ConcreteInt>(this);
@@ -344,7 +341,7 @@
   }
 }
 
-void Loc::dumpToStream(llvm::raw_ostream& os) const {
+void Loc::dumpToStream(raw_ostream& os) const {
   switch (getSubKind()) {
     case loc::ConcreteIntKind:
       os << cast<loc::ConcreteInt>(this)->getValue().getZExtValue() << " (Loc)";
diff --git a/lib/StaticAnalyzer/Core/SymbolManager.cpp b/lib/StaticAnalyzer/Core/SymbolManager.cpp
index c1ca1cf..b55c969 100644
--- a/lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ b/lib/StaticAnalyzer/Core/SymbolManager.cpp
@@ -24,7 +24,7 @@
   dumpToStream(llvm::errs());
 }
 
-static void print(llvm::raw_ostream& os, BinaryOperator::Opcode Op) {
+static void print(raw_ostream& os, BinaryOperator::Opcode Op) {
   switch (Op) {
     default:
       assert(false && "operator printing not implemented");
@@ -48,7 +48,7 @@
   }
 }
 
-void SymIntExpr::dumpToStream(llvm::raw_ostream& os) const {
+void SymIntExpr::dumpToStream(raw_ostream& os) const {
   os << '(';
   getLHS()->dumpToStream(os);
   os << ") ";
@@ -57,7 +57,7 @@
   if (getRHS().isUnsigned()) os << 'U';
 }
 
-void SymSymExpr::dumpToStream(llvm::raw_ostream& os) const {
+void SymSymExpr::dumpToStream(raw_ostream& os) const {
   os << '(';
   getLHS()->dumpToStream(os);
   os << ") ";
@@ -66,25 +66,25 @@
   os << ')';
 }
 
-void SymbolConjured::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolConjured::dumpToStream(raw_ostream& os) const {
   os << "conj_$" << getSymbolID() << '{' << T.getAsString() << '}';
 }
 
-void SymbolDerived::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolDerived::dumpToStream(raw_ostream& os) const {
   os << "derived_$" << getSymbolID() << '{'
      << getParentSymbol() << ',' << getRegion() << '}';
 }
 
-void SymbolExtent::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolExtent::dumpToStream(raw_ostream& os) const {
   os << "extent_$" << getSymbolID() << '{' << getRegion() << '}';
 }
 
-void SymbolMetadata::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolMetadata::dumpToStream(raw_ostream& os) const {
   os << "meta_$" << getSymbolID() << '{'
      << getRegion() << ',' << T.getAsString() << '}';
 }
 
-void SymbolRegionValue::dumpToStream(llvm::raw_ostream& os) const {
+void SymbolRegionValue::dumpToStream(raw_ostream& os) const {
   os << "reg_$" << getSymbolID() << "<" << R << ">";
 }
 
diff --git a/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp b/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
index 230b6a1..c4665ef 100644
--- a/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
+++ b/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
@@ -33,9 +33,9 @@
 
   void HandlePathDiagnostic(const PathDiagnostic* D);
 
-  void FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade) { }
+  void FlushDiagnostics(SmallVectorImpl<std::string> *FilesMade) { }
   
-  virtual llvm::StringRef getName() const {
+  virtual StringRef getName() const {
     return "TextPathDiagnostics";
   }
 
diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
index b8dbb54..dd024f8 100644
--- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -244,7 +244,7 @@
   Mgr.reset(NULL);
 }
 
-static void FindBlocks(DeclContext *D, llvm::SmallVectorImpl<Decl*> &WL) {
+static void FindBlocks(DeclContext *D, SmallVectorImpl<Decl*> &WL) {
   if (BlockDecl *BD = dyn_cast<BlockDecl>(D))
     WL.push_back(BD);
 
@@ -275,14 +275,14 @@
   Mgr->ClearContexts();
 
   // Dispatch on the actions.
-  llvm::SmallVector<Decl*, 10> WL;
+  SmallVector<Decl*, 10> WL;
   WL.push_back(D);
 
   if (D->hasBody() && Opts.AnalyzeNestedBlocks)
     FindBlocks(cast<DeclContext>(D), WL);
 
   BugReporter BR(*Mgr);
-  for (llvm::SmallVectorImpl<Decl*>::iterator WI=WL.begin(), WE=WL.end();
+  for (SmallVectorImpl<Decl*>::iterator WI=WL.begin(), WE=WL.end();
        WI != WE; ++WI)
     if ((*WI)->hasBody()) {
       checkerMgr->runCheckersOnASTBody(*WI, *Mgr, BR);
@@ -383,7 +383,7 @@
 namespace {
 
 class UbigraphViz : public ExplodedNode::Auditor {
-  llvm::OwningPtr<llvm::raw_ostream> Out;
+  llvm::OwningPtr<raw_ostream> Out;
   llvm::sys::Path Dir, Filename;
   unsigned Cntr;
 
@@ -391,7 +391,7 @@
   VMap M;
 
 public:
-  UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir,
+  UbigraphViz(raw_ostream* out, llvm::sys::Path& dir,
               llvm::sys::Path& filename);
 
   ~UbigraphViz();
@@ -460,7 +460,7 @@
        << ", ('arrow','true'), ('oriented', 'true'))\n";
 }
 
-UbigraphViz::UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir,
+UbigraphViz::UbigraphViz(raw_ostream* out, llvm::sys::Path& dir,
                          llvm::sys::Path& filename)
   : Out(out), Dir(dir), Filename(filename), Cntr(0) {
 
diff --git a/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp b/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
index d7edc7e..29c1cd1 100644
--- a/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
+++ b/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
@@ -31,7 +31,7 @@
                                        Diagnostic &diags) {
   llvm::OwningPtr<CheckerManager> checkerMgr(new CheckerManager(langOpts));
 
-  llvm::SmallVector<CheckerOptInfo, 8> checkerOpts;
+  SmallVector<CheckerOptInfo, 8> checkerOpts;
   for (unsigned i = 0, e = opts.CheckersControlList.size(); i != e; ++i) {
     const std::pair<std::string, bool> &opt = opts.CheckersControlList[i];
     checkerOpts.push_back(CheckerOptInfo(opt.first.c_str(), opt.second));
@@ -54,7 +54,7 @@
   return checkerMgr.take();
 }
 
-void ento::printCheckerHelp(llvm::raw_ostream &OS) {
+void ento::printCheckerHelp(raw_ostream &OS) {
   OS << "OVERVIEW: Clang Static Analyzer Checkers List\n";
   OS << '\n';
 
diff --git a/lib/StaticAnalyzer/Frontend/FrontendActions.cpp b/lib/StaticAnalyzer/Frontend/FrontendActions.cpp
index a59cc68..eeb7800 100644
--- a/lib/StaticAnalyzer/Frontend/FrontendActions.cpp
+++ b/lib/StaticAnalyzer/Frontend/FrontendActions.cpp
@@ -14,7 +14,7 @@
 using namespace ento;
 
 ASTConsumer *AnalysisAction::CreateASTConsumer(CompilerInstance &CI,
-                                               llvm::StringRef InFile) {
+                                               StringRef InFile) {
   return CreateAnalysisConsumer(CI.getPreprocessor(),
                                 CI.getFrontendOpts().OutputFile,
                                 CI.getAnalyzerOpts());