diff options
Diffstat (limited to 'clang/lib')
111 files changed, 367 insertions, 377 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 6e024907ad6..af223a106ec 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/lib/ARCMigrate/ARCMT.cpp @@ -419,8 +419,8 @@ bool arcmt::getFileRemappingsFromFileList( bool hasErrorOccurred = false; llvm::StringMap<bool> Uniquer; - llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); - llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags( + IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); + IntrusiveRefCntPtr<DiagnosticsEngine> Diags( new DiagnosticsEngine(DiagID, new DiagnosticOptions, DiagClient, /*ShouldOwnClient=*/false)); diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 88927b3f7a9..7fed082759c 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -36,8 +36,8 @@ public: std::string MigrateDir; bool MigrateLiterals; bool MigrateSubscripting; - llvm::OwningPtr<NSAPI> NSAPIObj; - llvm::OwningPtr<edit::EditedSource> Editor; + OwningPtr<NSAPI> NSAPIObj; + OwningPtr<edit::EditedSource> Editor; FileRemapper &Remapper; FileManager &FileMgr; const PPConditionalDirectiveRecord *PPRec; @@ -193,13 +193,13 @@ void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { RewriteBuffer &buf = I->second; const FileEntry *file = Ctx.getSourceManager().getFileEntryForID(FID); assert(file); - llvm::SmallString<512> newText; + SmallString<512> newText; llvm::raw_svector_ostream vecOS(newText); buf.write(vecOS); vecOS.flush(); llvm::MemoryBuffer *memBuf = llvm::MemoryBuffer::getMemBufferCopy( StringRef(newText.data(), newText.size()), file->getName()); - llvm::SmallString<64> filePath(file->getName()); + SmallString<64> filePath(file->getName()); FileMgr.FixupRelativePath(filePath); Remapper.remap(filePath.str(), memBuf); } diff --git a/clang/lib/ARCMigrate/TransProtectedScope.cpp b/clang/lib/ARCMigrate/TransProtectedScope.cpp index 38d72ff428c..843680a521d 100644 --- a/clang/lib/ARCMigrate/TransProtectedScope.cpp +++ b/clang/lib/ARCMigrate/TransProtectedScope.cpp @@ -54,10 +54,10 @@ struct CaseInfo { class CaseCollector : public RecursiveASTVisitor<CaseCollector> { ParentMap &PMap; - llvm::SmallVectorImpl<CaseInfo> &Cases; + SmallVectorImpl<CaseInfo> &Cases; public: - CaseCollector(ParentMap &PMap, llvm::SmallVectorImpl<CaseInfo> &Cases) + CaseCollector(ParentMap &PMap, SmallVectorImpl<CaseInfo> &Cases) : PMap(PMap), Cases(Cases) { } bool VisitSwitchStmt(SwitchStmt *S) { diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 4b9ecdedd0c..514633ab5b7 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -396,7 +396,7 @@ class TemplateDiff { QualType ToType; /// Str - Storage for the output stream. - llvm::SmallString<128> Str; + SmallString<128> Str; /// OS - The stream used to construct the output strings. llvm::raw_svector_ostream OS; @@ -452,7 +452,7 @@ class TemplateDiff { }; /// FlatTree - A flattened tree used to store the DiffNodes. - llvm::SmallVector<DiffNode, 16> FlatTree; + SmallVector<DiffNode, 16> FlatTree; /// CurrentNode - The index of the current node being used. unsigned CurrentNode; diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index c0180033ed1..0873825ea4e 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -521,7 +521,7 @@ void ASTDumper::VisitFunctionDecl(FunctionDecl *D) { D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); - for (llvm::ArrayRef<NamedDecl*>::iterator + for (ArrayRef<NamedDecl *>::iterator I = D->getDeclsInPrototypeScope().begin(), E = D->getDeclsInPrototypeScope().end(); I != E; ++I) dumpDecl(*I); diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 933375b1292..9bfaa13ddd3 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2213,7 +2213,7 @@ Decl *ASTNodeImporter::VisitNamespaceDecl(NamespaceDecl *D) { MergeWithNamespace = cast<NamespaceDecl>(DC)->getAnonymousNamespace(); } else { SmallVector<NamedDecl *, 4> ConflictingDecls; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(Decl::IDNS_Namespace)) @@ -2276,7 +2276,7 @@ Decl *ASTNodeImporter::VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias) { if (!DC->isFunctionOrMethod()) { SmallVector<NamedDecl *, 4> ConflictingDecls; unsigned IDNS = Decl::IDNS_Ordinary; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -2356,7 +2356,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) { // We may already have an enum of the same name; try to find and match it. if (!DC->isFunctionOrMethod() && SearchName) { SmallVector<NamedDecl *, 4> ConflictingDecls; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(SearchName, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -2442,7 +2442,7 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { RecordDecl *AdoptDecl = 0; if (!DC->isFunctionOrMethod()) { SmallVector<NamedDecl *, 4> ConflictingDecls; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(SearchName, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -2549,7 +2549,7 @@ Decl *ASTNodeImporter::VisitEnumConstantDecl(EnumConstantDecl *D) { if (!LexicalDC->isFunctionOrMethod()) { SmallVector<NamedDecl *, 4> ConflictingDecls; unsigned IDNS = Decl::IDNS_Ordinary; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -2601,7 +2601,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { if (!LexicalDC->isFunctionOrMethod()) { SmallVector<NamedDecl *, 4> ConflictingDecls; unsigned IDNS = Decl::IDNS_Ordinary; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -2811,7 +2811,7 @@ Decl *ASTNodeImporter::VisitFieldDecl(FieldDecl *D) { return 0; // Determine whether we've already imported this field. - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[I])) { @@ -2867,7 +2867,7 @@ Decl *ASTNodeImporter::VisitIndirectFieldDecl(IndirectFieldDecl *D) { return 0; // Determine whether we've already imported this field. - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (IndirectFieldDecl *FoundField @@ -2932,7 +2932,7 @@ Decl *ASTNodeImporter::VisitObjCIvarDecl(ObjCIvarDecl *D) { return 0; // Determine whether we've already imported this ivar - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (ObjCIvarDecl *FoundIvar = dyn_cast<ObjCIvarDecl>(FoundDecls[I])) { @@ -2987,7 +2987,7 @@ Decl *ASTNodeImporter::VisitVarDecl(VarDecl *D) { VarDecl *MergeWithVar = 0; SmallVector<NamedDecl *, 4> ConflictingDecls; unsigned IDNS = Decl::IDNS_Ordinary; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(IDNS)) @@ -3163,7 +3163,7 @@ Decl *ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) { if (ImportDeclParts(D, DC, LexicalDC, Name, Loc)) return 0; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (ObjCMethodDecl *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecls[I])) { @@ -3410,7 +3410,7 @@ Decl *ASTNodeImporter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { return 0; ObjCProtocolDecl *MergeWithProtocol = 0; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(Decl::IDNS_ObjCProtocol)) @@ -3557,7 +3557,7 @@ Decl *ASTNodeImporter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { // Look for an existing interface with the same name. ObjCInterfaceDecl *MergeWithIface = 0; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(Decl::IDNS_Ordinary)) @@ -3709,7 +3709,7 @@ Decl *ASTNodeImporter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { return 0; // Check whether we have already imported this property. - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (ObjCPropertyDecl *FoundProp @@ -3942,7 +3942,7 @@ Decl *ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) { // We may already have a template of the same name; try to find and match it. if (!DC->isFunctionOrMethod()) { SmallVector<NamedDecl *, 4> ConflictingDecls; - llvm::SmallVector<NamedDecl *, 2> FoundDecls; + SmallVector<NamedDecl *, 2> FoundDecls; DC->localUncachedLookup(Name, FoundDecls); for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) { if (!FoundDecls[I]->isInIdentifierNamespace(Decl::IDNS_Ordinary)) diff --git a/clang/lib/AST/CommentDumper.cpp b/clang/lib/AST/CommentDumper.cpp index 19d24b2f3a0..bd8987203fd 100644 --- a/clang/lib/AST/CommentDumper.cpp +++ b/clang/lib/AST/CommentDumper.cpp @@ -244,7 +244,7 @@ void CommentDumper::visitFullComment(const FullComment *C) { } // unnamed namespace -void Comment::dump(llvm::raw_ostream &OS, const CommandTraits *Traits, +void Comment::dump(raw_ostream &OS, const CommandTraits *Traits, const SourceManager *SM) const { const FullComment *FC = dyn_cast<FullComment>(this); CommentDumper D(llvm::errs(), Traits, SM, FC); diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index 44536727cb3..590429809b9 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/lib/AST/CommentSema.cpp @@ -560,11 +560,11 @@ void Sema::resolveParamCommandIndexes(const FullComment *FC) { return; } - llvm::SmallVector<ParamCommandComment *, 8> UnresolvedParamCommands; + SmallVector<ParamCommandComment *, 8> UnresolvedParamCommands; // Comment AST nodes that correspond to \c ParamVars for which we have // found a \\param command or NULL if no documentation was found so far. - llvm::SmallVector<ParamCommandComment *, 8> ParamVarDocs; + SmallVector<ParamCommandComment *, 8> ParamVarDocs; ArrayRef<const ParmVarDecl *> ParamVars = getParamVars(); ParamVarDocs.resize(ParamVars.size(), NULL); @@ -597,7 +597,7 @@ void Sema::resolveParamCommandIndexes(const FullComment *FC) { } // Find parameter declarations that have no corresponding \\param. - llvm::SmallVector<const ParmVarDecl *, 8> OrphanedParamDecls; + SmallVector<const ParmVarDecl *, 8> OrphanedParamDecls; for (unsigned i = 0, e = ParamVarDocs.size(); i != e; ++i) { if (!ParamVarDocs[i]) OrphanedParamDecls.push_back(ParamVars[i]); diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index aeffd0a240f..103ac1bd4ae 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1454,12 +1454,12 @@ EvaluatedStmt *VarDecl::ensureEvaluatedStmt() const { } APValue *VarDecl::evaluateValue() const { - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; return evaluateValue(Notes); } APValue *VarDecl::evaluateValue( - llvm::SmallVectorImpl<PartialDiagnosticAt> &Notes) const { + SmallVectorImpl<PartialDiagnosticAt> &Notes) const { EvaluatedStmt *Eval = ensureEvaluatedStmt(); // We only produce notes indicating why an initializer is non-constant the @@ -1517,7 +1517,7 @@ bool VarDecl::checkInitIsICE() const { // In C++11, evaluate the initializer to check whether it's a constant // expression. if (getASTContext().getLangOpts().CPlusPlus11) { - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; evaluateValue(Notes); return Eval->IsICE; } @@ -1899,7 +1899,7 @@ unsigned FunctionDecl::getNumParams() const { } void FunctionDecl::setParams(ASTContext &C, - llvm::ArrayRef<ParmVarDecl *> NewParamInfo) { + ArrayRef<ParmVarDecl *> NewParamInfo) { assert(ParamInfo == 0 && "Already has param info!"); assert(NewParamInfo.size() == getNumParams() && "Parameter count mismatch!"); @@ -1910,13 +1910,13 @@ void FunctionDecl::setParams(ASTContext &C, } } -void FunctionDecl::setDeclsInPrototypeScope(llvm::ArrayRef<NamedDecl *> NewDecls) { +void FunctionDecl::setDeclsInPrototypeScope(ArrayRef<NamedDecl *> NewDecls) { assert(DeclsInPrototypeScope.empty() && "Already has prototype decls!"); if (!NewDecls.empty()) { NamedDecl **A = new (getASTContext()) NamedDecl*[NewDecls.size()]; std::copy(NewDecls.begin(), NewDecls.end(), A); - DeclsInPrototypeScope = llvm::ArrayRef<NamedDecl*>(A, NewDecls.size()); + DeclsInPrototypeScope = ArrayRef<NamedDecl *>(A, NewDecls.size()); } } @@ -2840,7 +2840,7 @@ void RecordDecl::LoadFieldsFromExternalStorage() const { // BlockDecl Implementation //===----------------------------------------------------------------------===// -void BlockDecl::setParams(llvm::ArrayRef<ParmVarDecl *> NewParamInfo) { +void BlockDecl::setParams(ArrayRef<ParmVarDecl *> NewParamInfo) { assert(ParamInfo == 0 && "Already has param info!"); // Zero params -> null pointer. diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index d8b63611fd1..27a91cb7e66 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -875,7 +875,7 @@ DeclContext *DeclContext::getPrimaryContext() { } void -DeclContext::collectAllContexts(llvm::SmallVectorImpl<DeclContext *> &Contexts){ +DeclContext::collectAllContexts(SmallVectorImpl<DeclContext *> &Contexts){ Contexts.clear(); if (DeclKind != Decl::Namespace) { @@ -1130,7 +1130,7 @@ StoredDeclsMap *DeclContext::buildLookup() { if (!LookupPtr.getInt()) return LookupPtr.getPointer(); - llvm::SmallVector<DeclContext *, 2> Contexts; + SmallVector<DeclContext *, 2> Contexts; collectAllContexts(Contexts); for (unsigned I = 0, N = Contexts.size(); I != N; ++I) buildLookupImpl(Contexts[I]); @@ -1203,8 +1203,8 @@ DeclContext::lookup(DeclarationName Name) { return I->second.getLookupResult(); } -void DeclContext::localUncachedLookup(DeclarationName Name, - llvm::SmallVectorImpl<NamedDecl *> &Results) { +void DeclContext::localUncachedLookup(DeclarationName Name, + SmallVectorImpl<NamedDecl *> &Results) { Results.clear(); // If there's no external storage, just perform a normal lookup and copy diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp index 98226b07084..63616e064a9 100644 --- a/clang/lib/AST/DeclTemplate.cpp +++ b/clang/lib/AST/DeclTemplate.cpp @@ -132,7 +132,7 @@ RedeclarableTemplateDecl::CommonBase *RedeclarableTemplateDecl::getCommonPtr() { if (!Common) { // Walk the previous-declaration chain until we either find a declaration // with a common pointer or we run out of previous declarations. - llvm::SmallVector<RedeclarableTemplateDecl *, 2> PrevDecls; + SmallVector<RedeclarableTemplateDecl *, 2> PrevDecls; for (RedeclarableTemplateDecl *Prev = getPreviousDecl(); Prev; Prev = Prev->getPreviousDecl()) { if (Prev->Common) { @@ -620,7 +620,7 @@ TemplateTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC, SourceLocation L, unsigned D, unsigned P, IdentifierInfo *Id, TemplateParameterList *Params, - llvm::ArrayRef<TemplateParameterList*> Expansions) { + ArrayRef<TemplateParameterList *> Expansions) { void *Mem = C.Allocate(sizeof(TemplateTemplateParmDecl) + sizeof(TemplateParameterList*) * Expansions.size()); return new (Mem) TemplateTemplateParmDecl(DC, L, D, P, Id, Params, diff --git a/clang/lib/AST/DumpXML.cpp b/clang/lib/AST/DumpXML.cpp index ce4e21f90b4..1e7523f3b9e 100644 --- a/clang/lib/AST/DumpXML.cpp +++ b/clang/lib/AST/DumpXML.cpp @@ -499,8 +499,8 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>, for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end(); I != E; ++I) dispatch(*I); - for (llvm::ArrayRef<NamedDecl*>::iterator - I = D->getDeclsInPrototypeScope().begin(), E = D->getDeclsInPrototypeScope().end(); + for (ArrayRef<NamedDecl *>::iterator I = D->getDeclsInPrototypeScope().begin(), + E = D->getDeclsInPrototypeScope().end(); I != E; ++I) dispatch(*I); if (D->doesThisDeclarationHaveABody()) diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 5689d9cae46..45f61fa5c21 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -2566,7 +2566,7 @@ bool Expr::isImplicitCXXThis() const { /// hasAnyTypeDependentArguments - Determines if any of the expressions /// in Exprs is type-dependent. -bool Expr::hasAnyTypeDependentArguments(llvm::ArrayRef<Expr *> Exprs) { +bool Expr::hasAnyTypeDependentArguments(ArrayRef<Expr *> Exprs) { for (unsigned I = 0; I < Exprs.size(); ++I) if (Exprs[I]->isTypeDependent()) return true; @@ -3884,7 +3884,7 @@ Stmt::child_range ObjCMessageExpr::children() { reinterpret_cast<Stmt **>(getArgs() + getNumArgs())); } -ObjCArrayLiteral::ObjCArrayLiteral(llvm::ArrayRef<Expr *> Elements, +ObjCArrayLiteral::ObjCArrayLiteral(ArrayRef<Expr *> Elements, QualType T, ObjCMethodDecl *Method, SourceRange SR) : Expr(ObjCArrayLiteralClass, T, VK_RValue, OK_Ordinary, @@ -3905,7 +3905,7 @@ ObjCArrayLiteral::ObjCArrayLiteral(llvm::ArrayRef<Expr *> Elements, } ObjCArrayLiteral *ObjCArrayLiteral::Create(ASTContext &C, - llvm::ArrayRef<Expr *> Elements, + ArrayRef<Expr *> Elements, QualType T, ObjCMethodDecl * Method, SourceRange SR) { void *Mem = C.Allocate(sizeof(ObjCArrayLiteral) diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp index e1977d803bc..4b520e4fdf9 100644 --- a/clang/lib/AST/ExprCXX.cpp +++ b/clang/lib/AST/ExprCXX.cpp @@ -1339,7 +1339,7 @@ FunctionParmPackExpr::FunctionParmPackExpr(QualType T, ParmVarDecl *ParamPack, FunctionParmPackExpr * FunctionParmPackExpr::Create(ASTContext &Context, QualType T, ParmVarDecl *ParamPack, SourceLocation NameLoc, - llvm::ArrayRef<Decl*> Params) { + ArrayRef<Decl *> Params) { return new (Context.Allocate(sizeof(FunctionParmPackExpr) + sizeof(ParmVarDecl*) * Params.size())) FunctionParmPackExpr(T, ParamPack, NameLoc, Params.size(), Params.data()); diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 622f37b178c..9965e1288b3 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -318,7 +318,7 @@ namespace { OptionalDiagnostic &operator<<(const APSInt &I) { if (Diag) { - llvm::SmallVector<char, 32> Buffer; + SmallVector<char, 32> Buffer; I.toString(Buffer); *Diag << StringRef(Buffer.data(), Buffer.size()); } @@ -327,7 +327,7 @@ namespace { OptionalDiagnostic &operator<<(const APFloat &F) { if (Diag) { - llvm::SmallVector<char, 32> Buffer; + SmallVector<char, 32> Buffer; F.toString(Buffer); *Diag << StringRef(Buffer.data(), Buffer.size()); } @@ -535,8 +535,7 @@ namespace { public: SpeculativeEvaluationRAII(EvalInfo &Info, - llvm::SmallVectorImpl<PartialDiagnosticAt> - *NewDiag = 0) + SmallVectorImpl<PartialDiagnosticAt> *NewDiag = 0) : Info(Info), Old(Info.EvalStatus) { Info.EvalStatus.Diag = NewDiag; } @@ -587,7 +586,7 @@ CallStackFrame::~CallStackFrame() { } /// Produce a string describing the given constexpr call. -static void describeCall(CallStackFrame *Frame, llvm::raw_ostream &Out) { +static void describeCall(CallStackFrame *Frame, raw_ostream &Out) { unsigned ArgIndex = 0; bool IsMemberCall = isa<CXXMethodDecl>(Frame->Callee) && !isa<CXXConstructorDecl>(Frame->Callee) && @@ -635,7 +634,7 @@ void EvalInfo::addCallStack(unsigned Limit) { continue; } - llvm::SmallVector<char, 128> Buffer; + SmallVector<char, 128> Buffer; llvm::raw_svector_ostream Out(Buffer); describeCall(Frame, Out); addDiag(Frame->CallLoc, diag::note_constexpr_call_here) << Out.str(); @@ -1463,7 +1462,7 @@ static bool EvaluateVarDeclInit(EvalInfo &Info, const Expr *E, // Check that we can fold the initializer. In C++, we will have already done // this in the cases where it matters for conformance. - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; if (!VD->evaluateValue(Notes)) { Info.Diag(E, diag::note_constexpr_var_init_non_constant, Notes.size() + 1) << VD; @@ -2312,7 +2311,7 @@ private: // Speculatively evaluate both arms. { - llvm::SmallVector<PartialDiagnosticAt, 8> Diag; + SmallVector<PartialDiagnosticAt, 8> Diag; SpeculativeEvaluationRAII Speculate(Info, &Diag); StmtVisitorTy::Visit(E->getFalseExpr()); @@ -2483,7 +2482,7 @@ public: const FunctionDecl *FD = 0; LValue *This = 0, ThisVal; - llvm::ArrayRef<const Expr*> Args(E->getArgs(), E->getNumArgs()); + ArrayRef<const Expr *> Args(E->getArgs(), E->getNumArgs()); bool HasQualifier = false; // Extract function decl and 'this' pointer from the callee. @@ -3488,7 +3487,7 @@ bool RecordExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E) { if (ZeroInit && !ZeroInitialization(E)) return false; - llvm::ArrayRef<const Expr*> Args(E->getArgs(), E->getNumArgs()); + ArrayRef<const Expr *> Args(E->getArgs(), E->getNumArgs()); return HandleConstructorCall(E->getExprLoc(), This, Args, cast<CXXConstructorDecl>(Definition), Info, Result); @@ -3899,7 +3898,7 @@ bool ArrayExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E) { return false; } - llvm::ArrayRef<const Expr*> Args(E->getArgs(), E->getNumArgs()); + ArrayRef<const Expr *> Args(E->getArgs(), E->getNumArgs()); return HandleConstructorCall(E->getExprLoc(), Subobject, Args, cast<CXXConstructorDecl>(Definition), Info, *Value); @@ -6320,7 +6319,7 @@ bool Expr::EvaluateAsLValue(EvalResult &Result, const ASTContext &Ctx) const { bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, const VarDecl *VD, - llvm::SmallVectorImpl<PartialDiagnosticAt> &Notes) const { + SmallVectorImpl<PartialDiagnosticAt> &Notes) const { // FIXME: Evaluating initializers for large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && @@ -6365,7 +6364,7 @@ bool Expr::isEvaluatable(const ASTContext &Ctx) const { } APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx, - llvm::SmallVectorImpl<PartialDiagnosticAt> *Diag) const { + SmallVectorImpl<PartialDiagnosticAt> *Diag) const { EvalResult EvalResult; EvalResult.Diag = Diag; bool Result = EvaluateAsRValue(EvalResult, Ctx); @@ -6843,7 +6842,7 @@ bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result, // Build evaluation settings. Expr::EvalStatus Status; - llvm::SmallVector<PartialDiagnosticAt, 8> Diags; + SmallVector<PartialDiagnosticAt, 8> Diags; Status.Diag = &Diags; EvalInfo Info(Ctx, Status); @@ -6862,7 +6861,7 @@ bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result, } bool Expr::isPotentialConstantExpr(const FunctionDecl *FD, - llvm::SmallVectorImpl< + SmallVectorImpl< PartialDiagnosticAt> &Diags) { // FIXME: It would be useful to check constexpr function templates, but at the // moment the constant expression evaluator cannot cope with the non-rigorous diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index b6077ec134c..65e630eb256 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -657,7 +657,7 @@ void CXXNameMangler::mangleFloat(const llvm::APFloat &f) { assert(numCharacters != 0); // Allocate a buffer of the right number of characters. - llvm::SmallVector<char, 20> buffer; + SmallVector<char, 20> buffer; buffer.set_size(numCharacters); // Fill the buffer left-to-right. diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp index 0b1d1b6f258..3c797982ade 100644 --- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp @@ -40,7 +40,7 @@ typedef MatchFinder::MatchCallback MatchCallback; class ParentMapASTVisitor : public RecursiveASTVisitor<ParentMapASTVisitor> { public: /// \brief Contains parents of a node. - typedef llvm::SmallVector<ast_type_traits::DynTypedNode, 1> ParentVector; + typedef SmallVector<ast_type_traits::DynTypedNode, 1> ParentVector; /// \brief Maps from a node to its parents. typedef llvm::DenseMap<const void *, ParentVector> ParentMap; @@ -94,7 +94,7 @@ private: } ParentMap *Parents; - llvm::SmallVector<ast_type_traits::DynTypedNode, 16> ParentStack; + SmallVector<ast_type_traits::DynTypedNode, 16> ParentStack; friend class RecursiveASTVisitor<ParentMapASTVisitor>; }; @@ -573,7 +573,7 @@ private: typedef llvm::DenseMap<UntypedMatchInput, MemoizedMatchResult> MemoizationMap; MemoizationMap ResultCache; - llvm::OwningPtr<ParentMapASTVisitor::ParentMap> Parents; + OwningPtr<ParentMapASTVisitor::ParentMap> Parents; }; // Returns true if the given class is directly or indirectly derived @@ -622,7 +622,7 @@ bool MatchASTVisitor::classIsDerivedFrom(const CXXRecordDecl *Declaration, if (SpecializationDecl != NULL) { ClassDecl = SpecializationDecl; } else { - ClassDecl = llvm::dyn_cast<CXXRecordDecl>( + ClassDecl = dyn_cast<CXXRecordDecl>( TemplateType->getTemplateName() .getAsTemplateDecl()->getTemplatedDecl()); } diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp index 9f1f4e41c90..7bf01bbbe81 100644 --- a/clang/lib/Analysis/ReachableCode.cpp +++ b/clang/lib/Analysis/ReachableCode.cpp @@ -29,9 +29,9 @@ namespace { class DeadCodeScan { llvm::BitVector Visited; llvm::BitVector &Reachable; - llvm::SmallVector<const CFGBlock *, 10> WorkList; + SmallVector<const CFGBlock *, 10> WorkList; - typedef llvm::SmallVector<std::pair<const CFGBlock *, const Stmt *>, 12> + typedef SmallVector<std::pair<const CFGBlock *, const Stmt *>, 12> DeferredLocsTy; DeferredLocsTy DeferredLocs; diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 9c33a8e97c7..8fae529643f 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -2343,7 +2343,7 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) { // union because the real error is probably that we forgot to unlock M on // all code paths. bool LocksetInitialized = false; - llvm::SmallVector<CFGBlock*, 8> SpecialBlocks; + SmallVector<CFGBlock *, 8> SpecialBlocks; for (CFGBlock::const_pred_iterator PI = CurrBlock->pred_begin(), PE = CurrBlock->pred_end(); PI != PE; ++PI) { diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp index e19fd0a5a20..fbd49de20eb 100644 --- a/clang/lib/Analysis/UninitializedValues.cpp +++ b/clang/lib/Analysis/UninitializedValues.cpp @@ -509,8 +509,8 @@ public: // 'n' is definitely uninitialized for two edges into block 7 (from blocks 2 // and 4), so we report that any time either of those edges is taken (in // each case when 'b == false'), 'n' is used uninitialized. - llvm::SmallVector<const CFGBlock*, 32> Queue; - llvm::SmallVector<unsigned, 32> SuccsVisited(cfg.getNumBlockIDs(), 0); + SmallVector<const CFGBlock*, 32> Queue; + SmallVector<unsigned, 32> SuccsVisited(cfg.getNumBlockIDs(), 0); Queue.push_back(block); // Specify that we've already visited all successors of the starting block. // This has the dual purpose of ensuring we never add it to the queue, and diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 70d3939150f..f8e21481403 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -234,7 +234,7 @@ bool DiagnosticsEngine::setDiagnosticGroupMapping( StringRef Group, diag::Mapping Map, SourceLocation Loc) { // Get the diagnostics in this group. - llvm::SmallVector<diag::kind, 8> GroupDiags; + SmallVector<diag::kind, 8> GroupDiags; if (Diags->getDiagnosticsInGroup(Group, GroupDiags)) return true; @@ -274,7 +274,7 @@ bool DiagnosticsEngine::setDiagnosticGroupWarningAsError(StringRef Group, // potentially downgrade anything already mapped to be a warning. // Get the diagnostics in this group. - llvm::SmallVector<diag::kind, 8> GroupDiags; + SmallVector<diag::kind, 8> GroupDiags; if (Diags->getDiagnosticsInGroup(Group, GroupDiags)) return true; @@ -321,7 +321,7 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group, // potentially downgrade anything already mapped to be an error. // Get the diagnostics in this group. - llvm::SmallVector<diag::kind, 8> GroupDiags; + SmallVector<diag::kind, 8> GroupDiags; if (Diags->getDiagnosticsInGroup(Group, GroupDiags)) return true; @@ -342,7 +342,7 @@ bool DiagnosticsEngine::setDiagnosticGroupErrorAsFatal(StringRef Group, void DiagnosticsEngine::setMappingToAllDiagnostics(diag::Mapping Map, SourceLocation Loc) { // Get all the diagnostics. - llvm::SmallVector<diag::kind, 64> AllDiags; + SmallVector<diag::kind, 64> AllDiags; Diags->getAllDiagnostics(AllDiags); // Set the mapping. diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index e1f400adaa5..dc2e310449d 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -546,9 +546,8 @@ StringRef DiagnosticIDs::getWarningOptionForDiag(unsigned DiagID) { } void DiagnosticIDs::getDiagnosticsInGroup( - const WarningOption *Group, - llvm::SmallVectorImpl<diag::kind> &Diags) const -{ + const WarningOption *Group, + SmallVectorImpl<diag::kind> &Diags) const { // Add the members of the option diagnostic set. if (const short *Member = Group->Members) { for (; *Member != -1; ++Member) @@ -563,9 +562,8 @@ void DiagnosticIDs::getDiagnosticsInGroup( } bool DiagnosticIDs::getDiagnosticsInGroup( - StringRef Group, - llvm::SmallVectorImpl<diag::kind> &Diags) const -{ + StringRef Group, + SmallVectorImpl<diag::kind> &Diags) const { WarningOption Key = { Group.size(), Group.data(), 0, 0 }; const WarningOption *Found = std::lower_bound(OptionTable, OptionTable + OptionTableSize, Key, @@ -579,7 +577,7 @@ bool DiagnosticIDs::getDiagnosticsInGroup( } void DiagnosticIDs::getAllDiagnostics( - llvm::SmallVectorImpl<diag::kind> &Diags) const { + SmallVectorImpl<diag::kind> &Diags) const { for (unsigned i = 0; i != StaticDiagInfoSize; ++i) Diags.push_back(StaticDiagInfo[i].DiagID); } diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 454dd9c02bd..417c7e57453 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -103,15 +103,15 @@ const Module *Module::getTopLevelModule() const { } std::string Module::getFullModuleName() const { - llvm::SmallVector<StringRef, 2> Names; + SmallVector<StringRef, 2> Names; // Build up the set of module names (from innermost to outermost). for (const Module *M = this; M; M = M->Parent) Names.push_back(M->Name); std::string Result; - for (llvm::SmallVector<StringRef, 2>::reverse_iterator I = Names.rbegin(), - IEnd = Names.rend(); + for (SmallVector<StringRef, 2>::reverse_iterator I = Names.rbegin(), + IEnd = Names.rend(); I != IEnd; ++I) { if (!Result.empty()) Result += '.'; @@ -140,7 +140,7 @@ void Module::addRequirement(StringRef Feature, const LangOptions &LangOpts, if (!IsAvailable) return; - llvm::SmallVector<Module *, 2> Stack; + SmallVector<Module *, 2> Stack; Stack.push_back(this); while (!Stack.empty()) { Module *Current = Stack.back(); @@ -167,7 +167,7 @@ Module *Module::findSubmodule(StringRef Name) const { return SubModules[Pos->getValue()]; } -static void printModuleId(llvm::raw_ostream &OS, const ModuleId &Id) { +static void printModuleId(raw_ostream &OS, const ModuleId &Id) { for (unsigned I = 0, N = Id.size(); I != N; ++I) { if (I) OS << "."; @@ -175,7 +175,7 @@ static void printModuleId(llvm::raw_ostream &OS, const ModuleId &Id) { } } -void Module::print(llvm::raw_ostream &OS, unsigned Indent) const { +void Module::print(raw_ostream &OS, unsigned Indent) const { OS.indent(Indent); if (IsFramework) OS << "framework "; diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 3426262b2a3..9f7e97cf7f0 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -1122,7 +1122,7 @@ namespace { class NVPTXTargetInfo : public TargetInfo { static const char * const GCCRegNames[]; static const Builtin::Info BuiltinInfo[]; - std::vector<llvm::StringRef> AvailableFeatures; + std::vector<StringRef> AvailableFeatures; public: NVPTXTargetInfo(const std::string& triple) : TargetInfo(triple) { BigEndian = false; @@ -4443,7 +4443,7 @@ namespace { class SPIRTargetInfo : public TargetInfo { static const char * const GCCRegNames[]; static const Builtin::Info BuiltinInfo[]; - std::vector<llvm::StringRef> AvailableFeatures; + std::vector<StringRef> AvailableFeatures; public: SPIRTargetInfo(const std::string& triple) : TargetInfo(triple) { assert(getTriple().getOS() == llvm::Triple::UnknownOS && diff --git a/clang/lib/CodeGen/CGBlocks.h b/clang/lib/CodeGen/CGBlocks.h index a70578943ab..020638a5581 100644 --- a/clang/lib/CodeGen/CGBlocks.h +++ b/clang/lib/CodeGen/CGBlocks.h @@ -144,7 +144,7 @@ inline BlockFieldFlags operator|(BlockFieldFlag_t l, BlockFieldFlag_t r) { class CGBlockInfo { public: /// Name - The name of the block, kindof. - llvm::StringRef Name; + StringRef Name; /// The field index of 'this' within the block, if there is one. unsigned CXXThisIndex; @@ -247,7 +247,7 @@ public: return BlockExpression; } - CGBlockInfo(const BlockDecl *blockDecl, llvm::StringRef Name); + CGBlockInfo(const BlockDecl *blockDecl, StringRef Name); }; } // end namespace CodeGen diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 0898599bdcd..55f2757ccd6 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -415,7 +415,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, if (getLangOpts().SanitizeUnreachable) EmitCheck(Builder.getFalse(), "builtin_unreachable", EmitCheckSourceLocation(E->getExprLoc()), - llvm::ArrayRef<llvm::Value *>(), CRK_Unrecoverable); + ArrayRef<llvm::Value *>(), CRK_Unrecoverable); else Builder.CreateUnreachable(); @@ -1318,7 +1318,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, // Get the annotation string, go through casts. Sema requires this to be a // non-wide string literal, potentially casted, so the cast<> is safe. const Expr *AnnotationStrExpr = E->getArg(1)->IgnoreParenCasts(); - llvm::StringRef Str = cast<StringLiteral>(AnnotationStrExpr)->getString(); + StringRef Str = cast<StringLiteral>(AnnotationStrExpr)->getString(); return RValue::get(EmitAnnotationCall(F, AnnVal, Str, E->getExprLoc())); } case Builtin::BI__noop: diff --git a/clang/lib/CodeGen/CGCUDANV.cpp b/clang/lib/CodeGen/CGCUDANV.cpp index d3397d066ba..ed70c7cfb28 100644 --- a/clang/lib/CodeGen/CGCUDANV.cpp +++ b/clang/lib/CodeGen/CGCUDANV.cpp @@ -78,7 +78,7 @@ llvm::Constant *CGNVCUDARuntime::getLaunchFn() const { void CGNVCUDARuntime::EmitDeviceStubBody(CodeGenFunction &CGF, FunctionArgList &Args) { // Build the argument value list and the argument stack struct type. - llvm::SmallVector<llvm::Value *, 16> ArgValues; + SmallVector<llvm::Value *, 16> ArgValues; std::vector<llvm::Type *> ArgTypes; for (FunctionArgList::const_iterator I = Args.begin(), E = Args.end(); I != E; ++I) { diff --git a/clang/lib/CodeGen/CGCall.h b/clang/lib/CodeGen/CGCall.h index 55af4e5fbfa..734ba69c877 100644 --- a/clang/lib/CodeGen/CGCall.h +++ b/clang/lib/CodeGen/CGCall.h @@ -29,8 +29,6 @@ namespace llvm { class Function; class Type; class Value; - - template<typename T, unsigned> class SmallVector; } namespace clang { diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index b30d820a929..58ef3ae1a80 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -871,7 +871,7 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { // Create a filter expression: a constant array indicating which filter // types there are. The personality routine only lands here if the filter // doesn't match. - llvm::SmallVector<llvm::Constant*, 8> Filters; + SmallVector<llvm::Constant*, 8> Filters; llvm::ArrayType *AType = llvm::ArrayType::get(!filterTypes.empty() ? filterTypes[0]->getType() : Int8PtrTy, diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index c002bb1432d..dd248e1900c 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -553,7 +553,7 @@ void CodeGenFunction::EmitTypeCheck(TypeCheckKind TCK, SourceLocation Loc, // FIXME: This is not guaranteed to be deterministic! Move to a // fingerprinting mechanism once LLVM provides one. For the time // being the implementation happens to be deterministic. - llvm::SmallString<64> MangledName; + SmallString<64> MangledName; llvm::raw_svector_ostream Out(MangledName); CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty.getUnqualifiedType(), Out); @@ -1095,7 +1095,7 @@ void CodeGenFunction::EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr, llvm::LLVMContext &VMContext = getLLVMContext(); // Our source is a vec3, do a shuffle vector to make it a vec4. - llvm::SmallVector<llvm::Constant*, 4> Mask; + SmallVector<llvm::Constant*, 4> Mask; Mask.push_back(llvm::ConstantInt::get( llvm::Type::getInt32Ty(VMContext), 0)); @@ -1908,7 +1908,7 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) { // Format the type name as if for a diagnostic, including quotes and // optionally an 'aka'. - llvm::SmallString<32> Buffer; + SmallString<32> Buffer; CGM.getDiags().ConvertArgToString(DiagnosticsEngine::ak_qualtype, (intptr_t)T.getAsOpaquePtr(), 0, 0, 0, 0, 0, 0, Buffer, @@ -1971,8 +1971,8 @@ llvm::Constant *CodeGenFunction::EmitCheckSourceLocation(SourceLocation Loc) { } void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName, - llvm::ArrayRef<llvm::Constant *> StaticArgs, - llvm::ArrayRef<llvm::Value *> DynamicArgs, + ArrayRef<llvm::Constant *> StaticArgs, + ArrayRef<llvm::Value *> DynamicArgs, CheckRecoverableKind RecoverKind) { llvm::BasicBlock *Cont = createBasicBlock("cont"); @@ -1994,8 +1994,8 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName, llvm::GlobalVariable::PrivateLinkage, Info); InfoPtr->setUnnamedAddr(true); - llvm::SmallVector<llvm::Value *, 4> Args; - llvm::SmallVector<llvm::Type *, 4> ArgTypes; + SmallVector<llvm::Value *, 4> Args; + SmallVector<llvm::Type *, 4> ArgTypes; Args.reserve(DynamicArgs.size() + 1); ArgTypes.reserve(DynamicArgs.size() + 1); @@ -3260,7 +3260,7 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest) { // Use a library call. See: http://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary . if (UseLibcall) { - llvm::SmallVector<QualType, 5> Params; + SmallVector<QualType, 5> Params; CallArgList Args; // Size is always the first parameter Args.add(RValue::get(llvm::ConstantInt::get(SizeTy, Size)), @@ -3485,7 +3485,7 @@ static LValueOrRValue emitPseudoObjectExpr(CodeGenFunction &CGF, const PseudoObjectExpr *E, bool forLValue, AggValueSlot slot) { - llvm::SmallVector<CodeGenFunction::OpaqueValueMappingData, 4> opaques; + SmallVector<CodeGenFunction::OpaqueValueMappingData, 4> opaques; // Find the result expression, if any. const Expr *resultExpr = E->getResultExpr(); diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index c5f94726e6f..2c107cb716a 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -455,7 +455,7 @@ void ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD, // Accumulate and sort bases, in order to visit them in address order, which // may not be the same as declaration order. - llvm::SmallVector<BaseInfo, 8> Bases; + SmallVector<BaseInfo, 8> Bases; Bases.reserve(CD->getNumBases()); unsigned BaseNo = 0; for (CXXRecordDecl::base_class_const_iterator Base = CD->bases_begin(), diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index fb5f58ddbb2..ebabf764485 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -802,8 +802,8 @@ Value *ScalarExprEmitter::EmitNullValue(QualType Ty) { /// operation). The check passes if \p Check, which is an \c i1, is \c true. void ScalarExprEmitter::EmitBinOpCheck(Value *Check, const BinOpInfo &Info) { StringRef CheckName; - llvm::SmallVector<llvm::Constant *, 4> StaticData; - llvm::SmallVector<llvm::Value *, 2> DynamicData; + SmallVector<llvm::Constant *, 4> StaticData; + SmallVector<llvm::Value *, 2> DynamicData; BinaryOperatorKind Opcode = Info.Opcode; if (BinaryOperator::isCompoundAssignmentOp(Opcode)) diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 4431d7ecec0..e861222cf5f 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -2445,7 +2445,7 @@ static bool shouldEmitSeparateBlockRetain(const Expr *e) { /// This massively duplicates emitPseudoObjectRValue. static TryEmitResult tryEmitARCRetainPseudoObject(CodeGenFunction &CGF, const PseudoObjectExpr *E) { - llvm::SmallVector<CodeGenFunction::OpaqueValueMappingData, 4> opaques; + SmallVector<CodeGenFunction::OpaqueValueMappingData, 4> opaques; // Find the result expression. const Expr *resultExpr = E->getResultExpr(); diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index adc2ed02857..44734dfe992 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -192,7 +192,7 @@ protected: /// The element types must match the types of the structure elements in the /// first argument. llvm::GlobalVariable *MakeGlobal(llvm::StructType *Ty, - llvm::ArrayRef<llvm::Constant*> V, + ArrayRef<llvm::Constant *> V, StringRef Name="", llvm::GlobalValue::LinkageTypes linkage =llvm::GlobalValue::InternalLinkage) { @@ -204,7 +204,7 @@ protected: /// elements that the array type declares, of the type specified as the array /// element type. llvm::GlobalVariable *MakeGlobal(llvm::ArrayType *Ty, - llvm::ArrayRef<llvm::Constant*> V, + ArrayRef<llvm::Constant *> V, StringRef Name="", llvm::GlobalValue::LinkageTypes linkage =llvm::GlobalValue::InternalLinkage) { @@ -215,7 +215,7 @@ protected: /// Generates a global array, inferring the array type from the specified /// element type and the size of the initialiser. llvm::GlobalVariable *MakeGlobalArray(llvm::Type *Ty, - llvm::ArrayRef<llvm::Constant*> V, + ArrayRef<llvm::Constant *> V, StringRef Name="", llvm::GlobalValue::LinkageTypes linkage =llvm::GlobalValue::InternalLinkage) { @@ -1955,7 +1955,7 @@ llvm::Constant *CGObjCGNU::MakeBitField(ArrayRef<bool> bits) { } return llvm::ConstantInt::get(IntPtrTy, val); } - llvm::SmallVector<llvm::Constant*, 8> values; + SmallVector<llvm::Constant *, 8> values; int v=0; while (v < bitCount) { int32_t word = 0; diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index ddc422395b8..91fa1d597f2 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -879,16 +879,16 @@ protected: llvm::DenseSet<IdentifierInfo*> DefinedProtocols; /// DefinedClasses - List of defined classes. - llvm::SmallVector<llvm::GlobalValue*, 16> DefinedClasses; + SmallVector<llvm::GlobalValue*, 16> DefinedClasses; /// DefinedNonLazyClasses - List of defined "non-lazy" classes. - llvm::SmallVector<llvm::GlobalValue*, 16> DefinedNonLazyClasses; + SmallVector<llvm::GlobalValue*, 16> DefinedNonLazyClasses; /// DefinedCategories - List of defined categories. - llvm::SmallVector<llvm::GlobalValue*, 16> DefinedCategories; + SmallVector<llvm::GlobalValue*, 16> DefinedCategories; /// DefinedNonLazyCategories - List of defined "non-lazy" categories. - llvm::SmallVector<llvm::GlobalValue*, 16> DefinedNonLazyCategories; + SmallVector<llvm::GlobalValue*, 16> DefinedNonLazyCategories; /// GetNameForMethod - Return a name for the given method. /// \param[out] NameOut - The return value. @@ -984,7 +984,7 @@ protected: /// PushProtocolProperties - Push protocol's property on the input stack. void PushProtocolProperties( llvm::SmallPtrSet<const IdentifierInfo*, 16> &PropertySet, - llvm::SmallVectorImpl<llvm::Constant*> &Properties, + SmallVectorImpl<llvm::Constant*> &Properties, const Decl *Container, const ObjCProtocolDecl *PROTO, const ObjCCommonTypesHelper &ObjCTypes); @@ -2691,7 +2691,7 @@ llvm::Constant * CGObjCMac::EmitProtocolList(Twine Name, ObjCProtocolDecl::protocol_iterator begin, ObjCProtocolDecl::protocol_iterator end) { - llvm::SmallVector<llvm::Constant*, 16> ProtocolRefs; + SmallVector<llvm::Constant *, 16> ProtocolRefs; for (; begin != end; ++begin) ProtocolRefs.push_back(GetProtocolRef(*begin)); @@ -2722,7 +2722,7 @@ CGObjCMac::EmitProtocolList(Twine Name, void CGObjCCommonMac:: PushProtocolProperties(llvm::SmallPtrSet<const IdentifierInfo*,16> &PropertySet, - llvm::SmallVectorImpl<llvm::Constant*> &Properties, + SmallVectorImpl<llvm::Constant *> &Properties, const Decl *Container, const ObjCProtocolDecl *PROTO, const ObjCCommonTypesHelper &ObjCTypes) { @@ -2758,7 +2758,7 @@ llvm::Constant *CGObjCCommonMac::EmitPropertyList(Twine Name, const Decl *Container, const ObjCContainerDecl *OCD, const ObjCCommonTypesHelper &ObjCTypes) { - llvm::SmallVector<llvm::Constant*, 16> Properties; + SmallVector<llvm::Constant *, 16> Properties; llvm::SmallPtrSet<const IdentifierInfo*, 16> PropertySet; for (ObjCContainerDecl::prop_iterator I = OCD->prop_begin(), E = OCD->prop_end(); I != E; ++I) { @@ -2893,7 +2893,7 @@ void CGObjCMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) { llvm::raw_svector_ostream(ExtName) << Interface->getName() << '_' << OCD->getName(); - llvm::SmallVector<llvm::Constant*, 16> InstanceMethods, ClassMethods; + SmallVector<llvm::Constant *, 16> InstanceMethods, ClassMethods; for (ObjCCategoryImplDecl::instmeth_iterator i = OCD->instmeth_begin(), e = OCD->instmeth_end(); i != e; ++i) { // Instance methods should always be defined. @@ -3021,7 +3021,7 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) { if (ID->getClassInterface()->getVisibility() == HiddenVisibility) Flags |= FragileABI_Class_Hidden; - llvm::SmallVector<llvm::Constant*, 16> InstanceMethods, ClassMethods; + SmallVector<llvm::Constant *, 16> InstanceMethods, ClassMethods; for (ObjCImplementationDecl::instmeth_iterator i = ID->instmeth_begin(), e = ID->instmeth_end(); i != e; ++i) { // Instance methods should always be defined. @@ -6340,7 +6340,7 @@ llvm::Constant * CGObjCNonFragileABIMac::EmitProtocolList(Twine Name, ObjCProtocolDecl::protocol_iterator begin, ObjCProtocolDecl::protocol_iterator end) { - llvm::SmallVector<llvm::Constant*, 16> ProtocolRefs; + SmallVector<llvm::Constant *, 16> ProtocolRefs; // Just return null for empty protocol lists if (begin == end) diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp index f9fec344c88..8e81d4d89be 100644 --- a/clang/lib/CodeGen/CodeGenAction.cpp +++ b/clang/lib/CodeGen/CodeGenAction.cpp @@ -398,7 +398,7 @@ void CodeGenAction::ExecuteAction() { Msg = Msg.substr(7); // Escape '%', which is interpreted as a format character. - llvm::SmallString<128> EscapedMessage; + SmallString<128> EscapedMessage; for (unsigned i = 0, e = Msg.size(); i != e; ++i) { if (Msg[i] == '%') EscapedMessage += '%'; diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 09e7ae22699..8ba1bf4b6fd 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -270,7 +270,7 @@ void CodeGenFunction::EmitMCountInstrumentation() { // FIXME: Add type, address, and access qualifiers. static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn, CodeGenModule &CGM,llvm::LLVMContext &Context, - llvm::SmallVector <llvm::Value*, 5> &kernelMDArgs) { + SmallVector <llvm::Value*, 5> &kernelMDArgs) { // Create MDNodes that represents the kernel arg metadata. // Each MDNode is a list in the form of "key", N number of values which is @@ -299,7 +299,7 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD, llvm::LLVMContext &Context = getLLVMContext(); - llvm::SmallVector <llvm::Value*, 5> kernelMDArgs; + SmallVector <llvm::Value*, 5> kernelMDArgs; kernelMDArgs.push_back(Fn); if (CGM.getCodeGenOpts().EmitOpenCLArgMetadata) @@ -561,7 +561,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, if (getLangOpts().SanitizeReturn) EmitCheck(Builder.getFalse(), "missing_return", EmitCheckSourceLocation(FD->getLocation()), - llvm::ArrayRef<llvm::Value*>(), CRK_Unrecoverable); + ArrayRef<llvm::Value *>(), CRK_Unrecoverable); else if (CGM.getCodeGenOpts().OptimizationLevel == 0) Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::trap)); Builder.CreateUnreachable(); @@ -1239,7 +1239,7 @@ void CodeGenFunction::unprotectFromPeepholes(PeepholeProtection protection) { llvm::Value *CodeGenFunction::EmitAnnotationCall(llvm::Value *AnnotationFn, llvm::Value *AnnotatedVal, - llvm::StringRef AnnotationStr, + StringRef AnnotationStr, SourceLocation Location) { llvm::Value *Args[4] = { AnnotatedVal, diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index acc12fe6b63..61122666a18 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2518,7 +2518,7 @@ public: /// Emit an annotation call (intrinsic or builtin). llvm::Value *EmitAnnotationCall(llvm::Value *AnnotationFn, llvm::Value *AnnotatedVal, - llvm::StringRef AnnotationStr, + StringRef AnnotationStr, SourceLocation Location); /// Emit local annotations for the local variable V, declared by D. @@ -2584,8 +2584,8 @@ public: /// sanitizer runtime with the provided arguments, and create a conditional /// branch to it. void EmitCheck(llvm::Value *Checked, StringRef CheckName, - llvm::ArrayRef<llvm::Constant *> StaticArgs, - llvm::ArrayRef<llvm::Value *> DynamicArgs, + ArrayRef<llvm::Constant *> StaticArgs, + ArrayRef<llvm::Value *> DynamicArgs, CheckRecoverableKind Recoverable); /// \brief Create a basic block that will call the trap intrinsic, and emit a diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index db8e9a4c958..0257ce23f61 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -768,7 +768,7 @@ void CodeGenModule::EmitGlobalAnnotations() { gv->setSection(AnnotationSection); } -llvm::Constant *CodeGenModule::EmitAnnotationString(llvm::StringRef Str) { +llvm::Constant *CodeGenModule::EmitAnnotationString(StringRef Str) { llvm::StringMap<llvm::Constant*>::iterator i = AnnotationStrings.find(Str); if (i != AnnotationStrings.end()) return i->second; @@ -1820,7 +1820,7 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old, continue; // Get the call site's attribute list. - llvm::SmallVector<llvm::AttributeWithIndex, 8> newAttrs; + SmallVector<llvm::AttributeWithIndex, 8> newAttrs; llvm::AttributeSet oldAttrs = callSite.getAttributes(); // Collect any return attributes from the call. diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 98bc8881b02..34fa19c0108 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -860,7 +860,7 @@ public: void EmitGlobalAnnotations(); /// Emit an annotation string. - llvm::Constant *EmitAnnotationString(llvm::StringRef Str); + llvm::Constant *EmitAnnotationString(StringRef Str); /// Emit the annotation's translation unit. llvm::Constant *EmitAnnotationUnit(SourceLocation Loc); diff --git a/clang/lib/Driver/SanitizerArgs.h b/clang/lib/Driver/SanitizerArgs.h index 30a35b3f52a..09558890045 100644 --- a/clang/lib/Driver/SanitizerArgs.h +++ b/clang/lib/Driver/SanitizerArgs.h @@ -57,7 +57,7 @@ class SanitizerArgs { void addArgs(const ArgList &Args, ArgStringList &CmdArgs) const { if (!Kind) return; - llvm::SmallString<256> SanitizeOpt("-fsanitize="); + SmallString<256> SanitizeOpt("-fsanitize="); #define SANITIZER(NAME, ID) \ if (Kind & ID) \ SanitizeOpt += NAME ","; @@ -65,7 +65,7 @@ class SanitizerArgs { SanitizeOpt.pop_back(); CmdArgs.push_back(Args.MakeArgString(SanitizeOpt)); if (!BlacklistFile.empty()) { - llvm::SmallString<64> BlacklistOpt("-fsanitize-blacklist="); + SmallString<64> BlacklistOpt("-fsanitize-blacklist="); BlacklistOpt += BlacklistFile; CmdArgs.push_back(Args.MakeArgString(BlacklistOpt)); } diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 03a01e3402f..53a620a87e4 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1646,7 +1646,7 @@ StringRef Hexagon_TC::GetTargetCPU(const ArgList &Args) // Select the default CPU (v4) if none was given or detection failed. Arg *A = GetLastHexagonArchArg (Args); if (A) { - llvm::StringRef WhichHexagon = A->getValue(); + StringRef WhichHexagon = A->getValue(); if (WhichHexagon.startswith("hexagon")) return WhichHexagon.substr(sizeof("hexagon") - 1); if (WhichHexagon != "") diff --git a/clang/lib/Edit/EditedSource.cpp b/clang/lib/Edit/EditedSource.cpp index 4b7af242fe9..002776759fe 100644 --- a/clang/lib/Edit/EditedSource.cpp +++ b/clang/lib/Edit/EditedSource.cpp @@ -24,7 +24,7 @@ void EditsReceiver::remove(CharSourceRange range) { } StringRef EditedSource::copyString(const Twine &twine) { - llvm::SmallString<128> Data; + SmallString<128> Data; return copyString(twine.toStringRef(Data)); } @@ -89,7 +89,7 @@ bool EditedSource::commitInsertFromRange(SourceLocation OrigLoc, if (Len == 0) return true; - llvm::SmallString<128> StrVec; + SmallString<128> StrVec; FileOffset BeginOffs = InsertFromRangeOffs; FileOffset EndOffs = BeginOffs.getWithOffset(Len); FileEditsTy::iterator I = FileEdits.upper_bound(BeginOffs); @@ -332,7 +332,7 @@ static void applyRewrite(EditsReceiver &receiver, } void EditedSource::applyRewrites(EditsReceiver &receiver) { - llvm::SmallString<128> StrVec; + SmallString<128> StrVec; FileOffset CurOffs, CurEnd; unsigned CurLen; diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 83be79ea521..8ca0a823fe4 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1321,7 +1321,7 @@ public: I != E; ++I) { const UnwrappedLine &TheLine = *I; if (touchesRanges(TheLine)) { - llvm::OwningPtr<TokenAnnotator> AnnotatedLine( + OwningPtr<TokenAnnotator> AnnotatedLine( new TokenAnnotator(TheLine, Style, SourceMgr, Lex)); if (!AnnotatedLine->annotate()) break; @@ -1359,7 +1359,7 @@ private: /// /// Returns whether the resulting \c Line can fit in a single line. bool tryFitMultipleLinesInOne(unsigned Indent, UnwrappedLine &Line, - llvm::OwningPtr<TokenAnnotator> &AnnotatedLine, + OwningPtr<TokenAnnotator> &AnnotatedLine, std::vector<UnwrappedLine>::iterator &I, std::vector<UnwrappedLine>::iterator E) { unsigned Limit = Style.ColumnLimit - (I->InPPDirective ? 1 : 0) - Indent; @@ -1410,7 +1410,7 @@ private: return FitsOnALine; Last->Children.push_back(*Next); - llvm::OwningPtr<TokenAnnotator> CombinedAnnotator( + OwningPtr<TokenAnnotator> CombinedAnnotator( new TokenAnnotator(Combined, Style, SourceMgr, Lex)); if (CombinedAnnotator->annotate() && fitsIntoLimit(CombinedAnnotator->getRootToken(), Limit)) { @@ -1506,7 +1506,7 @@ tooling::Replacements reformat(const FormatStyle &Style, Lexer &Lex, TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), &*DiagOpts); DiagnosticPrinter.BeginSourceFile(Lex.getLangOpts(), Lex.getPP()); DiagnosticsEngine Diagnostics( - llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts, + IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts, &DiagnosticPrinter, false); Diagnostics.setSourceManager(&SourceMgr); Formatter formatter(Diagnostics, Style, Lex, SourceMgr, Ranges); diff --git a/clang/lib/Format/UnwrappedLineParser.h b/clang/lib/Format/UnwrappedLineParser.h index cfd0608ba2e..487e7019f7a 100644 --- a/clang/lib/Format/UnwrappedLineParser.h +++ b/clang/lib/Format/UnwrappedLineParser.h @@ -159,7 +159,7 @@ private: // FIXME: We are constantly running into bugs where Line.Level is incorrectly // subtracted from beyond 0. Introduce a method to subtract from Line.Level // and use that everywhere in the Parser. - llvm::OwningPtr<UnwrappedLine> Line; + OwningPtr<UnwrappedLine> Line; bool RootTokenInitialized; FormatToken *LastInCurrentLine; FormatToken FormatTok; diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp index 0fdd57df43a..687fc00c6c9 100644 --- a/clang/lib/Frontend/ASTConsumers.cpp +++ b/clang/lib/Frontend/ASTConsumers.cpp @@ -61,7 +61,7 @@ namespace { if (D != NULL && filterMatches(D)) { bool ShowColors = Out.has_colors(); if (ShowColors) - Out.changeColor(llvm::raw_ostream::BLUE); + Out.changeColor(raw_ostream::BLUE); Out << (Dump ? "Dumping " : "Printing ") << getName(D) << ":\n"; if (ShowColors) Out.resetColor(); diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 35a9aa4ff00..a958fd93d6c 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -155,7 +155,7 @@ static void removeOnDiskEntry(const ASTUnit *AU) { } } -static void setPreambleFile(const ASTUnit *AU, llvm::StringRef preambleFile) { +static void setPreambleFile(const ASTUnit *AU, StringRef preambleFile) { getOnDiskData(AU).PreambleFile = preambleFile; } diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 5b2be919677..057adbd10a8 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1108,7 +1108,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, if (!Sub) { // Attempt to perform typo correction to find a module name that works. - llvm::SmallVector<StringRef, 2> Best; + SmallVector<StringRef, 2> Best; unsigned BestEditDistance = (std::numeric_limits<unsigned>::max)(); for (clang::Module::submodule_iterator J = Module->submodule_begin(), diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8cb1d16931a..0f00c07ca93 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -70,7 +70,7 @@ static unsigned getOptimizationLevel(ArgList &Args, InputKind IK, assert (A->getOption().matches(options::OPT_O)); - llvm::StringRef S(A->getValue()); + StringRef S(A->getValue()); if (S == "s" || S == "z" || S.empty()) return 2; @@ -1495,7 +1495,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, namespace { class ModuleSignature { - llvm::SmallVector<uint64_t, 16> Data; + SmallVector<uint64_t, 16> Data; unsigned CurBit; uint64_t CurValue; diff --git a/clang/lib/Frontend/DependencyGraph.cpp b/clang/lib/Frontend/DependencyGraph.cpp index 0ecea6f2ee7..e128d91c408 100644 --- a/clang/lib/Frontend/DependencyGraph.cpp +++ b/clang/lib/Frontend/DependencyGraph.cpp @@ -31,15 +31,14 @@ class DependencyGraphCallback : public PPCallbacks { std::string OutputFile; std::string SysRoot; llvm::SetVector<const FileEntry *> AllFiles; - typedef llvm::DenseMap<const FileEntry *, - llvm::SmallVector<const FileEntry *, 2> > - DependencyMap; + typedef llvm::DenseMap<const FileEntry *, + SmallVector<const FileEntry *, 2> > DependencyMap; DependencyMap Dependencies; private: - llvm::raw_ostream &writeNodeReference(llvm::raw_ostream &OS, - const FileEntry *Node); + raw_ostream &writeNodeReference(raw_ostream &OS, + const FileEntry *Node); void OutputGraphFile(); public: @@ -93,8 +92,8 @@ void DependencyGraphCallback::InclusionDirective(SourceLocation HashLoc, AllFiles.insert(FromFile); } -llvm::raw_ostream & -DependencyGraphCallback::writeNodeReference(llvm::raw_ostream &OS, +raw_ostream & +DependencyGraphCallback::writeNodeReference(raw_ostream &OS, const FileEntry *Node) { OS << "header_" << Node->getUID(); return OS; diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index e5ac042da73..3b4f55c6c41 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/lib/Frontend/DiagnosticRenderer.cpp @@ -139,7 +139,7 @@ void DiagnosticRenderer::emitDiagnostic(SourceLocation Loc, SmallVector<CharSourceRange, 20> MutableRanges(Ranges.begin(), Ranges.end()); - llvm::SmallVector<FixItHint, 8> MergedFixits; + SmallVector<FixItHint, 8> MergedFixits; if (!FixItHints.empty()) { mergeFixits(FixItHints, *SM, LangOpts, MergedFixits); FixItHints = MergedFixits; diff --git a/clang/lib/Frontend/LayoutOverrideSource.cpp b/clang/lib/Frontend/LayoutOverrideSource.cpp index e0232503dfe..9309661972b 100644 --- a/clang/lib/Frontend/LayoutOverrideSource.cpp +++ b/clang/lib/Frontend/LayoutOverrideSource.cpp @@ -26,7 +26,7 @@ static std::string parseName(StringRef S) { return S.substr(0, Offset).str(); } -LayoutOverrideSource::LayoutOverrideSource(llvm::StringRef Filename) { +LayoutOverrideSource::LayoutOverrideSource(StringRef Filename) { std::ifstream Input(Filename.str().c_str()); if (!Input.is_open()) return; @@ -188,7 +188,7 @@ LayoutOverrideSource::layoutRecordType(const RecordDecl *Record, } void LayoutOverrideSource::dump() { - llvm::raw_ostream &OS = llvm::errs(); + raw_ostream &OS = llvm::errs(); for (llvm::StringMap<Layout>::iterator L = Layouts.begin(), LEnd = Layouts.end(); L != LEnd; ++L) { diff --git a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index 26915e5f771..8eb0e40b01b 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -44,8 +44,8 @@ public: } }; -typedef llvm::SmallVector<uint64_t, 64> RecordData; -typedef llvm::SmallVectorImpl<uint64_t> RecordDataImpl; +typedef SmallVector<uint64_t, 64> RecordData; +typedef SmallVectorImpl<uint64_t> RecordDataImpl; class SDiagsWriter; @@ -92,11 +92,11 @@ class SDiagsWriter : public DiagnosticConsumer { struct SharedState; - explicit SDiagsWriter(llvm::IntrusiveRefCntPtr<SharedState> State) + explicit SDiagsWriter(IntrusiveRefCntPtr<SharedState> State) : LangOpts(0), OriginalInstance(false), State(State) { } public: - SDiagsWriter(llvm::raw_ostream *os, DiagnosticOptions *diags) + SDiagsWriter(raw_ostream *os, DiagnosticOptions *diags) : LangOpts(0), OriginalInstance(true), State(new SharedState(os, diags)) { EmitPreamble(); @@ -190,12 +190,12 @@ private: /// \brief State that is shared among the various clones of this diagnostic /// consumer. - struct SharedState : llvm::RefCountedBase<SharedState> { - SharedState(llvm::raw_ostream *os, DiagnosticOptions *diags) + struct SharedState : RefCountedBase<SharedState> { + SharedState(raw_ostream *os, DiagnosticOptions *diags) : DiagOpts(diags), Stream(Buffer), OS(os), EmittedAnyDiagBlocks(false) { } /// \brief Diagnostic options. - llvm::IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; /// \brief The byte buffer for the serialized content. SmallString<1024> Buffer; @@ -204,7 +204,7 @@ private: llvm::BitstreamWriter Stream; /// \brief The name of the diagnostics file. - OwningPtr<llvm::raw_ostream> OS; + OwningPtr<raw_ostream> OS; /// \brief The set of constructed record abbreviations. AbbreviationMap Abbrevs; @@ -221,7 +221,7 @@ private: /// \brief The collection of files used. llvm::DenseMap<const char *, unsigned> Files; - typedef llvm::DenseMap<const void *, std::pair<unsigned, llvm::StringRef> > + typedef llvm::DenseMap<const void *, std::pair<unsigned, StringRef> > DiagFlagsTy; /// \brief Map for uniquing strings. @@ -234,14 +234,13 @@ private: }; /// \brief State shared among the various clones of this diagnostic consumer. - llvm::IntrusiveRefCntPtr<SharedState> State; + IntrusiveRefCntPtr<SharedState> State; }; } // end anonymous namespace namespace clang { namespace serialized_diags { -DiagnosticConsumer *create(llvm::raw_ostream *OS, - DiagnosticOptions *diags) { +DiagnosticConsumer *create(raw_ostream *OS, DiagnosticOptions *diags) { return new SDiagsWriter(OS, diags); } } // end namespace serialized_diags diff --git a/clang/lib/Frontend/Warnings.cpp b/clang/lib/Frontend/Warnings.cpp index 0d678ad53f3..b4c6b0bd735 100644 --- a/clang/lib/Frontend/Warnings.cpp +++ b/clang/lib/Frontend/Warnings.cpp @@ -75,7 +75,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags, else Diags.setExtensionHandlingBehavior(DiagnosticsEngine::Ext_Ignore); - llvm::SmallVector<diag::kind, 10> _Diags; + SmallVector<diag::kind, 10> _Diags; const IntrusiveRefCntPtr< DiagnosticIDs > DiagIDs = Diags.getDiagnosticIDs(); // We parse the warning options twice. The first pass sets diagnostic state, diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 7363afc771c..4982ce4ac08 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -39,7 +39,7 @@ HeaderFileInfo::getControllingMacro(ExternalIdentifierLookup *External) { ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {} -HeaderSearch::HeaderSearch(llvm::IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts, +HeaderSearch::HeaderSearch(IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts, FileManager &FM, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target) @@ -889,7 +889,7 @@ StringRef HeaderSearch::getUniqueFrameworkName(StringRef Framework) { bool HeaderSearch::hasModuleMap(StringRef FileName, const DirectoryEntry *Root) { - llvm::SmallVector<const DirectoryEntry *, 2> FixUpDirectories; + SmallVector<const DirectoryEntry *, 2> FixUpDirectories; StringRef DirName = FileName; do { @@ -979,7 +979,7 @@ Module *HeaderSearch::loadFrameworkModule(StringRef Name, // Figure out the top-level framework directory and the submodule path from // that top-level framework to the requested framework. - llvm::SmallVector<std::string, 2> SubmodulePath; + SmallVector<std::string, 2> SubmodulePath; SubmodulePath.push_back(Name); const DirectoryEntry *TopFrameworkDir = ::getTopFrameworkDir(FileMgr, Dir->getName(), SubmodulePath); @@ -1055,7 +1055,7 @@ HeaderSearch::loadModuleMapFile(const DirectoryEntry *Dir) { return LMM_InvalidModuleMap; } -void HeaderSearch::collectAllModules(llvm::SmallVectorImpl<Module *> &Modules) { +void HeaderSearch::collectAllModules(SmallVectorImpl<Module *> &Modules) { Modules.clear(); // Load module maps for each of the header search directories. diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index 15b1061d057..2bd95ab1d79 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -1328,7 +1328,7 @@ SourceLocation Lexer::findLocationAfterToken(SourceLocation Loc, // Try to load the file buffer. bool InvalidTemp = false; - llvm::StringRef File = SM.getBufferData(LocInfo.first, &InvalidTemp); + StringRef File = SM.getBufferData(LocInfo.first, &InvalidTemp); if (InvalidTemp) return SourceLocation(); diff --git a/clang/lib/Lex/MacroArgs.cpp b/clang/lib/Lex/MacroArgs.cpp index 84c6caefdb8..e36596f2af3 100644 --- a/clang/lib/Lex/MacroArgs.cpp +++ b/clang/lib/Lex/MacroArgs.cpp @@ -23,7 +23,7 @@ using namespace clang; /// MacroArgs ctor function - This destroys the vector passed in. MacroArgs *MacroArgs::create(const MacroInfo *MI, - llvm::ArrayRef<Token> UnexpArgTokens, + ArrayRef<Token> UnexpArgTokens, bool VarargsElided, Preprocessor &PP) { assert(MI->isFunctionLike() && "Can't have args for an object-like macro!"); diff --git a/clang/lib/Lex/MacroArgs.h b/clang/lib/Lex/MacroArgs.h index 956c8a92975..1fd295ebfa9 100644 --- a/clang/lib/Lex/MacroArgs.h +++ b/clang/lib/Lex/MacroArgs.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_MACROARGS_H #define LLVM_CLANG_MACROARGS_H +#include "clang/Basic/LLVM.h" #include "llvm/ADT/ArrayRef.h" #include <vector> @@ -59,7 +60,7 @@ public: /// MacroArgs ctor function - Create a new MacroArgs object with the specified /// macro and argument info. static MacroArgs *create(const MacroInfo *MI, - llvm::ArrayRef<Token> UnexpArgTokens, + ArrayRef<Token> UnexpArgTokens, bool VarargsElided, Preprocessor &PP); /// destroy - Destroy and deallocate the memory for this object. diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index b2e49ea50e9..d954bc9fc27 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -157,7 +157,7 @@ Module *ModuleMap::findModuleForHeader(const FileEntry *File) { } const DirectoryEntry *Dir = File->getDir(); - llvm::SmallVector<const DirectoryEntry *, 2> SkippedDirs; + SmallVector<const DirectoryEntry *, 2> SkippedDirs; #ifdef LLVM_ON_UNIX // Note: as an egregious but useful hack we use the real path here, because // frameworks moving from top-level frameworks to embedded frameworks tend @@ -260,7 +260,7 @@ bool ModuleMap::isHeaderInUnavailableModule(const FileEntry *Header) { return !Known->second.isAvailable(); const DirectoryEntry *Dir = Header->getDir(); - llvm::SmallVector<const DirectoryEntry *, 2> SkippedDirs; + SmallVector<const DirectoryEntry *, 2> SkippedDirs; StringRef DirName = Dir->getName(); // Keep walking up the directory hierarchy, looking for a directory with @@ -725,8 +725,7 @@ namespace clang { /// (or the end of the file). void skipUntil(MMToken::TokenKind K); - typedef llvm::SmallVector<std::pair<std::string, SourceLocation>, 2> - ModuleId; + typedef SmallVector<std::pair<std::string, SourceLocation>, 2> ModuleId; bool parseModuleId(ModuleId &Id); void parseModuleDecl(); void parseRequiresDecl(); @@ -1184,9 +1183,9 @@ void ModuleMapParser::parseRequiresDecl() { /// \brief Append to \p Paths the set of paths needed to get to the /// subframework in which the given module lives. static void appendSubframeworkPaths(Module *Mod, - llvm::SmallVectorImpl<char> &Path) { + SmallVectorImpl<char> &Path) { // Collect the framework names from the given module to the top-level module. - llvm::SmallVector<StringRef, 2> Paths; + SmallVector<StringRef, 2> Paths; for (; Mod; Mod = Mod->Parent) { if (Mod->IsFramework) Paths.push_back(Mod->Name); diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index edf91a9d565..6796f1c21bb 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1426,7 +1426,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Compute the module access path corresponding to this module. // FIXME: Should we have a second loadModule() overload to avoid this // extra lookup step? - llvm::SmallVector<std::pair<IdentifierInfo *, SourceLocation>, 2> Path; + SmallVector<std::pair<IdentifierInfo *, SourceLocation>, 2> Path; for (Module *Mod = SuggestedModule; Mod; Mod = Mod->Parent) Path.push_back(std::make_pair(getIdentifierInfo(Mod->Name), FilenameTok.getLocation())); diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 1b8fcbac331..eb08977ee67 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1355,7 +1355,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // We construct a SmallVector here to talk to getDiagnosticIDs(). // Although we don't use the result, this isn't a hot path, and not // worth special casing. - llvm::SmallVector<diag::kind, 10> Diags; + SmallVector<diag::kind, 10> Diags; Value = !getDiagnostics().getDiagnosticIDs()-> getDiagnosticsInGroup(WarningName.substr(2), Diags); } while (false); diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index df2c98dd8ea..9ce4874f63f 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -53,7 +53,7 @@ ExternalPreprocessorSource::~ExternalPreprocessorSource() { } PPMutationListener::~PPMutationListener() { } -Preprocessor::Preprocessor(llvm::IntrusiveRefCntPtr<PreprocessorOptions> PPOpts, +Preprocessor::Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> PPOpts, DiagnosticsEngine &diags, LangOptions &opts, const TargetInfo *target, SourceManager &SM, HeaderSearch &Headers, ModuleLoader &TheModuleLoader, @@ -293,7 +293,7 @@ Preprocessor::macro_end(bool IncludeExternalMacros) const { /// \brief Compares macro tokens with a specified token value sequence. static bool MacroDefinitionEquals(const MacroInfo *MI, - llvm::ArrayRef<TokenValue> Tokens) { + ArrayRef<TokenValue> Tokens) { return Tokens.size() == MI->getNumTokens() && std::equal(Tokens.begin(), Tokens.end(), MI->tokens_begin()); } diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index e26fbd20cd6..bd79e56b099 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -970,7 +970,7 @@ void Parser::ParseLexedAttribute(LateParsedAttribute &LA, /// \brief Wrapper around a case statement checking if AttrName is /// one of the thread safety attributes -bool Parser::IsThreadSafetyAttribute(llvm::StringRef AttrName){ +bool Parser::IsThreadSafetyAttribute(StringRef AttrName) { return llvm::StringSwitch<bool>(AttrName) .Case("guarded_by", true) .Case("guarded_var", true) diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 64e529bafe3..7fe49fd995b 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -3016,7 +3016,7 @@ IdentifierInfo *Parser::TryParseCXX11AttributeIdentifier(SourceLocation &Loc) { case tok::exclaimequal: // 'not_eq' // Alternative tokens do not have identifier info, but their spelling // starts with an alphabetical character. - llvm::SmallString<8> SpellingBuf; + SmallString<8> SpellingBuf; StringRef Spelling = PP.getSpelling(Tok.getLocation(), SpellingBuf); if (std::isalpha(Spelling[0])) { Loc = ConsumeToken(); diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index 641d0c7c7d6..d6d38c758ae 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1404,7 +1404,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { if (Tok.is(tok::code_completion)) { Actions.CodeCompleteCall(getCurScope(), LHS.get(), - llvm::ArrayRef<Expr *>()); + ArrayRef<Expr *>()); cutOffParsing(); return ExprError(); } @@ -2305,10 +2305,10 @@ ExprResult Parser::ParseGenericSelectionExpression() { /// [C++0x] braced-init-list /// \endverbatim bool Parser::ParseExpressionList(SmallVectorImpl<Expr*> &Exprs, - SmallVectorImpl<SourceLocation> &CommaLocs, - void (Sema::*Completer)(Scope *S, - Expr *Data, - llvm::ArrayRef<Expr *> Args), + SmallVectorImpl<SourceLocation> &CommaLocs, + void (Sema::*Completer)(Scope *S, + Expr *Data, + ArrayRef<Expr *> Args), Expr *Data) { while (1) { if (Tok.is(tok::code_completion)) { diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index 94b5dbad49f..45020fb2892 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -806,7 +806,7 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( // Parse parameter-declaration-clause. ParsedAttributes Attr(AttrFactory); - llvm::SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; + SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo; SourceLocation EllipsisLoc; if (Tok.isNot(tok::r_paren)) @@ -826,8 +826,8 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( // Parse exception-specification[opt]. ExceptionSpecificationType ESpecType = EST_None; SourceRange ESpecRange; - llvm::SmallVector<ParsedType, 2> DynamicExceptions; - llvm::SmallVector<SourceRange, 2> DynamicExceptionRanges; + SmallVector<ParsedType, 2> DynamicExceptions; + SmallVector<SourceRange, 2> DynamicExceptionRanges; ExprResult NoexceptExpr; ESpecType = tryParseExceptionSpecification(ESpecRange, DynamicExceptions, @@ -1936,8 +1936,8 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext, // We're past translation phase 6, so perform string literal concatenation // before checking for "". - llvm::SmallVector<Token, 4> Toks; - llvm::SmallVector<SourceLocation, 4> TokLocs; + SmallVector<Token, 4> Toks; + SmallVector<SourceLocation, 4> TokLocs; while (isTokenStringLiteral()) { if (!Tok.is(tok::string_literal) && !DiagId) { // C++11 [over.literal]p1: @@ -1986,7 +1986,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext, if (DiagId) { // This isn't a valid literal-operator-id, but we think we know // what the user meant. Tell them what they should have written. - llvm::SmallString<32> Str; + SmallString<32> Str; Str += "\"\" "; Str += II->getName(); Diag(DiagLoc, DiagId) << FixItHint::CreateReplacement( @@ -2659,7 +2659,7 @@ ExprResult Parser::ParseTypeTrait() { if (Parens.expectAndConsume(diag::err_expected_lparen)) return ExprError(); - llvm::SmallVector<ParsedType, 2> Args; + SmallVector<ParsedType, 2> Args; do { // Parse the next type. TypeResult Ty = ParseTypeName(); diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index cc0d1d2fd1a..759ab7f60cd 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1830,7 +1830,7 @@ Parser::DeclGroupPtrTy Parser::ParseModuleImport(SourceLocation AtLoc) { "Improper start to module import"); SourceLocation ImportLoc = ConsumeToken(); - llvm::SmallVector<std::pair<IdentifierInfo *, SourceLocation>, 2> Path; + SmallVector<std::pair<IdentifierInfo *, SourceLocation>, 2> Path; // Parse the module path. do { diff --git a/clang/lib/Rewrite/Core/Rewriter.cpp b/clang/lib/Rewrite/Core/Rewriter.cpp index 6fad5dd515a..c1c6595d162 100644 --- a/clang/lib/Rewrite/Core/Rewriter.cpp +++ b/clang/lib/Rewrite/Core/Rewriter.cpp @@ -464,7 +464,7 @@ public: } bool ok() { return FileStream; } - llvm::raw_ostream &getStream() { return *FileStream; } + raw_ostream &getStream() { return *FileStream; } private: DiagnosticsEngine &Diagnostics; diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index a113fec39ab..d69106cfb0f 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -117,7 +117,7 @@ namespace { SmallVector<ObjCInterfaceDecl*, 8> DefinedNonLazyClasses; /// DefinedNonLazyCategories - List of defined "non-lazy" categories. - llvm::SmallVector<ObjCCategoryDecl*, 8> DefinedNonLazyCategories; + SmallVector<ObjCCategoryDecl *, 8> DefinedNonLazyCategories; SmallVector<Stmt *, 32> Stmts; SmallVector<int, 8> ObjCBcLabelNo; @@ -284,7 +284,7 @@ namespace { void ConvertSourceLocationToLineDirective(SourceLocation Loc, std::string &LineString); void RewriteForwardClassDecl(DeclGroupRef D); - void RewriteForwardClassDecl(const llvm::SmallVector<Decl*, 8> &DG); + void RewriteForwardClassDecl(const SmallVector<Decl *, 8> &DG); void RewriteForwardClassEpilogue(ObjCInterfaceDecl *ClassDecl, const std::string &typedefString); void RewriteImplementations(); @@ -302,7 +302,7 @@ namespace { void RewriteCategoryDecl(ObjCCategoryDecl *Dcl); void RewriteProtocolDecl(ObjCProtocolDecl *Dcl); void RewriteForwardProtocolDecl(DeclGroupRef D); - void RewriteForwardProtocolDecl(const llvm::SmallVector<Decl*, 8> &DG); + void RewriteForwardProtocolDecl(const SmallVector<Decl *, 8> &DG); void RewriteMethodDeclaration(ObjCMethodDecl *Method); void RewriteProperty(ObjCPropertyDecl *prop); void RewriteFunctionDecl(FunctionDecl *FD); @@ -1037,7 +1037,7 @@ void RewriteModernObjC::RewriteForwardClassDecl(DeclGroupRef D) { } void RewriteModernObjC::RewriteForwardClassDecl( - const llvm::SmallVector<Decl*, 8> &D) { + const SmallVector<Decl *, 8> &D) { std::string typedefString; for (unsigned i = 0; i < D.size(); i++) { ObjCInterfaceDecl *ForwardDecl = cast<ObjCInterfaceDecl>(D[i]); @@ -1155,7 +1155,7 @@ void RewriteModernObjC::RewriteForwardProtocolDecl(DeclGroupRef D) { } void -RewriteModernObjC::RewriteForwardProtocolDecl(const llvm::SmallVector<Decl*, 8> &DG) { +RewriteModernObjC::RewriteForwardProtocolDecl(const SmallVector<Decl *, 8> &DG) { SourceLocation LocStart = DG[0]->getLocStart(); if (LocStart.isInvalid()) llvm_unreachable("Invalid SourceLocation"); diff --git a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp index e78bd6d356d..23719cb3457 100644 --- a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp @@ -266,7 +266,7 @@ namespace { void RewriteRecordBody(RecordDecl *RD); void RewriteInclude(); void RewriteForwardClassDecl(DeclGroupRef D); - void RewriteForwardClassDecl(const llvm::SmallVector<Decl*, 8> &DG); + void RewriteForwardClassDecl(const SmallVector<Decl *, 8> &DG); void RewriteForwardClassEpilogue(ObjCInterfaceDecl *ClassDecl, const std::string &typedefString); void RewriteImplementations(); @@ -284,7 +284,7 @@ namespace { void RewriteCategoryDecl(ObjCCategoryDecl *Dcl); void RewriteProtocolDecl(ObjCProtocolDecl *Dcl); void RewriteForwardProtocolDecl(DeclGroupRef D); - void RewriteForwardProtocolDecl(const llvm::SmallVector<Decl*, 8> &DG); + void RewriteForwardProtocolDecl(const SmallVector<Decl *, 8> &DG); void RewriteMethodDeclaration(ObjCMethodDecl *Method); void RewriteProperty(ObjCPropertyDecl *prop); void RewriteFunctionDecl(FunctionDecl *FD); @@ -926,8 +926,7 @@ void RewriteObjC::RewriteForwardClassDecl(DeclGroupRef D) { RewriteForwardClassEpilogue(cast<ObjCInterfaceDecl>(*I), typedefString); } -void RewriteObjC::RewriteForwardClassDecl( - const llvm::SmallVector<Decl*, 8> &D) { +void RewriteObjC::RewriteForwardClassDecl(const SmallVector<Decl *, 8> &D) { std::string typedefString; for (unsigned i = 0; i < D.size(); i++) { ObjCInterfaceDecl *ForwardDecl = cast<ObjCInterfaceDecl>(D[i]); @@ -1039,7 +1038,7 @@ void RewriteObjC::RewriteForwardProtocolDecl(DeclGroupRef D) { } void -RewriteObjC::RewriteForwardProtocolDecl(const llvm::SmallVector<Decl*, 8> &DG) { +RewriteObjC::RewriteForwardProtocolDecl(const SmallVector<Decl *, 8> &DG) { SourceLocation LocStart = DG[0]->getLocStart(); if (LocStart.isInvalid()) llvm_unreachable("Invalid SourceLocation"); diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp index 9717c0887a6..ba23467931f 100644 --- a/clang/lib/Sema/AnalysisBasedWarnings.cpp +++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp @@ -1198,7 +1198,7 @@ private: //===----------------------------------------------------------------------===// namespace clang { namespace thread_safety { -typedef llvm::SmallVector<PartialDiagnosticAt, 1> OptionalNotes; +typedef SmallVector<PartialDiagnosticAt, 1> OptionalNotes; typedef std::pair<PartialDiagnosticAt, OptionalNotes> DelayedDiag; typedef std::list<DelayedDiag> DiagList; diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp index 3b10b4378a3..85fc4ee711b 100644 --- a/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/clang/lib/Sema/CodeCompleteConsumer.cpp @@ -283,7 +283,7 @@ StringRef CodeCompletionTUInfo::getParentName(DeclContext *DC) { return StringRef(); // Find the interesting names. - llvm::SmallVector<DeclContext *, 2> Contexts; + SmallVector<DeclContext *, 2> Contexts; while (DC && !DC->isFunctionOrMethod()) { if (NamedDecl *ND = dyn_cast<NamedDecl>(DC)) { if (ND->getIdentifier()) @@ -294,7 +294,7 @@ StringRef CodeCompletionTUInfo::getParentName(DeclContext *DC) { } { - llvm::SmallString<128> S; + SmallString<128> S; llvm::raw_svector_ostream OS(S); bool First = true; for (unsigned I = Contexts.size(); I != 0; --I) { diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 8f9e1a9a0f9..82d2811f3a3 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -601,7 +601,7 @@ void Sema::ActOnEndOfTranslationUnit() { if (Module *CurrentModule = PP.getCurrentModule()) { ModuleMap &ModMap = PP.getHeaderSearchInfo().getModuleMap(); - llvm::SmallVector<Module *, 2> Stack; + SmallVector<Module *, 2> Stack; Stack.push_back(CurrentModule); while (!Stack.empty()) { Module *Mod = Stack.back(); diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 8d7a3409526..5d5226dddd8 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -3093,7 +3093,7 @@ void Sema::CodeCompleteModuleImport(SourceLocation ImportLoc, typedef CodeCompletionResult Result; if (Path.empty()) { // Enumerate all top-level modules. - llvm::SmallVector<Module *, 8> Modules; + SmallVector<Module *, 8> Modules; PP.getHeaderSearchInfo().collectAllModules(Modules); for (unsigned I = 0, N = Modules.size(); I != N; ++I) { Builder.AddTypedTextChunk( diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b9d141bc351..668b8f81032 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3462,7 +3462,7 @@ static QualType getCoreType(QualType Ty) { static bool hasSimilarParameters(ASTContext &Context, FunctionDecl *Declaration, FunctionDecl *Definition, - llvm::SmallVectorImpl<unsigned> &Params) { + SmallVectorImpl<unsigned> &Params) { Params.clear(); if (Declaration->param_size() != Definition->param_size()) return false; @@ -4972,7 +4972,7 @@ class DifferentNameValidatorCCC : public CorrectionCandidateCallback { if (candidate.getEditDistance() == 0) return false; - llvm::SmallVector<unsigned, 1> MismatchedParams; + SmallVector<unsigned, 1> MismatchedParams; for (TypoCorrection::const_decl_iterator CDecl = candidate.begin(), CDeclEnd = candidate.end(); CDecl != CDeclEnd; ++CDecl) { @@ -5018,8 +5018,8 @@ static NamedDecl* DiagnoseInvalidRedeclaration( DeclContext *NewDC = NewFD->getDeclContext(); LookupResult Prev(SemaRef, Name, NewFD->getLocation(), Sema::LookupOrdinaryName, Sema::ForRedeclaration); - llvm::SmallVector<unsigned, 1> MismatchedParams; - llvm::SmallVector<std::pair<FunctionDecl*, unsigned>, 1> NearMatches; + SmallVector<unsigned, 1> MismatchedParams; + SmallVector<std::pair<FunctionDecl *, unsigned>, 1> NearMatches; TypoCorrection Correction; bool isFriendDecl = (SemaRef.getLangOpts().CPlusPlus && ExtraArgs.D.getDeclSpec().isFriendSpecified()); @@ -5123,7 +5123,7 @@ static NamedDecl* DiagnoseInvalidRedeclaration( if (CXXMethodDecl *NewMD = dyn_cast<CXXMethodDecl>(NewFD)) NewFDisConst = NewMD->isConst(); - for (llvm::SmallVector<std::pair<FunctionDecl*, unsigned>, 1>::iterator + for (SmallVector<std::pair<FunctionDecl *, unsigned>, 1>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) { FunctionDecl *FD = NearMatch->first; @@ -7371,7 +7371,7 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { << Init->getSourceRange(); if (var->isConstexpr()) { - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; if (!var->evaluateValue(Notes) || !var->isInitICE()) { SourceLocation DiagLoc = var->getLocation(); // If the note doesn't add any useful information other than a source @@ -10807,8 +10807,8 @@ static void CheckForDuplicateEnumValues(Sema &S, Decl **Elements, if (Enum->getNumPositiveBits() > 63 || Enum->getNumNegativeBits() > 64) return; - typedef llvm::SmallVector<EnumConstantDecl*, 3> ECDVector; - typedef llvm::SmallVector<ECDVector*, 3> DuplicatesVector; + typedef SmallVector<EnumConstantDecl *, 3> ECDVector; + typedef SmallVector<ECDVector *, 3> DuplicatesVector; typedef llvm::PointerUnion<EnumConstantDecl*, ECDVector*> DeclOrVector; typedef llvm::DenseMap<DupKey, DeclOrVector, DenseMapInfoDupKey> @@ -11149,7 +11149,7 @@ DeclResult Sema::ActOnModuleImport(SourceLocation AtLoc, if (!Mod) return true; - llvm::SmallVector<SourceLocation, 2> IdentifierLocs; + SmallVector<SourceLocation, 2> IdentifierLocs; Module *ModCheck = Mod; for (unsigned I = 0, N = Path.size(); I != N; ++I) { // If we've run out of module parents, just drop the remaining identifiers. diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 77756c3a5ce..d6d6ca7e887 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -883,7 +883,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { // - its function-body shall be [...] a compound-statement that contains only CompoundStmt *CompBody = cast<CompoundStmt>(Body); - llvm::SmallVector<SourceLocation, 4> ReturnStmts; + SmallVector<SourceLocation, 4> ReturnStmts; for (CompoundStmt::body_iterator BodyIt = CompBody->body_begin(), BodyEnd = CompBody->body_end(); BodyIt != BodyEnd; ++BodyIt) { switch ((*BodyIt)->getStmtClass()) { @@ -993,7 +993,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { // C++11 [dcl.constexpr]p4: // - every constructor involved in initializing non-static data members and // base class sub-objects shall be a constexpr constructor. - llvm::SmallVector<PartialDiagnosticAt, 8> Diags; + SmallVector<PartialDiagnosticAt, 8> Diags; if (!Expr::isPotentialConstantExpr(Dcl, Diags)) { Diag(Dcl->getLocation(), diag::ext_constexpr_function_never_constant_expr) << isa<CXXConstructorDecl>(Dcl); @@ -10257,7 +10257,7 @@ Decl *Sema::BuildStaticAssertDeclaration(SourceLocation StaticAssertLoc, Failed = true; if (!Failed && !Cond) { - llvm::SmallString<256> MsgBuffer; + SmallString<256> MsgBuffer; llvm::raw_svector_ostream Msg(MsgBuffer); AssertMessage->printPretty(Msg, 0, getPrintingPolicy()); Diag(StaticAssertLoc, diag::err_static_assert_failed) @@ -11651,7 +11651,7 @@ Sema::checkExceptionSpecification(ExceptionSpecificationType EST, ArrayRef<ParsedType> DynamicExceptions, ArrayRef<SourceRange> DynamicExceptionRanges, Expr *NoexceptExpr, - llvm::SmallVectorImpl<QualType> &Exceptions, + SmallVectorImpl<QualType> &Exceptions, FunctionProtoType::ExtProtoInfo &EPI) { Exceptions.clear(); EPI.ExceptionSpecType = EST; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 96196e06931..d935fee7fe0 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -10115,7 +10115,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, } Expr::EvalResult EvalResult; - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; EvalResult.Diag = &Notes; // Try to evaluate the expression, and produce diagnostics explaining why it's diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 5cd1c21604e..f4f2c1c23ad 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3365,8 +3365,8 @@ static bool evaluateTypeTrait(Sema &S, TypeTrait Kind, SourceLocation KWLoc, if (SawVoid) return false; - llvm::SmallVector<OpaqueValueExpr, 2> OpaqueArgExprs; - llvm::SmallVector<Expr *, 2> ArgExprs; + SmallVector<OpaqueValueExpr, 2> OpaqueArgExprs; + SmallVector<Expr *, 2> ArgExprs; ArgExprs.reserve(Args.size() - 1); for (unsigned I = 1, N = Args.size(); I != N; ++I) { QualType T = Args[I]->getType(); @@ -3433,7 +3433,7 @@ ExprResult Sema::BuildTypeTrait(TypeTrait Kind, SourceLocation KWLoc, ExprResult Sema::ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc, ArrayRef<ParsedType> Args, SourceLocation RParenLoc) { - llvm::SmallVector<TypeSourceInfo *, 4> ConvertedArgs; + SmallVector<TypeSourceInfo *, 4> ConvertedArgs; ConvertedArgs.reserve(Args.size()); for (unsigned I = 0, N = Args.size(); I != N; ++I) { diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 8ba14d51ccf..43e0c05c93c 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -55,7 +55,7 @@ CXXMethodDecl *Sema::startLambdaDefinition(CXXRecordDecl *Class, SourceRange IntroducerRange, TypeSourceInfo *MethodType, SourceLocation EndLoc, - llvm::ArrayRef<ParmVarDecl *> Params) { + ArrayRef<ParmVarDecl *> Params) { // C++11 [expr.prim.lambda]p5: // The closure type for a lambda-expression has a public inline function // call operator (13.5.4) whose parameters and return type are described by @@ -376,7 +376,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, bool ExplicitResultType = true; bool ContainsUnexpandedParameterPack = false; SourceLocation EndLoc; - llvm::SmallVector<ParmVarDecl *, 8> Params; + SmallVector<ParmVarDecl *, 8> Params; if (ParamInfo.getNumTypeObjects() == 0) { // C++11 [expr.prim.lambda]p4: // If a lambda-expression does not include a lambda-declarator, it is as @@ -449,7 +449,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, // Handle explicit captures. SourceLocation PrevCaptureLoc = Intro.Default == LCD_None? Intro.Range.getBegin() : Intro.DefaultLoc; - for (llvm::SmallVector<LambdaCapture, 4>::const_iterator + for (SmallVector<LambdaCapture, 4>::const_iterator C = Intro.Captures.begin(), E = Intro.Captures.end(); C != E; @@ -734,8 +734,8 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, Scope *CurScope, bool IsInstantiation) { // Collect information from the lambda scope. - llvm::SmallVector<LambdaExpr::Capture, 4> Captures; - llvm::SmallVector<Expr *, 4> CaptureInits; + SmallVector<LambdaExpr::Capture, 4> Captures; + SmallVector<Expr *, 4> CaptureInits; LambdaCaptureDefault CaptureDefault; CXXRecordDecl *Class; CXXMethodDecl *CallOperator; @@ -744,8 +744,8 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, bool ExplicitResultType; bool LambdaExprNeedsCleanups; bool ContainsUnexpandedParameterPack; - llvm::SmallVector<VarDecl *, 4> ArrayIndexVars; - llvm::SmallVector<unsigned, 4> ArrayIndexStarts; + SmallVector<VarDecl *, 4> ArrayIndexVars; + SmallVector<unsigned, 4> ArrayIndexStarts; { LambdaScopeInfo *LSI = getCurLambda(); CallOperator = LSI->CallOperator; diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index be021d7d183..fdd33cf73ae 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -3130,7 +3130,7 @@ LabelDecl *Sema::LookupOrCreateLabel(IdentifierInfo *II, SourceLocation Loc, namespace { -typedef llvm::SmallVector<TypoCorrection, 1> TypoResultList; +typedef SmallVector<TypoCorrection, 1> TypoResultList; typedef llvm::StringMap<TypoResultList, llvm::BumpPtrAllocator> TypoResultsMap; typedef std::map<unsigned, TypoResultsMap> TypoEditDistanceMap; @@ -3864,7 +3864,7 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, // Weed out any names that could not be found by name lookup or, if a // CorrectionCandidateCallback object was provided, failed validation. - llvm::SmallVector<TypoCorrection, 16> QualifiedResults; + SmallVector<TypoCorrection, 16> QualifiedResults; LookupResult TmpRes(*this, TypoName, LookupKind); TmpRes.suppressDiagnostics(); while (!Consumer.empty()) { @@ -3966,9 +3966,9 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, // Only perform the qualified lookups for C++ if (SearchNamespaces) { TmpRes.suppressDiagnostics(); - for (llvm::SmallVector<TypoCorrection, - 16>::iterator QRI = QualifiedResults.begin(), - QRIEnd = QualifiedResults.end(); + for (SmallVector<TypoCorrection, + 16>::iterator QRI = QualifiedResults.begin(), + QRIEnd = QualifiedResults.end(); QRI != QRIEnd; ++QRI) { for (NamespaceSpecifierSet::iterator NI = Namespaces.begin(), NIEnd = Namespaces.end(); diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 44ff3a505e4..cfabccf5fe3 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -4955,7 +4955,7 @@ ExprResult Sema::CheckConvertedConstantExpression(Expr *From, QualType T, } // Check the expression is a constant expression. - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; Expr::EvalResult Eval; Eval.Diag = &Notes; @@ -5246,7 +5246,7 @@ Sema::ConvertToIntegralOrEnumerationType(SourceLocation Loc, Expr *From, void Sema::AddOverloadCandidate(FunctionDecl *Function, DeclAccessPair FoundDecl, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions, bool PartialOverloading, @@ -5369,7 +5369,7 @@ Sema::AddOverloadCandidate(FunctionDecl *Function, /// \brief Add all of the function declarations in the given function set to /// the overload canddiate set. void Sema::AddFunctionCandidates(const UnresolvedSetImpl &Fns, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions, TemplateArgumentListInfo *ExplicitTemplateArgs) { @@ -5444,7 +5444,7 @@ void Sema::AddMethodCandidate(CXXMethodDecl *Method, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, QualType ObjectType, Expr::Classification ObjectClassification, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions) { const FunctionProtoType* Proto @@ -5548,7 +5548,7 @@ Sema::AddMethodTemplateCandidate(FunctionTemplateDecl *MethodTmpl, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ObjectType, Expr::Classification ObjectClassification, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions) { if (!CandidateSet.isNewCandidate(MethodTmpl)) @@ -5598,7 +5598,7 @@ void Sema::AddTemplateOverloadCandidate(FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet, bool SuppressUserConversions) { if (!CandidateSet.isNewCandidate(FunctionTemplate)) @@ -5832,7 +5832,7 @@ void Sema::AddSurrogateCandidate(CXXConversionDecl *Conversion, CXXRecordDecl *ActingContext, const FunctionProtoType *Proto, Expr *Object, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet& CandidateSet) { if (!CandidateSet.isNewCandidate(Conversion)) return; @@ -7685,7 +7685,7 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, void Sema::AddArgumentDependentLookupCandidates(DeclarationName Name, bool Operator, SourceLocation Loc, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, TemplateArgumentListInfo *ExplicitTemplateArgs, OverloadCandidateSet& CandidateSet, bool PartialOverloading) { @@ -8398,7 +8398,7 @@ void DiagnoseBadDeduction(Sema &S, OverloadCandidate *Cand, case Sema::TDK_SubstitutionFailure: { // Format the template argument list into the argument string. - llvm::SmallString<128> TemplateArgString; + SmallString<128> TemplateArgString; if (TemplateArgumentList *Args = Cand->DeductionFailure.getTemplateArgumentList()) { TemplateArgString = " "; @@ -8420,7 +8420,7 @@ void DiagnoseBadDeduction(Sema &S, OverloadCandidate *Cand, // Format the SFINAE diagnostic into the argument string. // FIXME: Add a general mechanism to include a PartialDiagnostic *'s // formatted message in another diagnostic. - llvm::SmallString<128> SFINAEArgString; + SmallString<128> SFINAEArgString; SourceRange R; if (PDiag) { SFINAEArgString = ": "; @@ -8739,7 +8739,7 @@ struct CompareOverloadCandidatesForDisplay { /// CompleteNonViableCandidate - Normally, overload resolution only /// computes up to the first. Produces the FixIt set if possible. void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand, - llvm::ArrayRef<Expr *> Args) { + ArrayRef<Expr *> Args) { assert(!Cand->Viable); // Don't do anything on failures other than bad conversion. @@ -8827,7 +8827,7 @@ void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand, /// set. void OverloadCandidateSet::NoteCandidates(Sema &S, OverloadCandidateDisplayKind OCD, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, StringRef Opc, SourceLocation OpLoc) { // Sort the candidates by viability and position. Sorting directly would @@ -9418,7 +9418,7 @@ bool Sema::ResolveAndFixSingleFunctionTemplateSpecialization( static void AddOverloadedCallCandidate(Sema &S, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet &CandidateSet, bool PartialOverloading, bool KnownValid) { @@ -9449,7 +9449,7 @@ static void AddOverloadedCallCandidate(Sema &S, /// \brief Add the overload candidates named by callee and/or found by argument /// dependent lookup to the given overload set. void Sema::AddOverloadedCallCandidates(UnresolvedLookupExpr *ULE, - llvm::ArrayRef<Expr *> Args, + ArrayRef<Expr *> Args, OverloadCandidateSet &CandidateSet, bool PartialOverloading) { @@ -9513,7 +9513,7 @@ static bool DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS, LookupResult &R, TemplateArgumentListInfo *ExplicitTemplateArgs, - llvm::ArrayRef<Expr *> Args) { + ArrayRef<Expr *> Args) { if (SemaRef.ActiveTemplateInstantiations.empty() || !SS.isEmpty()) return false; @@ -9610,7 +9610,7 @@ DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc, static bool DiagnoseTwoPhaseOperatorLookup(Sema &SemaRef, OverloadedOperatorKind Op, SourceLocation OpLoc, - llvm::ArrayRef<Expr *> Args) { + ArrayRef<Expr *> Args) { DeclarationName OpName = SemaRef.Context.DeclarationNames.getCXXOperatorName(Op); LookupResult R(SemaRef, OpName, OpLoc, Sema::LookupOperatorName); diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index a9d3dd5ad3c..9d8c04a6416 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -726,7 +726,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, } else { // We already verified that the expression has a i-c-e value (C99 // 6.8.4.2p3) - get that value now. - llvm::SmallVector<PartialDiagnosticAt, 8> Diags; + SmallVector<PartialDiagnosticAt, 8> Diags; LoVal = Lo->EvaluateKnownConstInt(Context, &Diags); if (Diags.size() == 1 && Diags[0].second.getDiagID() == diag::note_constexpr_overflow) { @@ -802,7 +802,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, if (DeclRefExpr *DeclRef = dyn_cast<DeclRefExpr>(CurrCase)) { CurrString = DeclRef->getDecl()->getName(); } - llvm::SmallString<16> CaseValStr; + SmallString<16> CaseValStr; CaseVals[i-1].first.toString(CaseValStr); if (PrevString == CurrString) @@ -1180,13 +1180,13 @@ namespace { // of the excluded constructs are used. class DeclExtractor : public EvaluatedExprVisitor<DeclExtractor> { llvm::SmallPtrSet<VarDecl*, 8> &Decls; - llvm::SmallVector<SourceRange, 10> &Ranges; + SmallVector<SourceRange, 10> &Ranges; bool Simple; public: typedef EvaluatedExprVisitor<DeclExtractor> Inherited; DeclExtractor(Sema &S, llvm::SmallPtrSet<VarDecl*, 8> &Decls, - llvm::SmallVector<SourceRange, 10> &Ranges) : + SmallVector<SourceRange, 10> &Ranges) : Inherited(S.Context), Decls(Decls), Ranges(Ranges), @@ -1335,7 +1335,7 @@ public: PartialDiagnostic PDiag = S.PDiag(diag::warn_variables_not_in_loop_body); llvm::SmallPtrSet<VarDecl*, 8> Decls; - llvm::SmallVector<SourceRange, 10> Ranges; + SmallVector<SourceRange, 10> Ranges; DeclExtractor DE(S, Decls, Ranges); DE.Visit(Second); @@ -1371,8 +1371,8 @@ public: // Load SourceRanges into diagnostic if there is room. // Otherwise, load the SourceRange of the conditional expression. if (Ranges.size() <= PartialDiagnostic::MaxArguments) - for (llvm::SmallVector<SourceRange, 10>::iterator I = Ranges.begin(), - E = Ranges.end(); + for (SmallVector<SourceRange, 10>::iterator I = Ranges.begin(), + E = Ranges.end(); I != E; ++I) PDiag << *I; else diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index e0c3a730350..008a99a174c 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -388,7 +388,7 @@ static StringRef getSpelling(Sema &SemaRef, Token AsmTok) { static bool buildMSAsmString(Sema &SemaRef, SourceLocation AsmLoc, ArrayRef<Token> AsmToks, - llvm::SmallVectorImpl<unsigned> &TokOffsets, + SmallVectorImpl<unsigned> &TokOffsets, std::string &AsmString) { assert (!AsmToks.empty() && "Didn't expect an empty AsmToks!"); @@ -578,7 +578,7 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, } std::string AsmString; - llvm::SmallVector<unsigned, 8> TokOffsets; + SmallVector<unsigned, 8> TokOffsets; if (buildMSAsmString(*this, AsmLoc, AsmToks, TokOffsets, AsmString)) return StmtError(); diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 87d3dc5eb86..df1521f9c79 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -3586,7 +3586,7 @@ isNullPointerValueTemplateArgument(Sema &S, NonTypeTemplateParmDecl *Param, Arg = ArgRV.take(); Expr::EvalResult EvalResult; - llvm::SmallVector<PartialDiagnosticAt, 8> Notes; + SmallVector<PartialDiagnosticAt, 8> Notes; EvalResult.Diag = &Notes; if (!Arg->EvaluateAsRValue(EvalResult, S.Context) || EvalResult.HasSideEffects) { diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp index 6d0aa21916c..04aa79b5fcc 100644 --- a/clang/lib/Sema/SemaTemplateInstantiate.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -1265,7 +1265,7 @@ TemplateInstantiator::TransformFunctionParmPackExpr(FunctionParmPackExpr *E) { // Transform each of the parameter expansions into the corresponding // parameters in the instantiation of the function decl. - llvm::SmallVector<Decl*, 8> Parms; + SmallVector<Decl *, 8> Parms; Parms.reserve(E->getNumExpansions()); for (FunctionParmPackExpr::iterator I = E->begin(), End = E->end(); I != End; ++I) { diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 034a8cbaba2..54006964563 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -247,7 +247,7 @@ public: /// must be set. bool TryExpandParameterPacks(SourceLocation EllipsisLoc, SourceRange PatternRange, - llvm::ArrayRef<UnexpandedParameterPack> Unexpanded, + ArrayRef<UnexpandedParameterPack> Unexpanded, bool &ShouldExpand, bool &RetainExpansion, llvm::Optional<unsigned> &NumExpansions) { @@ -7594,7 +7594,7 @@ template<typename Derived> ExprResult TreeTransform<Derived>::TransformTypeTraitExpr(TypeTraitExpr *E) { bool ArgChanged = false; - llvm::SmallVector<TypeSourceInfo *, 4> Args; + SmallVector<TypeSourceInfo *, 4> Args; for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) { TypeSourceInfo *From = E->getArg(I); TypeLoc FromTL = From->getTypeLoc(); @@ -7942,8 +7942,8 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) { getDerived().transformedLocalDecl(E->getLambdaClass(), Class); // Transform lambda parameters. - llvm::SmallVector<QualType, 4> ParamTypes; - llvm::SmallVector<ParmVarDecl *, 4> Params; + SmallVector<QualType, 4> ParamTypes; + SmallVector<ParmVarDecl *, 4> Params; if (getDerived().TransformFunctionTypeParams(E->getLocStart(), E->getCallOperator()->param_begin(), E->getCallOperator()->param_size(), @@ -8435,7 +8435,7 @@ template<typename Derived> ExprResult TreeTransform<Derived>::TransformObjCArrayLiteral(ObjCArrayLiteral *E) { // Transform each of the elements. - llvm::SmallVector<Expr *, 8> Elements; + SmallVector<Expr *, 8> Elements; bool ArgChanged = false; if (getDerived().TransformExprs(E->getElements(), E->getNumElements(), /*IsCall=*/false, Elements, &ArgChanged)) @@ -8454,7 +8454,7 @@ ExprResult TreeTransform<Derived>::TransformObjCDictionaryLiteral( ObjCDictionaryLiteral *E) { // Transform each of the elements. - llvm::SmallVector<ObjCDictionaryElement, 8> Elements; + SmallVector<ObjCDictionaryElement, 8> Elements; bool ArgChanged = false; for (unsigned I = 0, N = E->getNumElements(); I != N; ++I) { ObjCDictionaryElement OrigElement = E->getKeyValueElement(I); diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 986eee1c951..2ed8853bb2a 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1626,7 +1626,7 @@ void ASTReader::MaybeAddSystemRootToFilename(ModuleFile &M, ASTReader::ASTReadResult ASTReader::ReadControlBlock(ModuleFile &F, - llvm::SmallVectorImpl<ImportedModule> &Loaded, + SmallVectorImpl<ImportedModule> &Loaded, unsigned ClientLoadCapabilities) { llvm::BitstreamCursor &Stream = F.Stream; @@ -2602,7 +2602,7 @@ void ASTReader::makeNamesVisible(const HiddenNames &Names) { void ASTReader::makeModuleVisible(Module *Mod, Module::NameVisibilityKind NameVisibility) { llvm::SmallPtrSet<Module *, 4> Visited; - llvm::SmallVector<Module *, 4> Stack; + SmallVector<Module *, 4> Stack; Stack.push_back(Mod); while (!Stack.empty()) { Mod = Stack.back(); @@ -2642,7 +2642,7 @@ void ASTReader::makeModuleVisible(Module *Mod, // Push any exported modules onto the stack to be marked as visible. bool AnyWildcard = false; bool UnrestrictedWildcard = false; - llvm::SmallVector<Module *, 4> WildcardRestrictions; + SmallVector<Module *, 4> WildcardRestrictions; for (unsigned I = 0, N = Mod->Exports.size(); I != N; ++I) { Module *Exported = Mod->Exports[I].getPointer(); if (!Mod->Exports[I].getInt()) { @@ -2705,7 +2705,7 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, unsigned PreviousGeneration = CurrentGeneration++; unsigned NumModules = ModuleMgr.size(); - llvm::SmallVector<ImportedModule, 4> Loaded; + SmallVector<ImportedModule, 4> Loaded; switch(ASTReadResult ReadResult = ReadASTCore(FileName, Type, ImportLoc, /*ImportedBy=*/0, Loaded, ClientLoadCapabilities)) { @@ -2724,8 +2724,8 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, // Here comes stuff that we only do once the entire chain is loaded. // Load the AST blocks of all of the modules that we loaded. - for (llvm::SmallVectorImpl<ImportedModule>::iterator M = Loaded.begin(), - MEnd = Loaded.end(); + for (SmallVectorImpl<ImportedModule>::iterator M = Loaded.begin(), + MEnd = Loaded.end(); M != MEnd; ++M) { ModuleFile &F = *M->Mod; @@ -2751,8 +2751,8 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, } // Setup the import locations. - for (llvm::SmallVectorImpl<ImportedModule>::iterator M = Loaded.begin(), - MEnd = Loaded.end(); + for (SmallVectorImpl<ImportedModule>::iterator M = Loaded.begin(), + MEnd = Loaded.end(); M != MEnd; ++M) { ModuleFile &F = *M->Mod; if (!M->ImportedBy) @@ -2825,7 +2825,7 @@ ASTReader::ReadASTCore(StringRef FileName, ModuleKind Type, SourceLocation ImportLoc, ModuleFile *ImportedBy, - llvm::SmallVectorImpl<ImportedModule> &Loaded, + SmallVectorImpl<ImportedModule> &Loaded, unsigned ClientLoadCapabilities) { ModuleFile *M; bool NewModule; @@ -4094,7 +4094,7 @@ HeaderFileInfo ASTReader::GetHeaderFileInfo(const FileEntry *FE) { void ASTReader::ReadPragmaDiagnosticMappings(DiagnosticsEngine &Diag) { // FIXME: Make it work properly with modules. - llvm::SmallVector<DiagnosticsEngine::DiagState *, 32> DiagStates; + SmallVector<DiagnosticsEngine::DiagState *, 32> DiagStates; for (ModuleIterator I = ModuleMgr.begin(), E = ModuleMgr.end(); I != E; ++I) { ModuleFile &F = *(*I); unsigned Idx = 0; @@ -5326,7 +5326,7 @@ namespace { /// declaration context. class DeclContextNameLookupVisitor { ASTReader &Reader; - llvm::SmallVectorImpl<const DeclContext *> &Contexts; + SmallVectorImpl<const DeclContext *> &Contexts; DeclarationName Name; SmallVectorImpl<NamedDecl *> &Decls; @@ -5429,7 +5429,7 @@ namespace { /// declaration context. class DeclContextAllNamesVisitor { ASTReader &Reader; - llvm::SmallVectorImpl<const DeclContext *> &Contexts; + SmallVectorImpl<const DeclContext *> &Contexts; llvm::DenseMap<DeclarationName, SmallVector<NamedDecl *, 8> > &Decls; bool VisitAll; @@ -5488,7 +5488,7 @@ namespace { void ASTReader::completeVisibleDeclsMap(const DeclContext *DC) { if (!DC->hasExternalVisibleStorage()) return; - llvm::DenseMap<DeclarationName, llvm::SmallVector<NamedDecl*, 8> > Decls; + llvm::DenseMap<DeclarationName, SmallVector<NamedDecl *, 8> > Decls; // Compute the declaration contexts we need to look into. Multiple such // declaration contexts occur when two declaration contexts from disjoint @@ -5512,7 +5512,7 @@ void ASTReader::completeVisibleDeclsMap(const DeclContext *DC) { ++NumVisibleDeclContextsRead; for (llvm::DenseMap<DeclarationName, - llvm::SmallVector<NamedDecl*, 8> >::iterator + SmallVector<NamedDecl *, 8> >::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) { SetExternalVisibleDeclsForName(DC, I->first, I->second); } @@ -5811,8 +5811,8 @@ namespace clang { namespace serialization { ASTReader &Reader; Selector Sel; unsigned PriorGeneration; - llvm::SmallVector<ObjCMethodDecl *, 4> InstanceMethods; - llvm::SmallVector<ObjCMethodDecl *, 4> FactoryMethods; + SmallVector<ObjCMethodDecl *, 4> InstanceMethods; + SmallVector<ObjCMethodDecl *, 4> FactoryMethods; public: ReadMethodPoolVisitor(ASTReader &Reader, Selector Sel, diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index dfef31c277d..32179798ea4 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -2226,7 +2226,7 @@ namespace { SmallVectorImpl<DeclID> &SearchDecls; llvm::SmallPtrSet<Decl *, 16> &Deserialized; GlobalDeclID CanonID; - llvm::SmallVector<Decl *, 4> Chain; + SmallVector<Decl *, 4> Chain; public: RedeclChainVisitor(ASTReader &Reader, SmallVectorImpl<DeclID> &SearchDecls, @@ -2307,7 +2307,7 @@ void ASTReader::loadPendingDeclChain(serialization::GlobalDeclID ID) { Decl *CanonDecl = D->getCanonicalDecl(); // Determine the set of declaration IDs we'll be searching for. - llvm::SmallVector<DeclID, 1> SearchDecls; + SmallVector<DeclID, 1> SearchDecls; GlobalDeclID CanonID = 0; if (D == CanonDecl) { SearchDecls.push_back(ID); // Always first. diff --git a/clang/lib/Serialization/ASTReaderInternals.h b/clang/lib/Serialization/ASTReaderInternals.h index 9f3f1a4c109..8e07284d28b 100644 --- a/clang/lib/Serialization/ASTReaderInternals.h +++ b/clang/lib/Serialization/ASTReaderInternals.h @@ -143,8 +143,8 @@ class ASTSelectorLookupTrait { public: struct data_type { SelectorID ID; - llvm::SmallVector<ObjCMethodDecl *, 2> Instance; - llvm::SmallVector<ObjCMethodDecl *, 2> Factory; + SmallVector<ObjCMethodDecl *, 2> Instance; + SmallVector<ObjCMethodDecl *, 2> Factory; }; typedef Selector external_key_type; diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 4f24abdac05..fe498bee77f 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -1021,7 +1021,7 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context, // Imports if (Chain) { serialization::ModuleManager &Mgr = Chain->getModuleManager(); - llvm::SmallVector<char, 128> ModulePaths; + SmallVector<char, 128> ModulePaths; Record.clear(); for (ModuleManager::ModuleIterator M = Mgr.begin(), MEnd = Mgr.end(); @@ -3035,7 +3035,7 @@ uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context, // Create the on-disk hash table representation. DeclarationName ConversionName; - llvm::SmallVector<NamedDecl *, 4> ConversionDecls; + SmallVector<NamedDecl *, 4> ConversionDecls; for (StoredDeclsMap::iterator D = Map->begin(), DEnd = Map->end(); D != DEnd; ++D) { DeclarationName Name = D->first; @@ -3217,7 +3217,7 @@ void ASTWriter::WriteRedeclarations() { } void ASTWriter::WriteObjCCategories() { - llvm::SmallVector<ObjCCategoriesInfo, 2> CategoriesMap; + SmallVector<ObjCCategoriesInfo, 2> CategoriesMap; RecordData Categories; for (unsigned I = 0, N = ObjCClassesWithCategories.size(); I != N; ++I) { diff --git a/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp index 00cbd77acc6..36fe092fdc9 100644 --- a/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp @@ -23,7 +23,7 @@ using namespace ento; namespace { class BoolAssignmentChecker : public Checker< check::Bind > { - mutable llvm::OwningPtr<BuiltinBug> BT; + mutable OwningPtr<BuiltinBug> BT; void emitReport(ProgramStateRef state, CheckerContext &C) const; public: void checkBind(SVal loc, SVal val, const Stmt *S, CheckerContext &C) const; diff --git a/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 05156bacf73..e2f8395da90 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -126,7 +126,7 @@ class DeadStoreObs : public LiveVariables::Observer { llvm::SmallPtrSet<const VarDecl*, 20> Escaped; OwningPtr<ReachableCode> reachableCode; const CFGBlock *currentBlock; - llvm::OwningPtr<llvm::DenseSet<const VarDecl *> > InEH; + OwningPtr<llvm::DenseSet<const VarDecl *> > InEH; enum DeadStoreKind { Standard, Enclosing, DeadIncrement, DeadInit }; diff --git a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp index e58dfac1463..2f4b9e96f5c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp @@ -103,7 +103,7 @@ private: CheckerContext &C) const; - typedef llvm::SmallVector<unsigned, 2> ArgVector; + typedef SmallVector<unsigned, 2> ArgVector; /// \brief A struct used to specify taint propagation rules for a function. /// diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp index a7c73b87c19..b11553c1d46 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -60,7 +60,7 @@ public: private: typedef std::pair<SymbolRef, const AllocationState*> AllocationPair; - typedef llvm::SmallVector<AllocationPair, 2> AllocationPairVec; + typedef SmallVector<AllocationPair, 2> AllocationPairVec; enum APIKind { /// Denotes functions tracked by this checker. diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 70f426df204..33553a1385f 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -71,7 +71,7 @@ public: ID.AddPointer(S); } - void dump(llvm::raw_ostream &OS) const { + void dump(raw_ostream &OS) const { static const char *Table[] = { "Allocated", "Released", @@ -1101,7 +1101,7 @@ void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper, RegionStateTy RS = state->get<RegionState>(); RegionStateTy::Factory &F = state->get_context<RegionState>(); - llvm::SmallVector<SymbolRef, 2> Errors; + SmallVector<SymbolRef, 2> Errors; for (RegionStateTy::iterator I = RS.begin(), E = RS.end(); I != E; ++I) { if (SymReaper.isDead(I->first)) { if (I->second.isAllocated()) @@ -1135,7 +1135,7 @@ void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper, if (!Errors.empty()) { static SimpleProgramPointTag Tag("MallocChecker : DeadSymbolsLeak"); N = C.addTransition(C.getState(), C.getPredecessor(), &Tag); - for (llvm::SmallVector<SymbolRef, 2>::iterator + for (SmallVector<SymbolRef, 2>::iterator I = Errors.begin(), E = Errors.end(); I != E; ++I) { reportLeak(*I, N, C); } diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp index 9f1ab00dbcd..e8ad775cf4a 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp @@ -44,18 +44,18 @@ public: BugReporter &BR) const; void CheckMallocArgument( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Expr *TheArgument, ASTContext &Context) const; void OutputPossibleOverflows( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Decl *D, BugReporter &BR, AnalysisManager &mgr) const; }; } // end anonymous namespace void MallocOverflowSecurityChecker::CheckMallocArgument( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Expr *TheArgument, ASTContext &Context) const { @@ -111,7 +111,7 @@ namespace { class CheckOverflowOps : public EvaluatedExprVisitor<CheckOverflowOps> { public: - typedef llvm::SmallVectorImpl<MallocOverflowCheck> theVecType; + typedef SmallVectorImpl<MallocOverflowCheck> theVecType; private: theVecType &toScanFor; @@ -197,7 +197,7 @@ private: // detect the most blatent cases of overflow and educate the // programmer. void MallocOverflowSecurityChecker::OutputPossibleOverflows( - llvm::SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, + SmallVectorImpl<MallocOverflowCheck> &PossibleMallocOverflows, const Decl *D, BugReporter &BR, AnalysisManager &mgr) const { // By far the most common case: nothing to check. if (PossibleMallocOverflows.empty()) @@ -230,7 +230,7 @@ void MallocOverflowSecurityChecker::checkASTCodeBody(const Decl *D, return; // A list of variables referenced in possibly overflowing malloc operands. - llvm::SmallVector<MallocOverflowCheck, 2> PossibleMallocOverflows; + SmallVector<MallocOverflowCheck, 2> PossibleMallocOverflows; for (CFG::iterator it = cfg->begin(), ei = cfg->end(); it != ei; ++it) { CFGBlock *block = *it; diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp index 26a5ffe13b7..ce7d4ccf7a0 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp @@ -226,7 +226,7 @@ public: OS << " is converted to a pointer of type '" << PointeeType.getAsString() << "', which is incompatible with " << "sizeof operand type '" << SizeofType.getAsString() << "'"; - llvm::SmallVector<SourceRange, 4> Ranges; + SmallVector<SourceRange, 4> Ranges; Ranges.push_back(i->AllocCall->getCallee()->getSourceRange()); Ranges.push_back(SFinder.Sizeofs[0]->getSourceRange()); if (TSI) diff --git a/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp index d7c8023c571..19f79fa1dc4 100644 --- a/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp @@ -252,7 +252,7 @@ void NSOrCFErrorDerefChecker::checkEvent(ImplicitNullDerefEvent event) const { return; // Storing to possible null NSError/CFErrorRef out parameter. - llvm::SmallString<128> Buf; + SmallString<128> Buf; llvm::raw_svector_ostream os(Buf); os << "Potential null dereference. According to coding standards "; diff --git a/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp index fd5a2ff705d..e2a19fc2f09 100644 --- a/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp @@ -25,7 +25,7 @@ using namespace clang; using namespace ento; namespace { -typedef llvm::SmallVector<SymbolRef, 2> SymbolVector; +typedef SmallVector<SymbolRef, 2> SymbolVector; struct StreamState { private: @@ -226,7 +226,7 @@ void SimpleStreamChecker::reportLeaks(SymbolVector LeakedStreams, ExplodedNode *ErrNode) const { // Attach bug reports to the leak node. // TODO: Identify the leaked file descriptor. - for (llvm::SmallVector<SymbolRef, 2>::iterator + for (SmallVector<SymbolRef, 2>::iterator I = LeakedStreams.begin(), E = LeakedStreams.end(); I != E; ++I) { BugReport *R = new BugReport(*LeakBugType, "Opened file is never closed; potential resource leak", ErrNode); diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index b993804afea..99f6c2e300f 100644 --- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -109,7 +109,7 @@ bool AnalyzerOptions::shouldAvoidSuppressingNullArgumentPaths() { } int AnalyzerOptions::getOptionAsInteger(StringRef Name, int DefaultVal) { - llvm::SmallString<10> StrBuf; + SmallString<10> StrBuf; llvm::raw_svector_ostream OS(StrBuf); OS << DefaultVal; diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index e26e2069c7b..f76dd570758 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -928,7 +928,7 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond, } } -bool ConditionBRVisitor::patternMatch(const Expr *Ex, llvm::raw_ostream &Out, +bool ConditionBRVisitor::patternMatch(const Expr *Ex, raw_ostream &Out, BugReporterContext &BRC, BugReport &report, const ExplodedNode *N, diff --git a/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp b/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp index 400c74654b9..47299030cc4 100644 --- a/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp +++ b/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp @@ -110,7 +110,7 @@ void CheckerRegistry::initializeManager(CheckerManager &checkerMgr, } } -void CheckerRegistry::printHelp(llvm::raw_ostream &out, +void CheckerRegistry::printHelp(raw_ostream &out, size_t maxNameChars) const { // FIXME: Alphabetical sort puts 'experimental' in the middle. // Would it be better to name it '~experimental' or something else diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 9c611cb9825..f2b8c3026d1 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -2006,7 +2006,7 @@ struct DOTGraphTraits<ExplodedNode*> : return ""; } - static void printLocation(llvm::raw_ostream &Out, SourceLocation SLoc) { + static void printLocation(raw_ostream &Out, SourceLocation SLoc) { if (SLoc.isFileID()) { Out << "\\lline=" << GraphPrintSourceManager->getExpansionLineNumber(SLoc) diff --git a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index ec2e1885f55..166e04327d5 100644 --- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -130,7 +130,7 @@ PathDiagnosticConsumer::~PathDiagnosticConsumer() { } void PathDiagnosticConsumer::HandlePathDiagnostic(PathDiagnostic *D) { - llvm::OwningPtr<PathDiagnostic> OwningD(D); + OwningPtr<PathDiagnostic> OwningD(D); if (!D || D->path.empty()) return; @@ -146,7 +146,7 @@ void PathDiagnosticConsumer::HandlePathDiagnostic(PathDiagnostic *D) { // Verify that the entire path is from the same FileID. FileID FID; const SourceManager &SMgr = (*D->path.begin())->getLocation().getManager(); - llvm::SmallVector<const PathPieces *, 5> WorkList; + SmallVector<const PathPieces *, 5> WorkList; WorkList.push_back(&D->path); while (!WorkList.empty()) { diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 2939f56027a..7dcc088d18a 100644 --- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -369,7 +369,7 @@ void PlistDiagnostics::FlushDiagnosticsImpl( const PathDiagnostic *D = *DI; - llvm::SmallVector<const PathPieces *, 5> WorkList; + SmallVector<const PathPieces *, 5> WorkList; WorkList.push_back(&D->path); while (!WorkList.empty()) { diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index ffdb97197f1..bbc34f2e05b 100644 --- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -202,7 +202,7 @@ public: return asImmutableMap().getRootWithoutRetain(); } - void dump(llvm::raw_ostream &OS, const char *nl) const { + void dump(raw_ostream &OS, const char *nl) const { for (iterator I = begin(), E = end(); I != E; ++I) { const ClusterBindings &Cluster = I.getData(); for (ClusterBindings::iterator CI = Cluster.begin(), CE = Cluster.end(); diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index e62a6f73afb..b5b99cb7c63 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -72,7 +72,7 @@ findCompilationDatabaseFromDirectory(StringRef Directory, CompilationDatabase * CompilationDatabase::autoDetectFromSource(StringRef SourceFile, std::string &ErrorMessage) { - llvm::SmallString<1024> AbsolutePath(getAbsolutePath(SourceFile)); + SmallString<1024> AbsolutePath(getAbsolutePath(SourceFile)); StringRef Directory = llvm::sys::path::parent_path(AbsolutePath); CompilationDatabase *DB = findCompilationDatabaseFromDirectory(Directory, @@ -87,7 +87,7 @@ CompilationDatabase::autoDetectFromSource(StringRef SourceFile, CompilationDatabase * CompilationDatabase::autoDetectFromDirectory(StringRef SourceDir, std::string &ErrorMessage) { - llvm::SmallString<1024> AbsolutePath(getAbsolutePath(SourceDir)); + SmallString<1024> AbsolutePath(getAbsolutePath(SourceDir)); CompilationDatabase *DB = findCompilationDatabaseFromDirectory(AbsolutePath, ErrorMessage); diff --git a/clang/lib/Tooling/FileMatchTrie.cpp b/clang/lib/Tooling/FileMatchTrie.cpp index 9bd72f222a2..5eb4bb9e49d 100644 --- a/clang/lib/Tooling/FileMatchTrie.cpp +++ b/clang/lib/Tooling/FileMatchTrie.cpp @@ -172,7 +172,7 @@ void FileMatchTrie::insert(StringRef NewPath) { } StringRef FileMatchTrie::findEquivalent(StringRef FileName, - llvm::raw_ostream &Error) const { + raw_ostream &Error) const { if (llvm::sys::path::is_relative(FileName)) { Error << "Cannot resolve relative paths"; return StringRef(); diff --git a/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp index 197b7e76f0a..9013f2143fa 100644 --- a/clang/lib/Tooling/JSONCompilationDatabase.cpp +++ b/clang/lib/Tooling/JSONCompilationDatabase.cpp @@ -111,9 +111,9 @@ std::vector<std::string> unescapeCommandLine( class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin { virtual CompilationDatabase *loadFromDirectory( StringRef Directory, std::string &ErrorMessage) { - llvm::SmallString<1024> JSONDatabasePath(Directory); + SmallString<1024> JSONDatabasePath(Directory); llvm::sys::path::append(JSONDatabasePath, "compile_commands.json"); - llvm::OwningPtr<CompilationDatabase> Database( + OwningPtr<CompilationDatabase> Database( JSONCompilationDatabase::loadFromFile(JSONDatabasePath, ErrorMessage)); if (!Database) return NULL; @@ -133,14 +133,14 @@ volatile int JSONAnchorSource = 0; JSONCompilationDatabase * JSONCompilationDatabase::loadFromFile(StringRef FilePath, std::string &ErrorMessage) { - llvm::OwningPtr<llvm::MemoryBuffer> DatabaseBuffer; + OwningPtr<llvm::MemoryBuffer> DatabaseBuffer; llvm::error_code Result = llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer); if (Result != 0) { ErrorMessage = "Error while opening JSON database: " + Result.message(); return NULL; } - llvm::OwningPtr<JSONCompilationDatabase> Database( + OwningPtr<JSONCompilationDatabase> Database( new JSONCompilationDatabase(DatabaseBuffer.take())); if (!Database->parse(ErrorMessage)) return NULL; @@ -150,10 +150,10 @@ JSONCompilationDatabase::loadFromFile(StringRef FilePath, JSONCompilationDatabase * JSONCompilationDatabase::loadFromBuffer(StringRef DatabaseString, std::string &ErrorMessage) { - llvm::OwningPtr<llvm::MemoryBuffer> DatabaseBuffer( + OwningPtr<llvm::MemoryBuffer> DatabaseBuffer( llvm::MemoryBuffer::getMemBuffer(DatabaseString)); - llvm::OwningPtr<JSONCompilationDatabase> Database( - new JSONCompilationDatabase(DatabaseBuffer.take())); + OwningPtr<JSONCompilationDatabase> Database( + new JSONCompilationDatabase(DatabaseBuffer.take())); if (!Database->parse(ErrorMessage)) return NULL; return Database.take(); @@ -161,7 +161,7 @@ JSONCompilationDatabase::loadFromBuffer(StringRef DatabaseString, std::vector<CompileCommand> JSONCompilationDatabase::getCompileCommands(StringRef FilePath) const { - llvm::SmallString<128> NativeFilePath; + SmallString<128> NativeFilePath; llvm::sys::path::native(FilePath, NativeFilePath); std::vector<StringRef> PossibleMatches; std::string Error; @@ -208,8 +208,8 @@ void JSONCompilationDatabase::getCommands( ArrayRef<CompileCommandRef> CommandsRef, std::vector<CompileCommand> &Commands) const { for (int I = 0, E = CommandsRef.size(); I != E; ++I) { - llvm::SmallString<8> DirectoryStorage; - llvm::SmallString<1024> CommandStorage; + SmallString<8> DirectoryStorage; + SmallString<1024> CommandStorage; Commands.push_back(CompileCommand( // FIXME: Escape correctly: CommandsRef[I].first->getValue(DirectoryStorage), @@ -228,8 +228,7 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) { ErrorMessage = "Error while parsing YAML."; return false; } - llvm::yaml::SequenceNode *Array = - llvm::dyn_cast<llvm::yaml::SequenceNode>(Root); + llvm::yaml::SequenceNode *Array = dyn_cast<llvm::yaml::SequenceNode>(Root); if (Array == NULL) { ErrorMessage = "Expected array."; return false; @@ -237,8 +236,7 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) { for (llvm::yaml::SequenceNode::iterator AI = Array->begin(), AE = Array->end(); AI != AE; ++AI) { - llvm::yaml::MappingNode *Object = - llvm::dyn_cast<llvm::yaml::MappingNode>(&*AI); + llvm::yaml::MappingNode *Object = dyn_cast<llvm::yaml::MappingNode>(&*AI); if (Object == NULL) { ErrorMessage = "Expected object."; return false; @@ -255,18 +253,18 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) { return false; } llvm::yaml::ScalarNode *ValueString = - llvm::dyn_cast<llvm::yaml::ScalarNode>(Value); + dyn_cast<llvm::yaml::ScalarNode>(Value); if (ValueString == NULL) { ErrorMessage = "Expected string as value."; return false; } llvm::yaml::ScalarNode *KeyString = - llvm::dyn_cast<llvm::yaml::ScalarNode>((*KVI).getKey()); + dyn_cast<llvm::yaml::ScalarNode>((*KVI).getKey()); if (KeyString == NULL) { ErrorMessage = "Expected strings as key."; return false; } - llvm::SmallString<8> KeyStorage; + SmallString<8> KeyStorage; if (KeyString->getValue(KeyStorage) == "directory") { Directory = ValueString; } else if (KeyString->getValue(KeyStorage) == "command") { @@ -291,12 +289,12 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) { ErrorMessage = "Missing key: \"directory\"."; return false; } - llvm::SmallString<8> FileStorage; + SmallString<8> FileStorage; StringRef FileName = File->getValue(FileStorage); - llvm::SmallString<128> NativeFilePath; + SmallString<128> NativeFilePath; if (llvm::sys::path::is_relative(FileName)) { - llvm::SmallString<8> DirectoryStorage; - llvm::SmallString<128> AbsolutePath( + SmallString<8> DirectoryStorage; + SmallString<128> AbsolutePath( Directory->getValue(DirectoryStorage)); llvm::sys::path::append(AbsolutePath, FileName); llvm::sys::path::native(AbsolutePath.str(), NativeFilePath); diff --git a/clang/lib/Tooling/Refactoring.cpp b/clang/lib/Tooling/Refactoring.cpp index 9ed09991403..d8440d639d0 100644 --- a/clang/lib/Tooling/Refactoring.cpp +++ b/clang/lib/Tooling/Refactoring.cpp @@ -28,18 +28,18 @@ static const char * const InvalidLocation = ""; Replacement::Replacement() : FilePath(InvalidLocation), Offset(0), Length(0) {} -Replacement::Replacement(llvm::StringRef FilePath, unsigned Offset, - unsigned Length, llvm::StringRef ReplacementText) +Replacement::Replacement(StringRef FilePath, unsigned Offset, + unsigned Length, StringRef ReplacementText) : FilePath(FilePath), Offset(Offset), Length(Length), ReplacementText(ReplacementText) {} Replacement::Replacement(SourceManager &Sources, SourceLocation Start, - unsigned Length, llvm::StringRef ReplacementText) { + unsigned Length, StringRef ReplacementText) { setFromSourceLocation(Sources, Start, Length, ReplacementText); } Replacement::Replacement(SourceManager &Sources, const CharSourceRange &Range, - llvm::StringRef ReplacementText) { + StringRef ReplacementText) { setFromSourceRange(Sources, Range, ReplacementText); } @@ -89,7 +89,7 @@ bool Replacement::Less::operator()(const Replacement &R1, void Replacement::setFromSourceLocation(SourceManager &Sources, SourceLocation Start, unsigned Length, - llvm::StringRef ReplacementText) { + StringRef ReplacementText) { const std::pair<FileID, unsigned> DecomposedLocation = Sources.getDecomposedLoc(Start); const FileEntry *Entry = Sources.getFileEntryForID(DecomposedLocation.first); @@ -116,7 +116,7 @@ static int getRangeSize(SourceManager &Sources, const CharSourceRange &Range) { void Replacement::setFromSourceRange(SourceManager &Sources, const CharSourceRange &Range, - llvm::StringRef ReplacementText) { + StringRef ReplacementText) { setFromSourceLocation(Sources, Sources.getSpellingLoc(Range.getBegin()), getRangeSize(Sources, Range), ReplacementText); } @@ -150,7 +150,7 @@ int RefactoringTool::runAndSave(FrontendActionFactory *ActionFactory) { IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), &*DiagOpts); DiagnosticsEngine Diagnostics( - llvm::IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), + IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts, &DiagnosticPrinter, false); SourceManager Sources(Diagnostics, getFiles()); Rewriter Rewrite(Sources, DefaultLangOptions); diff --git a/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index 2e1ea999017..ac378a99847 100644 --- a/clang/lib/Tooling/Tooling.cpp +++ b/clang/lib/Tooling/Tooling.cpp @@ -63,7 +63,7 @@ static const clang::driver::ArgStringList *getCC1Arguments( // failed. Extract that job from the Compilation. const clang::driver::JobList &Jobs = Compilation->getJobs(); if (Jobs.size() != 1 || !isa<clang::driver::Command>(*Jobs.begin())) { - llvm::SmallString<256> error_msg; + SmallString<256> error_msg; llvm::raw_svector_ostream error_stream(error_msg); Compilation->PrintJob(error_stream, Compilation->getJobs(), "; ", true); Diagnostics->Report(clang::diag::err_fe_expected_compiler_job) @@ -121,7 +121,7 @@ bool runToolOnCodeWithArgs(clang::FrontendAction *ToolAction, const Twine &Code, } std::string getAbsolutePath(StringRef File) { - llvm::SmallString<1024> BaseDirectory; + SmallString<1024> BaseDirectory; if (const char *PWD = ::getenv("PWD")) BaseDirectory = PWD; else @@ -136,7 +136,7 @@ std::string getAbsolutePath(StringRef File) { if (RelativePath.startswith("./")) { RelativePath = RelativePath.substr(strlen("./")); } - llvm::SmallString<1024> AbsolutePath(BaseDirectory); + SmallString<1024> AbsolutePath(BaseDirectory); llvm::sys::path::append(AbsolutePath, RelativePath); llvm::sys::path::native(Twine(AbsolutePath), PathStorage); return PathStorage.str(); @@ -163,21 +163,21 @@ bool ToolInvocation::run() { TextDiagnosticPrinter DiagnosticPrinter( llvm::errs(), &*DiagOpts); DiagnosticsEngine Diagnostics( - llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()), + IntrusiveRefCntPtr<clang::DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts, &DiagnosticPrinter, false); - const llvm::OwningPtr<clang::driver::Driver> Driver( + const OwningPtr<clang::driver::Driver> Driver( newDriver(&Diagnostics, BinaryName)); // Since the input might only be virtual, don't check whether it exists. Driver->setCheckInputsExist(false); - const llvm::OwningPtr<clang::driver::Compilation> Compilation( + const OwningPtr<clang::driver::Compilation> Compilation( Driver->BuildCompilation(llvm::makeArrayRef(Argv))); const clang::driver::ArgStringList *const CC1Args = getCC1Arguments( &Diagnostics, Compilation.get()); if (CC1Args == NULL) { return false; } - llvm::OwningPtr<clang::CompilerInvocation> Invocation( + OwningPtr<clang::CompilerInvocation> Invocation( newInvocation(&Diagnostics, *CC1Args)); return runInvocation(BinaryName, Compilation.get(), Invocation.take(), *CC1Args); @@ -204,7 +204,7 @@ bool ToolInvocation::runInvocation( // ToolAction can have lifetime requirements for Compiler or its members, and // we need to ensure it's deleted earlier than Compiler. So we pass it to an // OwningPtr declared after the Compiler variable. - llvm::OwningPtr<FrontendAction> ScopedToolAction(ToolAction.take()); + OwningPtr<FrontendAction> ScopedToolAction(ToolAction.take()); // Create the compilers actual diagnostics engine. Compiler.createDiagnostics(CC1Args.size(), @@ -241,7 +241,7 @@ ClangTool::ClangTool(const CompilationDatabase &Compilations, : Files((FileSystemOptions())), ArgsAdjuster(new ClangSyntaxOnlyAdjuster()) { for (unsigned I = 0, E = SourcePaths.size(); I != E; ++I) { - llvm::SmallString<1024> File(getAbsolutePath(SourcePaths[I])); + SmallString<1024> File(getAbsolutePath(SourcePaths[I])); std::vector<CompileCommand> CompileCommandsForFile = Compilations.getCompileCommands(File.str()); |