diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index 7c7495ee67c9455819c0d233e4f334b22d47d937..ed392ab6b68d9ba897c579571f0ca83b8d268002 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -60,7 +60,7 @@ public: private: StringRef String; - llvm::SmallString<256> Buffer; + SmallString<256> Buffer; }; /// MangleContext - Context for tracking state which persists across multiple diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h index 005e17bbf916e6ba676e095b70c14f819bf70c21..49f18a815e4cd3006910a7876b18b1239879e436 100644 --- a/include/clang/Basic/LLVM.h +++ b/include/clang/Basic/LLVM.h @@ -25,6 +25,7 @@ namespace llvm { class Twine; template<typename T> class ArrayRef; template<class T> class OwningPtr; + template<unsigned InternalLen> class SmallString; template<typename T, unsigned N> class SmallVector; template<typename T> class SmallVectorImpl; @@ -46,6 +47,7 @@ namespace clang { using llvm::Twine; using llvm::ArrayRef; using llvm::OwningPtr; + using llvm::SmallString; using llvm::SmallVector; using llvm::SmallVectorImpl; diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h index 635d3cb67eefb6cc899c6d1e4fddc1ac1f10eb50..1aabc63d5432ef7001aa8b09d1ece77aade0b99e 100644 --- a/include/clang/Lex/LiteralSupport.h +++ b/include/clang/Lex/LiteralSupport.h @@ -155,7 +155,7 @@ class StringLiteralParser { unsigned SizeBound; unsigned CharByteWidth; tok::TokenKind Kind; - llvm::SmallString<512> ResultBuf; + SmallString<512> ResultBuf; char *ResultPtr; // cursor public: StringLiteralParser(const Token *StringToks, unsigned NumStringToks, diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 10d934aab27403b5b39bbbc7353b410a9424ad7d..77dc2348a54c130b847ed2dc4f6fd89f68c2d5da 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -1054,7 +1054,7 @@ public: /// This code concatenates and consumes tokens up to the '>' token. It /// returns false if the > was found, otherwise it returns true if it finds /// and consumes the EOD marker. - bool ConcatenateIncludeName(llvm::SmallString<128> &FilenameBuffer, + bool ConcatenateIncludeName(SmallString<128> &FilenameBuffer, SourceLocation &End); /// LexOnOffSwitch - Lex an on-off-switch (C99 6.10.6p2) and verify that it is diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 0e43ab34fdc0a00245622603c4d2d03a5bf27626..855f1045660a6423e9f688e5ca8f3fc146ecd4c2 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -573,13 +573,13 @@ bool MigrationProcess::applyTransform(TransformFn trans, assert(file); std::string newFname = file->getName(); newFname += "-trans"; - 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()), newFname); - llvm::SmallString<64> filePath(file->getName()); + SmallString<64> filePath(file->getName()); Unit->getFileManager().FixupRelativePath(filePath); Remapper.remap(filePath.str(), memBuf); } diff --git a/lib/ARCMigrate/FileRemapper.cpp b/lib/ARCMigrate/FileRemapper.cpp index 4a1223226f639541eac0fd956b0243f8a5a78fcb..0e6e35c748f52cb7492d4bf94f43e4f7fdf6fa8b 100644 --- a/lib/ARCMigrate/FileRemapper.cpp +++ b/lib/ARCMigrate/FileRemapper.cpp @@ -119,18 +119,18 @@ bool FileRemapper::flushToDisk(StringRef outputDir, DiagnosticsEngine &Diag) { I = FromToMappings.begin(), E = FromToMappings.end(); I != E; ++I) { const FileEntry *origFE = I->first; - llvm::SmallString<200> origPath = StringRef(origFE->getName()); + SmallString<200> origPath = StringRef(origFE->getName()); fs::make_absolute(origPath); infoOut << origPath << '\n'; infoOut << (uint64_t)origFE->getModificationTime() << '\n'; if (const FileEntry *FE = I->second.dyn_cast<const FileEntry *>()) { - llvm::SmallString<200> newPath = StringRef(FE->getName()); + SmallString<200> newPath = StringRef(FE->getName()); fs::make_absolute(newPath); infoOut << newPath << '\n'; } else { - llvm::SmallString<64> tempPath; + SmallString<64> tempPath; tempPath = path::filename(origFE->getName()); tempPath += "-%%%%%%%%"; tempPath += path::extension(origFE->getName()); @@ -276,7 +276,7 @@ void FileRemapper::resetTarget(Target &targ) { } bool FileRemapper::report(const Twine &err, DiagnosticsEngine &Diag) { - llvm::SmallString<128> buf; + SmallString<128> buf; unsigned ID = Diag.getDiagnosticIDs()->getCustomDiagID(DiagnosticIDs::Error, err.toStringRef(buf)); Diag.Report(ID); diff --git a/lib/ARCMigrate/TransGCAttrs.cpp b/lib/ARCMigrate/TransGCAttrs.cpp index 66ff5393df180df6b811d6f628882a8643f675ec..fa62b3620808c1e83bb110a8d9fd0900f4645c61 100644 --- a/lib/ARCMigrate/TransGCAttrs.cpp +++ b/lib/ARCMigrate/TransGCAttrs.cpp @@ -93,7 +93,7 @@ public: SourceManager &SM = Ctx.getSourceManager(); if (Loc.isMacroID()) Loc = SM.getImmediateExpansionRange(Loc).first; - llvm::SmallString<32> Buf; + SmallString<32> Buf; bool Invalid = false; StringRef Spell = Lexer::getSpelling( SM.getSpellingLoc(TL.getAttrEnumOperandLoc()), diff --git a/lib/ARCMigrate/TransUnbridgedCasts.cpp b/lib/ARCMigrate/TransUnbridgedCasts.cpp index 3e5723dd0064da8257f22cae34edec4673f9b037..48437c795fa9d0ac597bf814327f0a05ccad5762 100644 --- a/lib/ARCMigrate/TransUnbridgedCasts.cpp +++ b/lib/ARCMigrate/TransUnbridgedCasts.cpp @@ -195,7 +195,7 @@ private: TA.insertAfterToken(CCE->getLParenLoc(), bridge); } else { SourceLocation insertLoc = E->getSubExpr()->getLocStart(); - llvm::SmallString<128> newCast; + SmallString<128> newCast; newCast += '('; newCast += bridge; newCast += E->getType().getAsString(Pass.Ctx.getPrintingPolicy()); diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 335382bb4c2bed1cf0534263b283b36c60194e2d..20c5d486c03ca4a639872c47551c06a21d6ba89b 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3966,7 +3966,7 @@ ASTContext::BuildByRefType(StringRef DeclName, QualType Ty) const { bool HasCopyAndDispose = BlockRequiresCopying(Ty); // FIXME: Move up - llvm::SmallString<36> Name; + SmallString<36> Name; llvm::raw_svector_ostream(Name) << "__Block_byref_" << ++UniqueBlockByRefTypeID << '_' << DeclName; RecordDecl *T; diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp index 3ce02b0c55f28993e1c3d352ce97a31c54491851..dcbc5180a03e5700549c93f750ed0a38bd0fb8e3 100644 --- a/lib/AST/DumpXML.cpp +++ b/lib/AST/DumpXML.cpp @@ -223,7 +223,7 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>, //---- General utilities -------------------------------------------// void setPointer(StringRef prop, const void *p) { - llvm::SmallString<10> buffer; + SmallString<10> buffer; llvm::raw_svector_ostream os(buffer); os << p; os.flush(); @@ -239,7 +239,7 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>, } void setInteger(StringRef prop, unsigned n) { - llvm::SmallString<10> buffer; + SmallString<10> buffer; llvm::raw_svector_ostream os(buffer); os << n; os.flush(); diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index fc0b9a7a9408b7fc1c586effe1bd4621849dcb3e..8738e5f88533d83f148c4e83d780baffd3b95ce2 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -368,7 +368,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { if (IT != PrettyFunction && IT != PrettyFunctionNoVirtual) return FD->getNameAsString(); - llvm::SmallString<256> Name; + SmallString<256> Name; llvm::raw_svector_ostream Out(Name); if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) { @@ -421,7 +421,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { return Name.str().str(); } if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(CurrentDecl)) { - llvm::SmallString<256> Name; + SmallString<256> Name; llvm::raw_svector_ostream Out(Name); Out << (MD->isInstanceMethod() ? '-' : '+'); Out << '['; diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 5dbcf224cc29501873ac14d66770fa156862c6e7..9c697ed9b1e74224b0a98515d56b26e73794283d 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -1083,7 +1083,7 @@ void CXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND, // Mangle it as a source name in the form // [n] $_<id> // where n is the length of the string. - llvm::SmallString<8> Str; + SmallString<8> Str; Str += "$_"; Str += llvm::utostr(AnonStructId); @@ -1291,7 +1291,7 @@ void CXXNameMangler::manglePrefix(const DeclContext *DC, bool NoFunction) { if (const BlockDecl *Block = dyn_cast<BlockDecl>(DC)) { manglePrefix(DC->getParent(), NoFunction); - llvm::SmallString<64> Name; + SmallString<64> Name; llvm::raw_svector_ostream NameStream(Name); Context.mangleBlock(Block, NameStream); NameStream.flush(); @@ -1555,7 +1555,7 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals) { // // where <address-space-number> is a source name consisting of 'AS' // followed by the address space <number>. - llvm::SmallString<64> ASString; + SmallString<64> ASString; ASString = "AS" + llvm::utostr_32(Quals.getAddressSpace()); Out << 'U' << ASString.size() << ASString; } diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp index 68e0098c1a45c29a6f2cd2e86745517d83123fd6..c1f762be9bafbbf35d379077f432b1d136e37542 100644 --- a/lib/AST/Mangle.cpp +++ b/lib/AST/Mangle.cpp @@ -70,7 +70,7 @@ void MangleContext::mangleCtorBlock(const CXXConstructorDecl *CD, CXXCtorType CT, const BlockDecl *BD, raw_ostream &ResStream) { checkMangleDC(CD, BD); - llvm::SmallString<64> Buffer; + SmallString<64> Buffer; llvm::raw_svector_ostream Out(Buffer); mangleCXXCtor(CD, CT, Out); Out.flush(); @@ -81,7 +81,7 @@ void MangleContext::mangleDtorBlock(const CXXDestructorDecl *DD, CXXDtorType DT, const BlockDecl *BD, raw_ostream &ResStream) { checkMangleDC(DD, BD); - llvm::SmallString<64> Buffer; + SmallString<64> Buffer; llvm::raw_svector_ostream Out(Buffer); mangleCXXDtor(DD, DT, Out); Out.flush(); @@ -93,7 +93,7 @@ void MangleContext::mangleBlock(const DeclContext *DC, const BlockDecl *BD, assert(!isa<CXXConstructorDecl>(DC) && !isa<CXXDestructorDecl>(DC)); checkMangleDC(DC, BD); - llvm::SmallString<64> Buffer; + SmallString<64> Buffer; llvm::raw_svector_ostream Stream(Buffer); if (const ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(DC)) { mangleObjCMethodName(Method, Stream); @@ -116,7 +116,7 @@ void MangleContext::mangleBlock(const DeclContext *DC, const BlockDecl *BD, void MangleContext::mangleObjCMethodName(const ObjCMethodDecl *MD, raw_ostream &Out) { - llvm::SmallString<64> Name; + SmallString<64> Name; llvm::raw_svector_ostream OS(Name); const ObjCContainerDecl *CD = diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index df8ddb50fe931db4a56d463e1f4c190a21cd2886..7077be1d930289e9a38babeb41fd82d2b2df757a 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -698,7 +698,7 @@ void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) { } } void StmtPrinter::VisitFloatingLiteral(FloatingLiteral *Node) { - llvm::SmallString<16> Str; + SmallString<16> Str; Node->getValue().toString(Str); OS << Str; } diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp index 0eaf760e257d7029ad27af625fefb1c51868e0fc..25165972efe4bc9e1672c047fb595f383bf98fb6 100644 --- a/lib/AST/TemplateBase.cpp +++ b/lib/AST/TemplateBase.cpp @@ -503,7 +503,7 @@ const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB, // This shouldn't actually ever happen, so it's okay that we're // regurgitating an expression here. // FIXME: We're guessing at LangOptions! - llvm::SmallString<32> Str; + SmallString<32> Str; llvm::raw_svector_ostream OS(Str); LangOptions LangOpts; LangOpts.CPlusPlus = true; @@ -514,7 +514,7 @@ const DiagnosticBuilder &clang::operator<<(const DiagnosticBuilder &DB, case TemplateArgument::Pack: { // FIXME: We're guessing at LangOptions! - llvm::SmallString<32> Str; + SmallString<32> Str; llvm::raw_svector_ostream OS(Str); LangOptions LangOpts; LangOpts.CPlusPlus = true; diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 67e62297b2b57361f66a54a4895ec29a1067b6f0..790524644708d98a8238ab91d5b99f486bb5cef1 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -809,7 +809,7 @@ StoredDiagnostic::StoredDiagnostic(DiagnosticsEngine::Level Level, "Valid source location without setting a source manager for diagnostic"); if (Info.getLocation().isValid()) Loc = FullSourceLoc(Info.getLocation(), Info.getSourceManager()); - llvm::SmallString<64> Message; + SmallString<64> Message; Info.FormatDiagnostic(Message); this->Message.assign(Message.begin(), Message.end()); diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 267db4835295320bd39574e3ed753d2ced9937e2..fd6d33463a292cfc92de4afbc698412466260329 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -477,7 +477,7 @@ void FileManager::FixupRelativePath(SmallVectorImpl<char> &path) const { || llvm::sys::path::is_absolute(pathRef)) return; - llvm::SmallString<128> NewPath(FileSystemOpts.WorkingDir); + SmallString<128> NewPath(FileSystemOpts.WorkingDir); llvm::sys::path::append(NewPath, pathRef); path = NewPath; } @@ -509,7 +509,7 @@ getBufferForFile(const FileEntry *Entry, std::string *ErrorStr) { return Result.take(); } - llvm::SmallString<128> FilePath(Entry->getName()); + SmallString<128> FilePath(Entry->getName()); FixupRelativePath(FilePath); ec = llvm::MemoryBuffer::getFile(FilePath.str(), Result, Entry->getSize()); if (ec && ErrorStr) @@ -528,7 +528,7 @@ getBufferForFile(StringRef Filename, std::string *ErrorStr) { return Result.take(); } - llvm::SmallString<128> FilePath(Filename); + SmallString<128> FilePath(Filename); FixupRelativePath(FilePath); ec = llvm::MemoryBuffer::getFile(FilePath.c_str(), Result); if (ec && ErrorStr) @@ -549,7 +549,7 @@ bool FileManager::getStatValue(const char *Path, struct stat &StatBuf, return FileSystemStatCache::get(Path, StatBuf, FileDescriptor, StatCache.get()); - llvm::SmallString<128> FilePath(Path); + SmallString<128> FilePath(Path); FixupRelativePath(FilePath); return FileSystemStatCache::get(FilePath.c_str(), StatBuf, FileDescriptor, @@ -558,7 +558,7 @@ bool FileManager::getStatValue(const char *Path, struct stat &StatBuf, bool FileManager::getNoncachedStatValue(StringRef Path, struct stat &StatBuf) { - llvm::SmallString<128> FilePath(Path); + SmallString<128> FilePath(Path); FixupRelativePath(FilePath); return ::stat(FilePath.c_str(), &StatBuf) != 0; diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index bc1f175b3023014a93580ea6ee7ddeaacb9bb57e..8bd76252b303a6c9a01cc05a8ff4536b025b599a 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -356,7 +356,7 @@ StringRef Selector::getNameForSlot(unsigned int argIndex) const { } std::string MultiKeywordSelector::getName() const { - llvm::SmallString<256> Str; + SmallString<256> Str; llvm::raw_svector_ostream OS(Str); for (keyword_iterator I = keyword_begin(), E = keyword_end(); I != E; ++I) { if (*I) @@ -458,7 +458,7 @@ static SelectorTableImpl &getSelectorTableImpl(void *P) { SelectorTable::constructSetterName(IdentifierTable &Idents, SelectorTable &SelTable, const IdentifierInfo *Name) { - llvm::SmallString<100> SelectorName; + SmallString<100> SelectorName; SelectorName = "set"; SelectorName += Name->getName(); SelectorName[3] = toupper(SelectorName[3]); diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index ed27f2d92e7e55e514bacd2c109a00de44d66ebd..0ec74cff83271b0344da9dc765638b3c7f226571 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -131,7 +131,7 @@ StringRef CGDebugInfo::getFunctionName(const FunctionDecl *FD) { } StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { - llvm::SmallString<256> MethodName; + SmallString<256> MethodName; llvm::raw_svector_ostream OS(MethodName); OS << (OMD->isInstanceMethod() ? '-' : '+') << '['; const DeclContext *DC = OMD->getDeclContext(); @@ -254,7 +254,7 @@ StringRef CGDebugInfo::getCurrentDirname() { if (!CWDName.empty()) return CWDName; - llvm::SmallString<256> CWD; + SmallString<256> CWD; llvm::sys::fs::current_path(CWD); char *CompDirnamePtr = DebugInfoNames.Allocate<char>(CWD.size()); memcpy(CompDirnamePtr, CWD.data(), CWD.size()); @@ -2403,7 +2403,7 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block, fields.push_back(fieldType); } - llvm::SmallString<36> typeName; + SmallString<36> typeName; llvm::raw_svector_ostream(typeName) << "__block_literal_" << CGM.getUniqueBlockCount(); diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 3dd5cb9ba96691e4a287b9793d61defb7272a315..a5332a9aaf5175a3c7c87119ca46a21e4e8148ba 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -185,7 +185,7 @@ CreateReferenceTemporary(CodeGenFunction &CGF, QualType Type, const NamedDecl *InitializedDecl) { if (const VarDecl *VD = dyn_cast_or_null<VarDecl>(InitializedDecl)) { if (VD->hasGlobalStorage()) { - llvm::SmallString<256> Name; + SmallString<256> Name; llvm::raw_svector_ostream Out(Name); CGF.CGM.getCXXABI().getMangleContext().mangleReferenceTemporary(VD, Out); Out.flush(); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 3152db2bec1be8345851e866508f201da25c259c..3f933bac7c978bae740ce963e0f8212cae7361c6 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -2233,7 +2233,7 @@ void CGObjCMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) { const ObjCCategoryDecl *Category = Interface->FindCategoryDeclaration(OCD->getIdentifier()); - llvm::SmallString<256> ExtName; + SmallString<256> ExtName; llvm::raw_svector_ostream(ExtName) << Interface->getName() << '_' << OCD->getName(); @@ -2676,7 +2676,7 @@ llvm::Constant *CGObjCMac::EmitMethodList(Twine Name, llvm::Function *CGObjCCommonMac::GenerateMethod(const ObjCMethodDecl *OMD, const ObjCContainerDecl *CD) { - llvm::SmallString<256> Name; + SmallString<256> Name; GetNameForMethod(OMD, CD, Name); CodeGenTypes &Types = CGM.getTypes(); @@ -4251,7 +4251,7 @@ void CGObjCMac::FinishModule() { // // FIXME: It would be nice if we had an LLVM construct for this. if (!LazySymbols.empty() || !DefinedSymbols.empty()) { - llvm::SmallString<256> Asm; + SmallString<256> Asm; Asm += CGM.getModule().getModuleInlineAsm(); if (!Asm.empty() && Asm.back() != '\n') Asm += '\n'; @@ -5252,7 +5252,7 @@ void CGObjCNonFragileABIMac::GenerateCategory(const ObjCCategoryImplDecl *OCD) { const ObjCCategoryDecl *Category = Interface->FindCategoryDeclaration(OCD->getIdentifier()); if (Category) { - llvm::SmallString<256> ExtName; + SmallString<256> ExtName; llvm::raw_svector_ostream(ExtName) << Interface->getName() << "_$_" << OCD->getName(); Values[4] = EmitProtocolList("\01l_OBJC_CATEGORY_PROTOCOLS_$_" @@ -5634,7 +5634,7 @@ CGObjCNonFragileABIMac::EmitProtocolList(Twine Name, return llvm::Constant::getNullValue(ObjCTypes.ProtocolListnfABIPtrTy); // FIXME: We shouldn't need to do this lookup here, should we? - llvm::SmallString<256> TmpName; + SmallString<256> TmpName; Name.toVector(TmpName); llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(TmpName.str(), true); diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 120e711e840770c5da0ba96c641ce247b5feb11d..14134930f2c5b52e34e1147411cced3482ef5c3a 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -116,7 +116,7 @@ public: llvm::GlobalVariable * RTTIBuilder::GetAddrOfTypeName(QualType Ty, llvm::GlobalVariable::LinkageTypes Linkage) { - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, Out); Out.flush(); @@ -137,7 +137,7 @@ RTTIBuilder::GetAddrOfTypeName(QualType Ty, llvm::Constant *RTTIBuilder::GetAddrOfExternalRTTIDescriptor(QualType Ty) { // Mangle the RTTI name. - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty, Out); Out.flush(); @@ -533,7 +533,7 @@ maybeUpdateRTTILinkage(CodeGenModule &CGM, llvm::GlobalVariable *GV, GV->setLinkage(Linkage); // Get the typename global. - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, Out); Out.flush(); @@ -553,7 +553,7 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty, bool Force) { Ty = CGM.getContext().getCanonicalType(Ty); // Check if we've already emitted an RTTI descriptor for this type. - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty, Out); Out.flush(); diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp index a8af64773683b60466555ba8ac09994e34cc923e..34e34b234ee8dc388b6435e3f73cbbf4c4b6f8a5 100644 --- a/lib/CodeGen/CGVTT.cpp +++ b/lib/CodeGen/CGVTT.cpp @@ -100,7 +100,7 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT, llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) { assert(RD->getNumVBases() && "Only classes with virtual bases need a VTT"); - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXVTT(RD, Out); Out.flush(); diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 96b304544bc212498feb7a40bf1fc3390bbaac07..8a933440d0365e4d617f74c7183aa8ab8ca104ff 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -63,7 +63,7 @@ llvm::Constant *CodeGenModule::GetAddrOfThunk(GlobalDecl GD, const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()); // Compute the mangled name. - llvm::SmallString<256> Name; + SmallString<256> Name; llvm::raw_svector_ostream Out(Name); if (const CXXDestructorDecl* DD = dyn_cast<CXXDestructorDecl>(MD)) getCXXABI().getMangleContext().mangleCXXDtorThunk(DD, GD.getDtorType(), @@ -622,7 +622,7 @@ llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTable(const CXXRecordDecl *RD) { if (ShouldEmitVTableInThisTU(RD)) CGM.DeferredVTables.push_back(RD); - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext().mangleCXXVTable(RD, Out); Out.flush(); @@ -677,7 +677,7 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD, AddressPoints = VTLayout->getAddressPoints(); // Get the mangled construction vtable name. - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); CGM.getCXXABI().getMangleContext(). mangleCXXCtorVTable(RD, Base.getBaseOffset().getQuantity(), Base.getBase(), diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index ea1d94d7c2e82494fa054fce532fe23c11ef49ea..a35cd7eb946f90520dc06911c08984ed4de228d5 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -317,7 +317,7 @@ StringRef CodeGenModule::getMangledName(GlobalDecl GD) { return Str; } - llvm::SmallString<256> Buffer; + SmallString<256> Buffer; llvm::raw_svector_ostream Out(Buffer); if (const CXXConstructorDecl *D = dyn_cast<CXXConstructorDecl>(ND)) getCXXABI().getMangleContext().mangleCXXCtor(D, GD.getCtorType(), Out); @@ -1779,7 +1779,7 @@ GetConstantCFStringEntry(llvm::StringMap<llvm::Constant*> &Map, // order. // // FIXME: This isn't something we should need to do here. - llvm::SmallString<128> AsBytes; + SmallString<128> AsBytes; AsBytes.reserve(StringLength * 2); for (unsigned i = 0; i != StringLength; ++i) { unsigned short Val = ToBuf[i]; diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index 594c6c474c3b60d2de5882f4b21d2ee30cad8a26..401ad10638fd5e4adc71f9404e31cdeeb4c9d27b 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -170,7 +170,7 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { // TODO: This is using the RTTI name. Is there a better way to get // a unique string for a type? - llvm::SmallString<256> OutName; + SmallString<256> OutName; llvm::raw_svector_ostream Out(OutName); MContext.mangleCXXRTTIName(QualType(ETy, 0), Out); Out.flush(); diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index b5546e2f18e5e5961340302e26f52338ad6befb2..16ca7ec80d0ae88a226665d6be83159dfcb3cead 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -48,7 +48,7 @@ CodeGenTypes::~CodeGenTypes() { void CodeGenTypes::addRecordTypeName(const RecordDecl *RD, llvm::StructType *Ty, StringRef suffix) { - llvm::SmallString<256> TypeName; + SmallString<256> TypeName; llvm::raw_svector_ostream OS(TypeName); OS << RD->getKindName() << '.'; diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index b319420342504bdd5cadc03e85cd32e1e21496bc..1e5b2c26a1b324259d9597096dcb1a6f0535fa43 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -1040,7 +1040,7 @@ void ItaniumCXXABI::EmitGuardedInit(CodeGenFunction &CGF, llvm::PointerType *GuardPtrTy = GuardTy->getPointerTo(); // Create the guard variable. - llvm::SmallString<256> GuardVName; + SmallString<256> GuardVName; llvm::raw_svector_ostream Out(GuardVName); getMangleContext().mangleItaniumGuardVariable(&D, Out); Out.flush(); diff --git a/lib/Driver/Arg.cpp b/lib/Driver/Arg.cpp index 39b7e5556494cf5c2b7798e64a543efba3ec6752..c0a2a506a6ba151e91e33039884ead343ac711c8 100644 --- a/lib/Driver/Arg.cpp +++ b/lib/Driver/Arg.cpp @@ -61,7 +61,7 @@ void Arg::dump() const { } std::string Arg::getAsString(const ArgList &Args) const { - llvm::SmallString<256> Res; + SmallString<256> Res; llvm::raw_svector_ostream OS(Res); ArgStringList ASL; @@ -94,7 +94,7 @@ void Arg::render(const ArgList &Args, ArgStringList &Output) const { break; case Option::RenderCommaJoinedStyle: { - llvm::SmallString<256> Res; + SmallString<256> Res; llvm::raw_svector_ostream OS(Res); OS << getOption().getName(); for (unsigned i = 0, e = getNumValues(); i != e; ++i) { diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index 3c9e71d6f80f96026069b235beda1d7d2ca9d7e3..d26da25b3e300007272dc11b6b7363dd28b8c9e8 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -228,7 +228,7 @@ void ArgList::ClaimAllArgs() const { } const char *ArgList::MakeArgString(const Twine &T) const { - llvm::SmallString<256> Str; + SmallString<256> Str; T.toVector(Str); return MakeArgString(Str.str()); } diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 6f93d0be25c0155e5bbb5a8908f2043525ed2ece..bab7568736da5d472b066ce1044f698154e5aa91 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -80,7 +80,7 @@ Driver::Driver(StringRef ClangExecutable, // Compute the path to the resource directory. StringRef ClangResourceDir(CLANG_RESOURCE_DIR); - llvm::SmallString<128> P(Dir); + SmallString<128> P(Dir); if (ClangResourceDir != "") llvm::sys::path::append(P, ClangResourceDir); else @@ -964,7 +964,7 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args, // Check that the file exists, if enabled. if (CheckInputsExist && memcmp(Value, "-", 2) != 0) { - llvm::SmallString<64> Path(Value); + SmallString<64> Path(Value); if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) if (llvm::sys::path::is_absolute(Path.str())) { Path = WorkDir->getValue(Args); @@ -1408,7 +1408,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str())); } - llvm::SmallString<128> BasePath(BaseInput); + SmallString<128> BasePath(BaseInput); StringRef BaseName; // Dsymutil actions should use the full path. diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 79d84544a85c4bcbbf0b7cbce42789d004036876..48d798b99069197d1cad86a6cabc39170d431ed7 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -184,7 +184,7 @@ std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args, unsigned Version[3]; getTargetVersion(Version); - llvm::SmallString<16> Str; + SmallString<16> Str; llvm::raw_svector_ostream(Str) << (isTargetIPhoneOS() ? "ios" : "macosx") << Version[0] << "." << Version[1] << "." << Version[2]; @@ -1132,7 +1132,7 @@ Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( SmallVector<std::string, 8> Prefixes(D.PrefixDirs.begin(), D.PrefixDirs.end()); - llvm::SmallString<128> CxxInstallRoot(GCC_INSTALL_PREFIX); + SmallString<128> CxxInstallRoot(GCC_INSTALL_PREFIX); if (CxxInstallRoot != "") { if (CxxInstallRoot.back() == '/') llvm::sys::path::remove_filename(CxxInstallRoot); // remove the / diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 93dcd0d461bdfa0443b994137514925eefee6265..5c88468b296d022b67a4ffe025313d22193445a8 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -234,13 +234,13 @@ void Clang::AddPreprocessingOptions(Compilation &C, // Otherwise derive from the base input. // // FIXME: This should use the computed output file location. - llvm::SmallString<128> P(Inputs[0].getBaseInput()); + SmallString<128> P(Inputs[0].getBaseInput()); llvm::sys::path::replace_extension(P, "o"); DepTarget = Args.MakeArgString(llvm::sys::path::filename(P)); } CmdArgs.push_back("-MT"); - llvm::SmallString<128> Quoted; + SmallString<128> Quoted; QuoteTarget(DepTarget, Quoted); CmdArgs.push_back(Args.MakeArgString(Quoted)); } @@ -268,7 +268,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, if (A->getOption().matches(options::OPT_MQ)) { CmdArgs.push_back("-MT"); - llvm::SmallString<128> Quoted; + SmallString<128> Quoted; QuoteTarget(A->getValue(Args), Quoted); CmdArgs.push_back(Args.MakeArgString(Quoted)); @@ -379,7 +379,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, A->claim(); A->render(Args, CmdArgs); } else { - llvm::SmallString<128> DefaultModuleCache; + SmallString<128> DefaultModuleCache; llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false, DefaultModuleCache); llvm::sys::path::append(DefaultModuleCache, "clang-module-cache"); @@ -1185,7 +1185,7 @@ static void addAsanRTLinux(const ToolChain &TC, const ArgList &Args, // LibAsan is "libclang_rt.asan-<ArchName>.a" in the Linux library resource // directory. - llvm::SmallString<128> LibAsan(TC.getDriver().ResourceDir); + SmallString<128> LibAsan(TC.getDriver().ResourceDir); llvm::sys::path::append(LibAsan, "lib", "linux", (Twine("libclang_rt.asan-") + TC.getArchName() + ".a")); @@ -2511,7 +2511,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, ie = Args.end(); it != ie; ++it) (*it)->render(Args, OriginalArgs); - llvm::SmallString<256> Flags; + SmallString<256> Flags; Flags += Exec; for (unsigned i = 0, e = OriginalArgs.size(); i != e; ++i) { Flags += " "; @@ -2608,7 +2608,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, ie = Args.end(); it != ie; ++it) (*it)->render(Args, OriginalArgs); - llvm::SmallString<256> Flags; + SmallString<256> Flags; const char *Exec = getToolChain().getDriver().getClangProgramPath(); Flags += Exec; for (unsigned i = 0, e = OriginalArgs.size(); i != e; ++i) { diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index fce28b7488f8111b8da9e0121f6de68ac4ebc39f..1f2508730f6436c4d5a4d0993e12eb54c6916fd4 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -2400,7 +2400,7 @@ CXSaveError ASTUnit::Save(StringRef File) { // Write to a temporary file and later rename it to the actual file, to avoid // possible race conditions. - llvm::SmallString<128> TempPath; + SmallString<128> TempPath; TempPath = File; TempPath += "-%%%%%%%%"; int fd; diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index 8195445fe0e4842a61e68f384d26144dda17439a..e74529d7e995c2a120a3c560882811e8bb0ca926 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/lib/Frontend/CacheTokens.cpp @@ -540,7 +540,7 @@ void clang::CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS) { // Get the name of the main file. const SourceManager &SrcMgr = PP.getSourceManager(); const FileEntry *MainFile = SrcMgr.getFileEntryForID(SrcMgr.getMainFileID()); - llvm::SmallString<128> MainFilePath(MainFile->getName()); + SmallString<128> MainFilePath(MainFile->getName()); llvm::sys::fs::make_absolute(MainFilePath); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index a3669d798ae375888a903ec9db9d7fda64b84795..1a6876c4adca7f4979d53fe09ccf800f3ec37254 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -264,7 +264,7 @@ void CompilerInstance::createPreprocessor() { // Set up the module path, including the hash for the // module-creation options. - llvm::SmallString<256> SpecificModuleCache( + SmallString<256> SpecificModuleCache( getHeaderSearchOpts().ModuleCachePath); if (!getHeaderSearchOpts().DisableModuleHash) llvm::sys::path::append(SpecificModuleCache, @@ -445,7 +445,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) { bool existed; llvm::sys::fs::remove(it->TempFilename, existed); } else { - llvm::SmallString<128> NewOutFile(it->Filename); + SmallString<128> NewOutFile(it->Filename); // If '-working-directory' was passed, the output filename should be // relative to that. @@ -536,7 +536,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath, if ((llvm::sys::fs::exists(OutPath.str(), Exists) || !Exists) || (OutPath.isRegularFile() && OutPath.canWrite())) { // Create a temporary file. - llvm::SmallString<128> TempPath; + SmallString<128> TempPath; TempPath = OutFile; TempPath += "-%%%%%%%%"; int fd; @@ -761,7 +761,7 @@ static void compileModule(CompilerInstance &ImportingInstance, InputKind IK = getSourceInputKindFromOptions(*Invocation->getLangOpts()); // Get or create the module map that we'll use to build this module. - llvm::SmallString<128> TempModuleMapFileName; + SmallString<128> TempModuleMapFileName; if (const FileEntry *ModuleMapFile = ModMap.getContainingModuleMapFile(Module)) { // Use the module map where this module resides. @@ -890,7 +890,7 @@ Module *CompilerInstance::loadModule(SourceLocation ImportLoc, SmallVectorImpl<std::string>::iterator Pos = std::find(ModuleBuildPath.begin(), ModuleBuildPath.end(), ModuleName); if (Pos != ModuleBuildPath.end()) { - llvm::SmallString<256> CyclePath; + SmallString<256> CyclePath; for (; Pos != ModuleBuildPath.end(); ++Pos) { CyclePath += *Pos; CyclePath += " -> "; diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index fec9b6691bb3a9e2342babfc1b0d0b4e9222a560..653da75f2505511d26beb1806c58665576ab7563 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -66,7 +66,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, // failed. const driver::JobList &Jobs = C->getJobs(); if (Jobs.size() != 1 || !isa<driver::Command>(*Jobs.begin())) { - llvm::SmallString<256> Msg; + SmallString<256> Msg; llvm::raw_svector_ostream OS(Msg); C->PrintJob(OS, C->getJobs(), "; ", true); Diags->Report(diag::err_fe_expected_compiler_job) << OS.str(); diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp index 062b8a9d127e3a9c953e805bac341be4a9986aec..548a4a833cee22ffb053e977dd4a57ed08b88ac0 100644 --- a/lib/Frontend/DiagnosticRenderer.cpp +++ b/lib/Frontend/DiagnosticRenderer.cpp @@ -285,7 +285,7 @@ void DiagnosticRenderer::emitMacroExpansionsAndCarets( if (Suppressed) { // Tell the user that we've skipped contexts. if (OnMacroInst == MacroSkipStart) { - llvm::SmallString<200> MessageStorage; + SmallString<200> MessageStorage; llvm::raw_svector_ostream Message(MessageStorage); Message << "(skipping " << (MacroSkipEnd - MacroSkipStart) << " expansions in backtrace; use -fmacro-backtrace-limit=0 to " @@ -295,7 +295,7 @@ void DiagnosticRenderer::emitMacroExpansionsAndCarets( return; } - llvm::SmallString<100> MessageStorage; + SmallString<100> MessageStorage; llvm::raw_svector_ostream Message(MessageStorage); Message << "expanded from macro '" << getImmediateMacroName(MacroLoc, SM, LangOpts) << "'"; diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index c0302329c1e290fae2cb29a95e30b70ab31b9ed5..96b0b831ea5c03b43aef2607d0d45e4eb93ed85c 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -137,7 +137,7 @@ static void collectModuleHeaderIncludes(const LangOptions &LangOpts, FileManager &FileMgr, ModuleMap &ModMap, clang::Module *Module, - llvm::SmallString<256> &Includes) { + SmallString<256> &Includes) { // Don't collect any headers for unavailable modules. if (!Module->isAvailable()) return; @@ -165,7 +165,7 @@ static void collectModuleHeaderIncludes(const LangOptions &LangOpts, } else if (const DirectoryEntry *UmbrellaDir = Module->getUmbrellaDir()) { // Add all of the headers we find in this subdirectory. llvm::error_code EC; - llvm::SmallString<128> DirNative; + SmallString<128> DirNative; llvm::sys::path::native(UmbrellaDir->getName(), DirNative); for (llvm::sys::fs::recursive_directory_iterator Dir(DirNative.str(), EC), DirEnd; @@ -249,7 +249,7 @@ bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI, const FileEntry *UmbrellaHeader = Module->getUmbrellaHeader(); // Collect the set of #includes we need to build the module. - llvm::SmallString<256> HeaderContents; + SmallString<256> HeaderContents; collectModuleHeaderIncludes(CI.getLangOpts(), CI.getFileManager(), CI.getPreprocessor().getHeaderSearchInfo().getModuleMap(), Module, HeaderContents); @@ -263,7 +263,7 @@ bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI, } FileManager &FileMgr = CI.getFileManager(); - llvm::SmallString<128> HeaderName; + SmallString<128> HeaderName; time_t ModTime; if (UmbrellaHeader) { // Read in the umbrella header. @@ -280,7 +280,7 @@ bool GenerateModuleAction::BeginSourceFileAction(CompilerInstance &CI, // Combine the contents of the umbrella header with the automatically- // generated includes. - llvm::SmallString<256> OldContents = HeaderContents; + SmallString<256> OldContents = HeaderContents; HeaderContents = UmbrellaContents->getBuffer(); HeaderContents += "\n\n"; HeaderContents += "/* Module includes */\n"; @@ -329,7 +329,7 @@ bool GenerateModuleAction::ComputeASTConsumerArguments(CompilerInstance &CI, // in the module cache. if (CI.getFrontendOpts().OutputFile.empty()) { HeaderSearch &HS = CI.getPreprocessor().getHeaderSearchInfo(); - llvm::SmallString<256> ModuleFileName(HS.getModuleCachePath()); + SmallString<256> ModuleFileName(HS.getModuleCachePath()); llvm::sys::path::append(ModuleFileName, CI.getLangOpts().CurrentModule + ".pcm"); CI.getFrontendOpts().OutputFile = ModuleFileName.str(); diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index f703674ce279d76632f184167ff89c3ab7107a88..79920df20af75746106ec0752153d4e4c8cc27a6 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -108,10 +108,10 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc, // are showing all headers. if (ShowHeader && Reason == PPCallbacks::EnterFile) { // Write to a temporary string to avoid unnecessary flushing on errs(). - llvm::SmallString<512> Filename(UserLoc.getFilename()); + SmallString<512> Filename(UserLoc.getFilename()); Lexer::Stringify(Filename); - llvm::SmallString<256> Msg; + SmallString<256> Msg; if (ShowDepth) { // The main source file is at depth 1, so skip one dot. for (unsigned i = 1; i != CurrentIncludeDepth; ++i) diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index e1a8c53de893bc75ca52347fa67125f6b75f9150..67b2287604d1a6f771647cf90c79905f4688ec6b 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -109,7 +109,7 @@ void InitHeaderSearch::AddPath(const Twine &Path, FileManager &FM = Headers.getFileMgr(); // Compute the actual path, taking into consideration -isysroot. - llvm::SmallString<256> MappedPathStorage; + SmallString<256> MappedPathStorage; StringRef MappedPathStr = Path.toStringRef(MappedPathStorage); // Handle isysroot. diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 93c9989020069785706940684a763da1299ad05f..f0cf7f491401b0a2d27988916271e195a6c34b2f 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -127,7 +127,7 @@ static void DefineFloatMacros(MacroBuilder &Builder, StringRef Prefix, "1.79769313486231580793728971405301e+308L", "1.18973149535723176508575932662800702e+4932L"); - llvm::SmallString<32> DefPrefix; + SmallString<32> DefPrefix; DefPrefix = "__"; DefPrefix += Prefix; DefPrefix += "_"; diff --git a/lib/Frontend/LogDiagnosticPrinter.cpp b/lib/Frontend/LogDiagnosticPrinter.cpp index 8eb46732b990b6b10bac467b5ada29e88be5703d..3fee9574998670b5f2b315005a6d1c69a1e76a9b 100644 --- a/lib/Frontend/LogDiagnosticPrinter.cpp +++ b/lib/Frontend/LogDiagnosticPrinter.cpp @@ -64,7 +64,7 @@ void LogDiagnosticPrinter::EndSourceFile() { return; // Write to a temporary string to ensure atomic write of diagnostic object. - llvm::SmallString<512> Msg; + SmallString<512> Msg; llvm::raw_svector_ostream OS(Msg); OS << "<dict>\n"; @@ -140,7 +140,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, DE.DiagnosticLevel = Level; // Format the message. - llvm::SmallString<100> MessageStr; + SmallString<100> MessageStr; Info.FormatDiagnostic(MessageStr); DE.Message = MessageStr.str(); diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp index 93dd00425196d1291a5094e4a87f57cd455ee4a7..43b64b218696b776411907258ae936c550e3cdbc 100644 --- a/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/lib/Frontend/PrintPreprocessedOutput.cpp @@ -62,7 +62,7 @@ static void PrintMacroDefinition(const IdentifierInfo &II, const MacroInfo &MI, if (MI.tokens_empty() || !MI.tokens_begin()->hasLeadingSpace()) OS << ' '; - llvm::SmallString<128> SpellingBuffer; + SmallString<128> SpellingBuffer; for (MacroInfo::tokens_iterator I = MI.tokens_begin(), E = MI.tokens_end(); I != E; ++I) { if (I->hasLeadingSpace()) @@ -89,7 +89,7 @@ private: bool EmittedTokensOnThisLine; bool EmittedMacroOnThisLine; SrcMgr::CharacteristicKind FileType; - llvm::SmallString<512> CurFilename; + SmallString<512> CurFilename; bool Initialized; bool DisableLineMarkers; bool DumpDefines; diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index bdf0b550c75921b6e4741274de4c4480b5490f4a..649f294bf87ac878dfa1df6e88c98dc1f7ba790e 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -179,7 +179,7 @@ private: RecordData Record; /// \brief A text buffer for rendering diagnostic text. - llvm::SmallString<256> diagBuf; + SmallString<256> diagBuf; /// \brief The collection of diagnostic categories used. llvm::DenseSet<unsigned> Categories; @@ -584,7 +584,7 @@ void SDiagsRenderer::emitNote(SourceLocation Loc, StringRef Message) { void SDiagsRenderer::emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc) { // Generate a note indicating the include location. - llvm::SmallString<200> MessageStorage; + SmallString<200> MessageStorage; llvm::raw_svector_ostream Message(MessageStorage); Message << "in file included from " << PLoc.getFilename() << ':' << PLoc.getLine() << ":"; diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index d2b8660c625e632c5efa5561e72d7cf5b3a5ed85..5b8fd5675d7735ede50b8a55f1b6c6eec19abfec 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -233,7 +233,7 @@ static unsigned findEndOfWord(unsigned Start, StringRef Str, // We have the start of a balanced punctuation sequence (quotes, // parentheses, etc.). Determine the full sequence is. - llvm::SmallString<16> PunctuationEndStack; + SmallString<16> PunctuationEndStack; PunctuationEndStack.push_back(EndPunct); while (End < Length && !PunctuationEndStack.empty()) { if (Str[End] == PunctuationEndStack.back()) @@ -284,7 +284,7 @@ static bool printWordWrapped(raw_ostream &OS, StringRef Str, const unsigned Length = std::min(Str.find('\n'), Str.size()); // The string used to indent each line. - llvm::SmallString<16> IndentStr; + SmallString<16> IndentStr; IndentStr.assign(Indentation, ' '); bool Wrapped = false; for (unsigned WordStart = 0, WordEnd; WordStart < Length; diff --git a/lib/Frontend/TextDiagnosticBuffer.cpp b/lib/Frontend/TextDiagnosticBuffer.cpp index f8ea9f1361ab1290a5bf7139823e6518ab156610..57105f15a30af9b5def98d4936dda803a4c91a2d 100644 --- a/lib/Frontend/TextDiagnosticBuffer.cpp +++ b/lib/Frontend/TextDiagnosticBuffer.cpp @@ -24,7 +24,7 @@ void TextDiagnosticBuffer::HandleDiagnostic(DiagnosticsEngine::Level Level, // Default implementation (Warnings/errors count). DiagnosticConsumer::HandleDiagnostic(Level, Info); - llvm::SmallString<100> Buf; + SmallString<100> Buf; Info.FormatDiagnostic(Buf); switch (Level) { default: llvm_unreachable( diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index b5d0bcb0cb02c3d71e203b5390b07cfdc9baa2f9..465dcad80cd5df4cfcce97f25c2ef81980000b28 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -132,7 +132,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, // Render the diagnostic message into a temporary buffer eagerly. We'll use // this later as we print out the diagnostic to the terminal. - llvm::SmallString<100> OutStr; + SmallString<100> OutStr; Info.FormatDiagnostic(OutStr); llvm::raw_svector_ostream DiagMessageStream(OutStr); diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp index c8d6be65095861775b20d490b3e1cd3cc670da8f..67bc5efa1a563f84af719fa3033de0d77faacea6 100644 --- a/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -378,7 +378,7 @@ static unsigned PrintProblem(DiagnosticsEngine &Diags, SourceManager *SourceMgr, const char *Kind, bool Expected) { if (diag_begin == diag_end) return 0; - llvm::SmallString<256> Fmt; + SmallString<256> Fmt; llvm::raw_svector_ostream OS(Fmt); for (const_diag_iterator I = diag_begin, E = diag_end; I != E; ++I) { if (I->first.isInvalid() || !SourceMgr) @@ -399,7 +399,7 @@ static unsigned PrintProblem(DiagnosticsEngine &Diags, SourceManager *SourceMgr, if (DL.empty()) return 0; - llvm::SmallString<256> Fmt; + SmallString<256> Fmt; llvm::raw_svector_ostream OS(Fmt); for (DirectiveList::iterator I = DL.begin(), E = DL.end(); I != E; ++I) { Directive& D = **I; diff --git a/lib/Lex/HeaderMap.cpp b/lib/Lex/HeaderMap.cpp index 9a0b4e985e9067fc3d459ab4e212dea53e220f08..bbfc1df76fddd268f61c1718390508398785c8de 100644 --- a/lib/Lex/HeaderMap.cpp +++ b/lib/Lex/HeaderMap.cpp @@ -220,7 +220,7 @@ const FileEntry *HeaderMap::LookupFile( // If so, we have a match in the hash table. Construct the destination // path. - llvm::SmallString<1024> DestPath; + SmallString<1024> DestPath; DestPath += getString(B.Prefix); DestPath += getString(B.Suffix); return FM.getFile(DestPath.str()); diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index e3a6c52ff4debc5caf55b12d6ce03ecf5e1c9ddf..39b49a3682d1d859d2c37b3145e7077bcae53220 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/lib/Lex/HeaderSearch.cpp @@ -110,7 +110,7 @@ std::string HeaderSearch::getModuleFileName(Module *Module) { return std::string(); - llvm::SmallString<256> Result(ModuleCachePath); + SmallString<256> Result(ModuleCachePath); llvm::sys::path::append(Result, Module->getTopLevelModule()->Name + ".pcm"); return Result.str().str(); } @@ -121,7 +121,7 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName) { return std::string(); - llvm::SmallString<256> Result(ModuleCachePath); + SmallString<256> Result(ModuleCachePath); llvm::sys::path::append(Result, ModuleName + ".pcm"); return Result.str().str(); } @@ -137,7 +137,7 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) { for (unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) { if (SearchDirs[Idx].isFramework()) { // Search for or infer a module map for a framework. - llvm::SmallString<128> FrameworkDirName; + SmallString<128> FrameworkDirName; FrameworkDirName += SearchDirs[Idx].getFrameworkDir()->getName(); llvm::sys::path::append(FrameworkDirName, ModuleName + ".framework"); if (const DirectoryEntry *FrameworkDir @@ -167,7 +167,7 @@ Module *HeaderSearch::lookupModule(StringRef ModuleName, bool AllowSearch) { // Search for a module map in a subdirectory with the same name as the // module. - llvm::SmallString<128> NestedModuleMapDirName; + SmallString<128> NestedModuleMapDirName; NestedModuleMapDirName = SearchDirs[Idx].getDir()->getName(); llvm::sys::path::append(NestedModuleMapDirName, ModuleName); if (loadModuleMapFile(NestedModuleMapDirName) == LMM_NewlyLoaded) { @@ -205,7 +205,7 @@ const FileEntry *DirectoryLookup::LookupFile( SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, Module **SuggestedModule) const { - llvm::SmallString<1024> TmpDir; + SmallString<1024> TmpDir; if (isNormalDir()) { // Concatenate the requested file onto the directory. TmpDir = getDir()->getName(); @@ -286,7 +286,7 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup( // Otherwise, construct the path to this framework dir. // FrameworkName = "/System/Library/Frameworks/" - llvm::SmallString<1024> FrameworkName; + SmallString<1024> FrameworkName; FrameworkName += getFrameworkDir()->getName(); if (FrameworkName.empty() || FrameworkName.back() != '/') FrameworkName.push_back('/'); @@ -418,7 +418,7 @@ const FileEntry *HeaderSearch::LookupFile( // a subsequent include of "baz.h" should resolve to "whatever/foo/baz.h". // This search is not done for <> headers. if (CurFileEnt && !isAngled && !NoCurDirSearch) { - llvm::SmallString<1024> TmpDir; + SmallString<1024> TmpDir; // Concatenate the requested file onto the directory. // FIXME: Portability. Filename concatenation should be in sys::Path. TmpDir += CurFileEnt->getDir()->getName(); @@ -512,7 +512,7 @@ const FileEntry *HeaderSearch::LookupFile( if (CurFileEnt && !isAngled && Filename.find('/') == StringRef::npos) { HeaderFileInfo &IncludingHFI = getFileInfo(CurFileEnt); if (IncludingHFI.IndexHeaderMapHeader) { - llvm::SmallString<128> ScratchFilename; + SmallString<128> ScratchFilename; ScratchFilename += IncludingHFI.Framework; ScratchFilename += '/'; ScratchFilename += Filename; @@ -562,7 +562,7 @@ LookupSubframeworkHeader(StringRef Filename, FrameworkPos[DotFrameworkLen] != '\\')) return 0; - llvm::SmallString<1024> FrameworkName(ContextName, + SmallString<1024> FrameworkName(ContextName, FrameworkPos+DotFrameworkLen+1); // Append Frameworks/HIToolbox.framework/ @@ -601,7 +601,7 @@ LookupSubframeworkHeader(StringRef Filename, } // Check ".../Frameworks/HIToolbox.framework/Headers/HIToolbox.h" - llvm::SmallString<1024> HeadersFilename(FrameworkName); + SmallString<1024> HeadersFilename(FrameworkName); HeadersFilename += "Headers/"; if (SearchPath != NULL) { SearchPath->clear(); @@ -647,7 +647,7 @@ HeaderSearch::NormalizeDashIncludePath(StringRef File, FileManager &FileMgr) { // it has no file entry. For now, workaround this by using an // absolute path if we find the file here, and otherwise letting // header search handle it. - llvm::SmallString<128> Path(File); + SmallString<128> Path(File); llvm::sys::fs::make_absolute(Path); bool exists; if (llvm::sys::fs::exists(Path.str(), exists) || !exists) @@ -831,7 +831,7 @@ bool HeaderSearch::loadModuleMapFile(const FileEntry *File) { if (!Result && llvm::sys::path::filename(File->getName()) == "module.map") { // If the file we loaded was a module.map, look for the corresponding // module_private.map. - llvm::SmallString<128> PrivateFilename(Dir->getName()); + SmallString<128> PrivateFilename(Dir->getName()); llvm::sys::path::append(PrivateFilename, "module_private.map"); if (const FileEntry *PrivateFile = FileMgr.getFile(PrivateFilename)) Result = ModMap.parseModuleMapFile(PrivateFile); @@ -922,7 +922,7 @@ HeaderSearch::loadModuleMapFile(const DirectoryEntry *Dir) { if (KnownDir != DirectoryHasModuleMap.end()) return KnownDir->second? LMM_AlreadyLoaded : LMM_InvalidModuleMap; - llvm::SmallString<128> ModuleMapFileName; + SmallString<128> ModuleMapFileName; ModuleMapFileName += Dir->getName(); unsigned ModuleMapDirNameLen = ModuleMapFileName.size(); llvm::sys::path::append(ModuleMapFileName, "module.map"); @@ -965,7 +965,7 @@ void HeaderSearch::collectAllModules(llvm::SmallVectorImpl<Module *> &Modules) { for (unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) { if (SearchDirs[Idx].isFramework()) { llvm::error_code EC; - llvm::SmallString<128> DirNative; + SmallString<128> DirNative; llvm::sys::path::native(SearchDirs[Idx].getFrameworkDir()->getName(), DirNative); @@ -997,7 +997,7 @@ void HeaderSearch::collectAllModules(llvm::SmallVectorImpl<Module *> &Modules) { // Try to load module map files for immediate subdirectories of this search // directory. llvm::error_code EC; - llvm::SmallString<128> DirNative; + SmallString<128> DirNative; llvm::sys::path::native(SearchDirs[Idx].getDir()->getName(), DirNative); for (llvm::sys::fs::directory_iterator Dir(DirNative.str(), EC), DirEnd; Dir != DirEnd && !EC; Dir.increment(EC)) { diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index 290455f3ca0437e4fd1d42cc4e2e0cd7f2d2354f..74c396ca965f5ce6966591574d3fc2703af7f641 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -1036,7 +1036,7 @@ void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){ ResultBuf.resize(SizeBound); // Likewise, but for each string piece. - llvm::SmallString<512> TokenBuf; + SmallString<512> TokenBuf; TokenBuf.resize(MaxTokenLength); // Loop over all the strings, getting their spelling, and expanding them to @@ -1245,7 +1245,7 @@ bool StringLiteralParser::CopyStringFragment(StringRef Fragment) { unsigned StringLiteralParser::getOffsetOfStringByte(const Token &Tok, unsigned ByteNo) const { // Get the spelling of the token. - llvm::SmallString<32> SpellingBuffer; + SmallString<32> SpellingBuffer; SpellingBuffer.resize(Tok.getLength()); bool StringInvalid = false; diff --git a/lib/Lex/MacroArgs.cpp b/lib/Lex/MacroArgs.cpp index 16ca52551c83f194191d0bc936bfb5ee19e6aaf6..d9a96a2890dc24a2d8fbe1bc8c32af79747f9e14 100644 --- a/lib/Lex/MacroArgs.cpp +++ b/lib/Lex/MacroArgs.cpp @@ -198,7 +198,7 @@ Token MacroArgs::StringifyArgument(const Token *ArgToks, const Token *ArgTokStart = ArgToks; // Stringify all the tokens. - llvm::SmallString<128> Result; + SmallString<128> Result; Result += "\""; bool isFirst = true; diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index c1c50660125fd1cbf8a0b1c1eafbc510d0168952..84ac08081ea4ea51e2563c6c79033951f33d93d4 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -299,7 +299,7 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName, FileManager &FileMgr = SourceMgr->getFileManager(); // Look for an umbrella header. - llvm::SmallString<128> UmbrellaName = StringRef(FrameworkDir->getName()); + SmallString<128> UmbrellaName = StringRef(FrameworkDir->getName()); llvm::sys::path::append(UmbrellaName, "Headers"); llvm::sys::path::append(UmbrellaName, ModuleName + ".h"); const FileEntry *UmbrellaHeader = FileMgr.getFile(UmbrellaName); @@ -332,10 +332,10 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName, // Look for subframeworks. llvm::error_code EC; - llvm::SmallString<128> SubframeworksDirName + SmallString<128> SubframeworksDirName = StringRef(FrameworkDir->getName()); llvm::sys::path::append(SubframeworksDirName, "Frameworks"); - llvm::SmallString<128> SubframeworksDirNameNative; + SmallString<128> SubframeworksDirNameNative; llvm::sys::path::native(SubframeworksDirName.str(), SubframeworksDirNameNative); for (llvm::sys::fs::directory_iterator @@ -1082,7 +1082,7 @@ void ModuleMapParser::parseHeaderDecl(SourceLocation UmbrellaLoc) { // Look for this file. const FileEntry *File = 0; const FileEntry *BuiltinFile = 0; - llvm::SmallString<128> PathName; + SmallString<128> PathName; if (llvm::sys::path::is_absolute(FileName)) { PathName = FileName; File = SourceMgr.getFileManager().getFile(PathName); @@ -1120,7 +1120,7 @@ void ModuleMapParser::parseHeaderDecl(SourceLocation UmbrellaLoc) { // supplied by Clang. Find that builtin header. if (ActiveModule->IsSystem && !Umbrella && BuiltinIncludeDir && BuiltinIncludeDir != Directory && isBuiltinHeader(FileName)) { - llvm::SmallString<128> BuiltinPathName(BuiltinIncludeDir->getName()); + SmallString<128> BuiltinPathName(BuiltinIncludeDir->getName()); llvm::sys::path::append(BuiltinPathName, FileName); BuiltinFile = SourceMgr.getFileManager().getFile(BuiltinPathName); @@ -1196,7 +1196,7 @@ void ModuleMapParser::parseUmbrellaDirDecl(SourceLocation UmbrellaLoc) { if (llvm::sys::path::is_absolute(DirName)) Dir = SourceMgr.getFileManager().getDirectory(DirName); else { - llvm::SmallString<128> PathName; + SmallString<128> PathName; PathName = Directory->getName(); llvm::sys::path::append(PathName, DirName); Dir = SourceMgr.getFileManager().getDirectory(PathName); diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 9f2309e801daf52204bed688a8ece9e6bb45cb08..748bc38054ddc8cbaaa8a61a64a628609d22571e 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -738,7 +738,7 @@ static bool GetLineValue(Token &DigitTok, unsigned &Val, return true; } - llvm::SmallString<64> IntegerBuffer; + SmallString<64> IntegerBuffer; IntegerBuffer.resize(DigitTok.getLength()); const char *DigitTokBegin = &IntegerBuffer[0]; bool Invalid = false; @@ -1173,7 +1173,7 @@ bool Preprocessor::GetIncludeFilenameSpelling(SourceLocation Loc, /// false if the > was found, otherwise it returns true if it finds and consumes /// the EOD marker. bool Preprocessor::ConcatenateIncludeName( - llvm::SmallString<128> &FilenameBuffer, + SmallString<128> &FilenameBuffer, SourceLocation &End) { Token CurTok; @@ -1235,7 +1235,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, CurPPLexer->LexIncludeFilename(FilenameTok); // Reserve a buffer to get the spelling. - llvm::SmallString<128> FilenameBuffer; + SmallString<128> FilenameBuffer; StringRef Filename; SourceLocation End; SourceLocation CharEnd; // the end of this directive, in characters @@ -1299,8 +1299,8 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Search include directories. const DirectoryLookup *CurDir; - llvm::SmallString<1024> SearchPath; - llvm::SmallString<1024> RelativePath; + SmallString<1024> SearchPath; + SmallString<1024> RelativePath; // We get the raw path only if we have 'Callbacks' to which we later pass // the path. Module *SuggestedModule = 0; @@ -1312,7 +1312,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, if (Callbacks) { if (!File) { // Give the clients a chance to recover. - llvm::SmallString<128> RecoveryPath; + SmallString<128> RecoveryPath; if (Callbacks->FileNotFound(Filename, RecoveryPath)) { if (const DirectoryEntry *DE = FileMgr.getDirectory(RecoveryPath)) { // Add the recovery path to the list of search paths. @@ -1351,7 +1351,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, std::reverse(Path.begin(), Path.end()); // Warn that we're replacing the include/import with a module import. - llvm::SmallString<128> PathString; + SmallString<128> PathString; for (unsigned I = 0, N = Path.size(); I != N; ++I) { if (I) PathString += '.'; diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 4ce48e003c9e46c55270aeaa5fe13a534db7eab8..c4ab143aaa46d97afaac290262fd446de1f31f9b 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -197,7 +197,7 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, PP.Diag(PeekTok, diag::err_pp_expected_value_in_expr); return true; case tok::numeric_constant: { - llvm::SmallString<64> IntegerBuffer; + SmallString<64> IntegerBuffer; bool NumberInvalid = false; StringRef Spelling = PP.getSpelling(PeekTok, IntegerBuffer, &NumberInvalid); @@ -251,7 +251,7 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, case tok::wide_char_constant: { // L'x' case tok::utf16_char_constant: // u'x' case tok::utf32_char_constant: // U'x' - llvm::SmallString<32> CharBuffer; + SmallString<32> CharBuffer; bool CharInvalid = false; StringRef ThisTok = PP.getSpelling(PeekTok, CharBuffer, &CharInvalid); if (CharInvalid) diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index 11c78703a4453a1bc638ef7b8fbd4b02a403ffdd..3056e0c41a0608638f47b3c28d22421c9fa0668c 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -206,7 +206,7 @@ void Preprocessor::EnterTokenStream(const Token *Toks, unsigned NumToks, /// the given directory. static void computeRelativePath(FileManager &FM, const DirectoryEntry *Dir, const FileEntry *File, - llvm::SmallString<128> &Result) { + SmallString<128> &Result) { Result.clear(); StringRef FilePath = File->getDir()->getName(); @@ -375,7 +375,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { if (!getSourceManager().hasFileInfo(Header)) { if (!ModMap.isHeaderInUnavailableModule(Header)) { // Find the relative path that would access this header. - llvm::SmallString<128> RelativePath; + SmallString<128> RelativePath; computeRelativePath(FileMgr, Dir, Header, RelativePath); Diag(StartLoc, diag::warn_uncovered_module_header) << RelativePath; diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 8793ff5ac9a9fc631e6dbc91bb237c176b2bb67b..3fe3ab3b195d097a3a9bb79d2c4762cadbeea3c0 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -776,7 +776,7 @@ static bool EvaluateHasIncludeCommon(Token &Tok, PP.getCurrentLexer()->LexIncludeFilename(Tok); // Reserve a buffer to get the spelling. - llvm::SmallString<128> FilenameBuffer; + SmallString<128> FilenameBuffer; StringRef Filename; SourceLocation EndLoc; @@ -878,7 +878,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { ++NumBuiltinMacroExpanded; - llvm::SmallString<128> TmpBuffer; + SmallString<128> TmpBuffer; llvm::raw_svector_ostream OS(TmpBuffer); // Set up the return result. @@ -925,7 +925,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { } // Escape this filename. Turn '\' -> '\\' '"' -> '\"' - llvm::SmallString<128> FN; + SmallString<128> FN; if (PLoc.isValid()) { FN += PLoc.getFilename(); Lexer::Stringify(FN); diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 1ccfe8c2c9bccf325586ce2e1a4558ddc5c08f2b..503fffe53d9b901d00ca7377eb5981f5df3c1694 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -353,7 +353,7 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) { return; // Reserve a buffer to get the spelling. - llvm::SmallString<128> FilenameBuffer; + SmallString<128> FilenameBuffer; bool Invalid = false; StringRef Filename = getSpelling(FilenameTok, FilenameBuffer, &Invalid); if (Invalid) diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index b6653fc5752448abdc5f772d83a201bb2c257b77..7033e9c854c8d6bc2db32e913b78b3a39d84b3aa 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -470,7 +470,7 @@ IdentifierInfo *Preprocessor::LookUpIdentifierInfo(Token &Identifier) const { Identifier.getLength())); } else { // Cleaning needed, alloca a buffer, clean into it, then use the buffer. - llvm::SmallString<64> IdentifierBuffer; + SmallString<64> IdentifierBuffer; StringRef CleanedStr = getSpelling(Identifier, IdentifierBuffer); II = getIdentifierInfo(CleanedStr); } diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp index e036c422e8d83e9e33611b7241eac3d850f71bcf..5102cce3c8b8d8326c16948f6cc99ae2acb68fce 100644 --- a/lib/Lex/TokenLexer.cpp +++ b/lib/Lex/TokenLexer.cpp @@ -450,7 +450,7 @@ void TokenLexer::Lex(Token &Tok) { /// are more ## after it, chomp them iteratively. Return the result as Tok. /// If this returns true, the caller should immediately return the token. bool TokenLexer::PasteTokens(Token &Tok) { - llvm::SmallString<128> Buffer; + SmallString<128> Buffer; const char *ResultTokStrPtr = 0; SourceLocation StartLoc = Tok.getLocation(); SourceLocation PasteOpLoc; diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 7b9772dd409a9bfebf66aebfb8fb16d03dc6f7fc..8247b0b4d6ad05b61821d6005631f4d2b2e8406a 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -434,7 +434,7 @@ VersionTuple Parser::ParseVersionTuple(SourceRange &Range) { // are stored in the numeric constant. We utilize a quirk of the // lexer, which is that it handles something like 1.2.3 as a single // numeric constant, rather than two separate tokens. - llvm::SmallString<512> Buffer; + SmallString<512> Buffer; Buffer.resize(Tok.getLength()+1); const char *ThisTokBegin = &Buffer[0]; diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index e1a1150cc36b39f98be01c80ae97df57b024a5f1..c1ebf91ef84bbe7c81026423473d261d3a512d33 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -266,7 +266,7 @@ Decl *Parser::ParseNamespaceAlias(SourceLocation NamespaceLoc, /// Decl *Parser::ParseLinkage(ParsingDeclSpec &DS, unsigned Context) { assert(Tok.is(tok::string_literal) && "Not a string literal!"); - llvm::SmallString<8> LangBuffer; + SmallString<8> LangBuffer; bool Invalid = false; StringRef Lang = PP.getSpelling(Tok, LangBuffer, &Invalid); if (Invalid) diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp index ba7a024ac59ef4737c3c6b0190bee4fef32cacfb..39049d16bdfca4c332e11452100d59845c793cfd 100644 --- a/lib/Parse/ParseInit.cpp +++ b/lib/Parse/ParseInit.cpp @@ -81,7 +81,7 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() { if (Tok.is(tok::identifier)) { const IdentifierInfo *FieldName = Tok.getIdentifierInfo(); - llvm::SmallString<256> NewSyntax; + SmallString<256> NewSyntax; llvm::raw_svector_ostream(NewSyntax) << '.' << FieldName->getName() << " = "; diff --git a/lib/Rewrite/FrontendActions.cpp b/lib/Rewrite/FrontendActions.cpp index 7e7790eea8d7f03822b756004655ba2421c9a5d9..6e84566dd3c6bd6c5c43444ab1c23c7e3eb35885 100644 --- a/lib/Rewrite/FrontendActions.cpp +++ b/lib/Rewrite/FrontendActions.cpp @@ -65,7 +65,7 @@ public: std::string RewriteFilename(const std::string &Filename, int &fd) { fd = -1; - llvm::SmallString<128> Path(Filename); + SmallString<128> Path(Filename); llvm::sys::path::replace_extension(Path, NewSuffix + llvm::sys::path::extension(Path)); return Path.str(); @@ -75,11 +75,11 @@ public: class FixItRewriteToTemp : public FixItOptions { public: std::string RewriteFilename(const std::string &Filename, int &fd) { - llvm::SmallString<128> Path; + SmallString<128> Path; Path = llvm::sys::path::filename(Filename); Path += "-%%%%%%%%"; Path += llvm::sys::path::extension(Filename); - llvm::SmallString<128> NewPath; + SmallString<128> NewPath; llvm::sys::fs::unique_file(Path.str(), fd, NewPath); return NewPath.str(); } diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index 77c99690401bfdf7e8b5d83880b80418d8ef044a..44d635a527c9fb761c4ae4e64c36da50f54e2ffa 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -210,7 +210,7 @@ std::string html::EscapeText(const std::string& s, bool EscapeSpaces, static void AddLineNumber(RewriteBuffer &RB, unsigned LineNo, unsigned B, unsigned E) { - llvm::SmallString<256> Str; + SmallString<256> Str; llvm::raw_svector_ostream OS(Str); OS << "<tr><td class=\"num\" id=\"LN" diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp index 3e1fd20ff4988834da686d94916fcd246bef410a..43fb01bb1c345b229172fc76610de7c570dcf408 100644 --- a/lib/Rewrite/Rewriter.cpp +++ b/lib/Rewrite/Rewriter.cpp @@ -236,7 +236,7 @@ bool Rewriter::InsertText(SourceLocation Loc, StringRef Str, FileID FID; unsigned StartOffs = getLocationOffsetAndFileID(Loc, FID); - llvm::SmallString<128> indentedStr; + SmallString<128> indentedStr; if (indentNewLines && Str.find('\n') != StringRef::npos) { StringRef MB = SourceMgr->getBufferData(FID); diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index c157d3ffc82276dc430a7bda7d1e5d4ee2b6a749..0796c0a185d4feef0a8e8e578e34c94d0b4aa566 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -260,7 +260,7 @@ const char *CodeCompletionAllocator::CopyString(Twine String) { // FIXME: It would be more efficient to teach Twine to tell us its size and // then add a routine there to fill in an allocated char* with the contents // of the string. - llvm::SmallString<128> Data; + SmallString<128> Data; return CopyString(String.toStringRef(Data)); } diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 505e1d190b8c935135ec6f93f29efc8fbd6e806e..a619293f8838a4292e2237433d24c32cc8a0650e 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -2185,7 +2185,7 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier if (success) { // Get the fix string from the fixed format specifier - llvm::SmallString<128> buf; + SmallString<128> buf; llvm::raw_svector_ostream os(buf); fixedFS.toString(os); @@ -2344,7 +2344,7 @@ bool CheckScanfHandler::HandleScanfSpecifier( if (success) { // Get the fix string from the fixed format specifier. - llvm::SmallString<128> buf; + SmallString<128> buf; llvm::raw_svector_ostream os(buf); fixedFS.toString(os); @@ -2675,7 +2675,7 @@ void Sema::CheckStrlcpycatArguments(const CallExpr *Call, return; } - llvm::SmallString<128> sizeString; + SmallString<128> sizeString; llvm::raw_svector_ostream OS(sizeString); OS << "sizeof("; DstArg->printPretty(OS, Context, 0, getPrintingPolicy()); @@ -2775,7 +2775,7 @@ void Sema::CheckStrncatArguments(const CallExpr *CE, return; } - llvm::SmallString<128> sizeString; + SmallString<128> sizeString; llvm::raw_svector_ostream OS(sizeString); OS << "sizeof("; DstArg->printPretty(OS, Context, 0, getPrintingPolicy()); diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 06c1c931578cfaf05f33c9c759506866ecceffc3..7d384486cbbb799957d5a3a808f08b09b1ffe1e0 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2474,7 +2474,7 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, Result.AddChunk(Chunk(CodeCompletionString::CK_Comma)); if (MI->isVariadic() && (A+1) == AEnd) { - llvm::SmallString<32> Arg = (*A)->getName(); + SmallString<32> Arg = (*A)->getName(); if (MI->isC99Varargs()) Arg += ", ..."; else diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index bb0ae843e356266454bf68ba9b6b7a42fd59395a..6b92b0ad67c6b67c464f8552a281a0daa81ea0a6 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6966,7 +6966,7 @@ void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D, for (int i = FTI.NumArgs; i != 0; /* decrement in loop */) { --i; if (FTI.ArgInfo[i].Param == 0) { - llvm::SmallString<256> Code; + SmallString<256> Code; llvm::raw_svector_ostream(Code) << " int " << FTI.ArgInfo[i].Ident->getName() << ";\n"; diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 7673f1d5f2989d4ab1de67d7abcdf8d5c136282f..a52d44c4f2e403cdfd395fe58654bba52bbad0a6 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2525,7 +2525,7 @@ BuildImplicitMemberInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor, // Create the iteration variable for this array index. IdentifierInfo *IterationVarName = 0; { - llvm::SmallString<8> Str; + SmallString<8> Str; llvm::raw_svector_ostream OS(Str); OS << "__i" << IndexVariables.size(); IterationVarName = &SemaRef.Context.Idents.get(OS.str()); @@ -7651,7 +7651,7 @@ BuildSingleCopyAssign(Sema &S, SourceLocation Loc, QualType T, // Create the iteration variable. IdentifierInfo *IterationVarName = 0; { - llvm::SmallString<8> Str; + SmallString<8> Str; llvm::raw_svector_ostream OS(Str); OS << "__i" << Depth; IterationVarName = &S.Context.Idents.get(OS.str()); diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index 437474d4d6bd402ff9e2ac26fcacd968e4339428..8b6fcaa2b8029ab2a63c310b950aa61af0093615 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/lib/Sema/SemaExceptionSpec.cpp @@ -187,7 +187,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { } // Warn about the lack of exception specification. - llvm::SmallString<128> ExceptionSpecString; + SmallString<128> ExceptionSpecString; llvm::raw_svector_ostream OS(ExceptionSpecString); switch (OldProto->getExceptionSpecType()) { case EST_DynamicNone: diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 3056156951e0ba508a8a8c5f054296d1b401df4b..2a9fd61d9c2c67509ed8a14a49b6cb608ff37219 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -2369,7 +2369,7 @@ ExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc, tok::TokenKind Kind) { } ExprResult Sema::ActOnCharacterConstant(const Token &Tok) { - llvm::SmallString<16> CharBuffer; + SmallString<16> CharBuffer; bool Invalid = false; StringRef ThisTok = PP.getSpelling(Tok, CharBuffer, &Invalid); if (Invalid) @@ -2414,7 +2414,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { Context.IntTy, Tok.getLocation())); } - llvm::SmallString<512> IntegerBuffer; + SmallString<512> IntegerBuffer; // Add padding so that NumericLiteralParser can overread by one character. IntegerBuffer.resize(Tok.getLength()+1); const char *ThisTokBegin = &IntegerBuffer[0]; @@ -2453,7 +2453,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok) { if ((result & APFloat::opOverflow) || ((result & APFloat::opUnderflow) && Val.isZero())) { unsigned diagnostic; - llvm::SmallString<20> buffer; + SmallString<20> buffer; if (result & APFloat::opOverflow) { diagnostic = diag::warn_float_overflow; APFloat::getLargest(Format).toString(buffer); @@ -6147,7 +6147,7 @@ static void DiagnoseBadShiftValues(Sema& S, ExprResult &LHS, ExprResult &RHS, // Print the bit representation of the signed integer as an unsigned // hexadecimal number. - llvm::SmallString<40> HexResult; + SmallString<40> HexResult; Result.toString(HexResult, 16, /*Signed =*/false, /*Literal =*/true); // If we are only missing a sign bit, this is less likely to result in actual diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 04aa45576ec521489ed28bad65a7b2f1e3fff8f6..9b33b1e5f1e422e406d5103b90d1be1c0ca18588 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -43,7 +43,7 @@ ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs, // If we have a multi-part string, merge it all together. if (NumStrings != 1) { // Concatenate objc strings. - llvm::SmallString<128> StrBuf; + SmallString<128> StrBuf; SmallVector<SourceLocation, 8> StrLocs; for (unsigned i = 0; i != NumStrings; ++i) { diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 406f524e04175466e6e5885df4afdd74e72d7a8a..ece019c3a790d0ff2163d02ab83466c2017901c9 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -5912,7 +5912,7 @@ static void DiagnoseNarrowingInInitList(Sema &S, InitializationSequence &Seq, break; } - llvm::SmallString<128> StaticCast; + SmallString<128> StaticCast; llvm::raw_svector_ostream OS(StaticCast); OS << "static_cast<"; if (const TypedefType *TT = EntityType->getAs<TypedefType>()) { diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 029352789f7116dce119ee7d076b431f83aec6f8..f9c064d99712b97425b5b3f7925d95569f2aa84a 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1341,7 +1341,7 @@ ObjCPropertyDecl *Sema::LookupPropertyDecl(const ObjCContainerDecl *CDecl, static IdentifierInfo * getDefaultSynthIvarName(ObjCPropertyDecl *Prop, ASTContext &Ctx) { - llvm::SmallString<128> ivarName; + SmallString<128> ivarName; { llvm::raw_svector_ostream os(ivarName); os << '_' << Prop->getIdentifier()->getName(); diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index e036cbfece0fb3a0c29f602751734f4ca7ba8bb9..86c5a5b1f842bad700122c1c9ddfeea8777e9837 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -6944,7 +6944,7 @@ std::string Sema::getTemplateArgumentBindingsText(const TemplateParameterList *Params, const TemplateArgument *Args, unsigned NumArgs) { - llvm::SmallString<128> Str; + SmallString<128> Str; llvm::raw_svector_ostream Out(Str); if (!Params || Params->size() == 0 || NumArgs == 0) diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 39ffbb4aa8d9d5c8c7a0b354f026ff5f85b25599..0e2f4d707018b78f6d2d02edadc409e2c9832981 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -192,7 +192,7 @@ bool PCHValidator::ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers, // have a #include entry for the PCH file itself (as normalized by the // preprocessor initialization). Find it and skip over it in the checking // below. - llvm::SmallString<256> PCHInclude; + SmallString<256> PCHInclude; PCHInclude += "#include \""; PCHInclude += HeaderSearch::NormalizeDashIncludePath(OriginalFileName, FileMgr); @@ -1050,10 +1050,10 @@ resolveFileRelativeToOriginalDir(const std::string &Filename, assert(OriginalDir != CurrDir && "No point trying to resolve the file if the PCH dir didn't change"); using namespace llvm::sys; - llvm::SmallString<128> filePath(Filename); + SmallString<128> filePath(Filename); fs::make_absolute(filePath); assert(path::is_absolute(OriginalDir)); - llvm::SmallString<128> currPCHPath(CurrDir); + SmallString<128> currPCHPath(CurrDir); path::const_iterator fileDirI = path::begin(path::parent_path(filePath)), fileDirE = path::end(path::parent_path(filePath)); @@ -1815,7 +1815,7 @@ ASTReader::ReadASTBlock(ModuleFile &F) { // Read information about the AST file. ModuleKind ImportedKind = (ModuleKind)Record[Idx++]; unsigned Length = Record[Idx++]; - llvm::SmallString<128> ImportedFile(Record.begin() + Idx, + SmallString<128> ImportedFile(Record.begin() + Idx, Record.begin() + Idx + Length); Idx += Length; diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index 24da01a33e1c7df8466611222096bc3e1cee3535..4292b0fd124ace573149e3a21291545181a39f4f 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -382,7 +382,7 @@ void ASTStmtReader::VisitStringLiteral(StringLiteral *E) { bool isPascal = Record[Idx++]; // Read string data - llvm::SmallString<16> Str(&Record[Idx], &Record[Idx] + Len); + SmallString<16> Str(&Record[Idx], &Record[Idx] + Len); E->setString(Reader.getContext(), Str.str(), kind, isPascal); Idx += Len; diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 507f7a017fccc827d6e3b4865945ea9306af4fc0..79fb3c7e776504b89e20b254f7c4dad5e695c1e4 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1016,7 +1016,7 @@ void ASTWriter::WriteMetadata(ASTContext &Context, StringRef isysroot, FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // File name unsigned FileAbbrevCode = Stream.EmitAbbrev(FileAbbrev); - llvm::SmallString<128> MainFilePath(MainFile->getName()); + SmallString<128> MainFilePath(MainFile->getName()); llvm::sys::fs::make_absolute(MainFilePath); @@ -1039,7 +1039,7 @@ void ASTWriter::WriteMetadata(ASTContext &Context, StringRef isysroot, Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // File name unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev); - llvm::SmallString<128> OutputPath(OutputFile); + SmallString<128> OutputPath(OutputFile); llvm::sys::fs::make_absolute(OutputPath); StringRef origDir = llvm::sys::path::parent_path(OutputPath); @@ -1136,7 +1136,7 @@ void ASTWriter::WriteStatCache(MemorizeStatCalls &StatCalls) { } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> StatCacheData; + SmallString<4096> StatCacheData; uint32_t BucketOffset; { llvm::raw_svector_ostream Out(StatCacheData); @@ -1353,7 +1353,7 @@ void ASTWriter::WriteHeaderSearch(const HeaderSearch &HS, StringRef isysroot) { } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> TableData; + SmallString<4096> TableData; uint32_t BucketOffset; { llvm::raw_svector_ostream Out(TableData); @@ -1471,7 +1471,7 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr, // Turn the file name into an absolute path, if it isn't already. const char *Filename = Content->OrigEntry->getName(); - llvm::SmallString<128> FilePath(Filename); + SmallString<128> FilePath(Filename); // Ask the file manager to fixup the relative path for us. This will // honor the working directory. @@ -1820,7 +1820,7 @@ void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) { Record.push_back(ID->getFileName().size()); Record.push_back(ID->wasInQuotes()); Record.push_back(static_cast<unsigned>(ID->getKind())); - llvm::SmallString<64> Buffer; + SmallString<64> Buffer; Buffer += ID->getFileName(); Buffer += ID->getFile()->getName(); Stream.EmitRecordWithBlob(InclusionAbbrev, Record, Buffer); @@ -2372,7 +2372,7 @@ void ASTWriter::WriteSelectors(Sema &SemaRef) { } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> MethodPool; + SmallString<4096> MethodPool; uint32_t BucketOffset; { ASTMethodPoolTrait Trait(*this); @@ -2600,7 +2600,7 @@ void ASTWriter::WriteIdentifierTable(Preprocessor &PP, } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> IdentifierTable; + SmallString<4096> IdentifierTable; uint32_t BucketOffset; { ASTIdentifierTableTrait Trait(*this, PP, IdResolver, IsModule); @@ -2830,7 +2830,7 @@ uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context, } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> LookupTable; + SmallString<4096> LookupTable; uint32_t BucketOffset; { llvm::raw_svector_ostream Out(LookupTable); @@ -2876,7 +2876,7 @@ void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) { } // Create the on-disk hash table in a buffer. - llvm::SmallString<4096> LookupTable; + SmallString<4096> LookupTable; uint32_t BucketOffset; { llvm::raw_svector_ostream Out(LookupTable); @@ -3420,7 +3420,7 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, Abbrev->Add(BitCodeAbbrevOp(MODULE_OFFSET_MAP)); Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); unsigned ModuleOffsetMapAbbrev = Stream.EmitAbbrev(Abbrev); - llvm::SmallString<2048> Buffer; + SmallString<2048> Buffer; { llvm::raw_svector_ostream Out(Buffer); for (ModuleManager::ModuleConstIterator M = Chain->ModuleMgr.begin(), diff --git a/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp b/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp index 52fe6de81ef880709561394dbeca4c6437c51122..abc76b1ed7b47e78d5b1155028aa272543fc954a 100644 --- a/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp @@ -74,7 +74,7 @@ void AnalyzerStatsChecker::checkEndAnalysis(ExplodedGraph &G, unreachable--; // Generate the warning string - llvm::SmallString<128> buf; + SmallString<128> buf; llvm::raw_svector_ostream output(buf); PresumedLoc Loc = SM.getPresumedLoc(D->getLocation()); if (Loc.isValid()) { diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp index 2d49027dac97bf13e6c52c4a63b38c55b73c2758..c6efe941ec21b81038aa8722a9d2a856996cc98a 100644 --- a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp +++ b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp @@ -193,7 +193,7 @@ void ArrayBoundCheckerV2::reportOOB(CheckerContext &checkerContext, // FIXME: This diagnostics are preliminary. We should get far better // diagnostics for explaining buffer overruns. - llvm::SmallString<256> buf; + SmallString<256> buf; llvm::raw_svector_ostream os(buf); os << "Out of bound memory access "; switch (kind) { diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 615ddbf085b31eff5b2aa9968db49be36777f48c..1af43d1a337e3b8d3b930ea4d16ec0679478953a 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -89,7 +89,7 @@ void NilArgChecker::WarnNilArg(CheckerContext &C, BT.reset(new APIMisuse("nil argument")); if (ExplodedNode *N = C.generateSink()) { - llvm::SmallString<128> sbuf; + SmallString<128> sbuf; llvm::raw_svector_ostream os(sbuf); os << "Argument to '" << GetReceiverNameType(msg) << "' method '" << msg.getSelector().getAsString() << "' cannot be nil"; @@ -316,7 +316,7 @@ void CFNumberCreateChecker::checkPreStmt(const CallExpr *CE, // if (ExplodedNode *N = SourceSize < TargetSize ? C.generateSink() : C.addTransition()) { - llvm::SmallString<128> sbuf; + SmallString<128> sbuf; llvm::raw_svector_ostream os(sbuf); os << (SourceSize == 8 ? "An " : "A ") @@ -461,7 +461,7 @@ void ClassReleaseChecker::checkPreObjCMessage(ObjCMessage msg, return; if (ExplodedNode *N = C.addTransition()) { - llvm::SmallString<200> buf; + SmallString<200> buf; llvm::raw_svector_ostream os(buf); os << "The '" << S.getAsString() << "' message should be sent to instances " @@ -615,7 +615,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(ObjCMessage msg, if (!errorNode.getValue()) continue; - llvm::SmallString<128> sbuf; + SmallString<128> sbuf; llvm::raw_svector_ostream os(sbuf); if (const char *TypeName = GetReceiverNameType(msg)) diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index 5ced73a6ddb1c068a46ed068b03b40859288f9ca..7518b96c63b56cc05863c3fc3d56786f5065c641 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -223,7 +223,7 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C, BT_Null.reset(new BuiltinBug("API", "Null pointer argument in call to byte string function")); - llvm::SmallString<80> buf; + SmallString<80> buf; llvm::raw_svector_ostream os(buf); assert(CurrentFunctionDescription); os << "Null pointer argument in call to " << CurrentFunctionDescription; @@ -295,7 +295,7 @@ ProgramStateRef CStringChecker::CheckLocation(CheckerContext &C, assert(CurrentFunctionDescription); assert(CurrentFunctionDescription[0] != '\0'); - llvm::SmallString<80> buf; + SmallString<80> buf; llvm::raw_svector_ostream os(buf); os << (char)toupper(CurrentFunctionDescription[0]) << &CurrentFunctionDescription[1] @@ -669,7 +669,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state, BT_NotCString.reset(new BuiltinBug("API", "Argument is not a null-terminated string.")); - llvm::SmallString<120> buf; + SmallString<120> buf; llvm::raw_svector_ostream os(buf); assert(CurrentFunctionDescription); os << "Argument to " << CurrentFunctionDescription @@ -726,7 +726,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state, BT_NotCString.reset(new BuiltinBug("API", "Argument is not a null-terminated string.")); - llvm::SmallString<120> buf; + SmallString<120> buf; llvm::raw_svector_ostream os(buf); assert(CurrentFunctionDescription); diff --git a/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp index 23c53d2c302df09e79b34e3d2ef3df30022c92be..6005ecdf51c39e21314269ef1348cad34d8d3f8b 100644 --- a/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp @@ -146,7 +146,7 @@ void WalkAST::VisitCallExpr(CallExpr *CE) { StringRef DstName = getPrintableName(DstArg); - llvm::SmallString<256> S; + SmallString<256> S; llvm::raw_svector_ostream os(S); os << "Potential buffer overflow. "; if (!DstName.empty()) { diff --git a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp index 4c7c3883e0662a861fcea0903dc35240aae1fd06..88a3be4139c49c02e0b9ce549e9742c668815798 100644 --- a/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp @@ -155,7 +155,7 @@ bool CallAndMessageChecker::PreVisitProcessArg(CheckerContext &C, if (F.Find(D->getRegion())) { if (ExplodedNode *N = C.generateSink()) { LazyInit_BT(BT_desc, BT); - llvm::SmallString<512> Str; + SmallString<512> Str; llvm::raw_svector_ostream os(Str); os << "Passed-by-value struct argument contains uninitialized data"; @@ -271,7 +271,7 @@ void CallAndMessageChecker::emitNilReceiverBug(CheckerContext &C, new BuiltinBug("Receiver in message expression is " "'nil' and returns a garbage value")); - llvm::SmallString<200> buf; + SmallString<200> buf; llvm::raw_svector_ostream os(buf); os << "The receiver of message '" << msg.getSelector().getAsString() << "' is nil and returns a value of type '" diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index b834d9cb43ce86828d1790b61b3d9db9269980b5..10f86a13ffa6d2ae2d598e8709e4aebef7944bca 100644 --- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -272,7 +272,7 @@ void WalkAST::checkLoopConditionForFloat(const ForStmt *FS) { const DeclRefExpr *drCond = vdLHS == drInc->getDecl() ? drLHS : drRHS; SmallVector<SourceRange, 2> ranges; - llvm::SmallString<256> sbuf; + SmallString<256> sbuf; llvm::raw_svector_ostream os(sbuf); os << "Variable '" << drCond->getDecl()->getName() @@ -476,7 +476,7 @@ void WalkAST::checkCall_mkstemp(const CallExpr *CE, const FunctionDecl *FD) { SourceRange R = strArg->getSourceRange(); PathDiagnosticLocation CELoc = PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), AC); - llvm::SmallString<512> buf; + SmallString<512> buf; llvm::raw_svector_ostream out(buf); out << "Call to '" << Name << "' should have at least 6 'X's in the" " format string to be secure (" << numX << " 'X'"; @@ -606,11 +606,11 @@ void WalkAST::checkCall_rand(const CallExpr *CE, const FunctionDecl *FD) { return; // Issue a warning. - llvm::SmallString<256> buf1; + SmallString<256> buf1; llvm::raw_svector_ostream os1(buf1); os1 << '\'' << *FD << "' is a poor random number generator"; - llvm::SmallString<256> buf2; + SmallString<256> buf2; llvm::raw_svector_ostream os2(buf2); os2 << "Function '" << *FD << "' is obsolete because it implements a poor random number generator." @@ -723,11 +723,11 @@ void WalkAST::checkUncheckedReturnValue(CallExpr *CE) { return; // Issue a warning. - llvm::SmallString<256> buf1; + SmallString<256> buf1; llvm::raw_svector_ostream os1(buf1); os1 << "Return value is not checked in call to '" << *FD << '\''; - llvm::SmallString<256> buf2; + SmallString<256> buf2; llvm::raw_svector_ostream os2(buf2); os2 << "The return value from the call to '" << *FD << "' is not checked. If an error occurs in '" << *FD diff --git a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 5a1e8b0a5ad76a71b3160cd1e3d03e62af450f34..7202a1ff3af4a50809f54ca5eb6f9060687273f0 100644 --- a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -105,7 +105,7 @@ public: if (!reachableCode->isReachable(currentBlock)) return; - llvm::SmallString<64> buf; + SmallString<64> buf; llvm::raw_svector_ostream os(buf); const char *BugType = 0; diff --git a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp index ed04f8634150d375f7ce4dd067d97980fbf8236a..7e4761cdf8f91c746c4aa2aa50981473cbe4241c 100644 --- a/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp @@ -108,7 +108,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S, if (!BT_null) BT_null.reset(new BuiltinBug("Dereference of null pointer")); - llvm::SmallString<100> buf; + SmallString<100> buf; SmallVector<SourceRange, 2> Ranges; // Walk through lvalue casts to get the original expression diff --git a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp index d77d4d620f398cc1048e46fa976bb9392fc84ea9..df47b04e379c0c2bdb55547bf4a77388c8fd34b1 100644 --- a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp @@ -376,7 +376,7 @@ void IdempotentOperationChecker::checkEndAnalysis(ExplodedGraph &G, } // Select the error message and SourceRanges to report. - llvm::SmallString<128> buf; + SmallString<128> buf; llvm::raw_svector_ostream os(buf); bool LHSRelevant = false, RHSRelevant = false; switch (A) { diff --git a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp index 93783fac4951acc9973190ab0b7f2d9c98289ec6..3e0ef21c963eb22f55c9cad6dcb99e1d96ad71d2 100644 --- a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp @@ -252,7 +252,7 @@ void ASTFieldVisitor::Visit(FieldDecl *D) { } void ASTFieldVisitor::ReportError(QualType T) { - llvm::SmallString<1024> buf; + SmallString<1024> buf; llvm::raw_svector_ostream os(buf); os << "AST class '" << Root->getName() << "' has a field '" diff --git a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp index 83eff9d1d4f062496f28ecac6e23c91fdaa19f84..e5f99307a5c61e68c24876d5fb67ff4d20aabcfc 100644 --- a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -267,7 +267,7 @@ void MacOSKeychainAPIChecker:: if (!N) return; initBugType(); - llvm::SmallString<80> sbuf; + SmallString<80> sbuf; llvm::raw_svector_ostream os(sbuf); unsigned int PDeallocIdx = FunctionsToTrack[AP.second->AllocatorIdx].DeallocatorIdx; @@ -303,7 +303,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE, if (!N) return; initBugType(); - llvm::SmallString<128> sbuf; + SmallString<128> sbuf; llvm::raw_svector_ostream os(sbuf); unsigned int DIdx = FunctionsToTrack[AS->AllocatorIdx].DeallocatorIdx; os << "Allocated data should be released before another call to " @@ -498,7 +498,7 @@ BugReport *MacOSKeychainAPIChecker:: ExplodedNode *N) const { const ADFunctionInfo &FI = FunctionsToTrack[AP.second->AllocatorIdx]; initBugType(); - llvm::SmallString<70> sbuf; + SmallString<70> sbuf; llvm::raw_svector_ostream os(sbuf); os << "Allocated data is not released: missing a call to '" diff --git a/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp index 075e937f465260b08b87833b56bd07fd955b24f8..cfdb55df730d9831b3e3668234002159e564f8a8 100644 --- a/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp @@ -70,7 +70,7 @@ void MacOSXAPIChecker::CheckDispatchOnce(CheckerContext &C, const CallExpr *CE, BT_dispatchOnce.reset(new BugType("Improper use of 'dispatch_once'", "Mac OS X API")); - llvm::SmallString<256> S; + SmallString<256> S; llvm::raw_svector_ostream os(S); os << "Call to '" << FName << "' uses"; if (const VarRegion *VR = dyn_cast<VarRegion>(R)) diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index a8bfbcdfff8710110cd5fe75f7187febed6ac055..4efcee2314cc0ad2f81f296d4ad79a51c6b0264c 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -468,7 +468,7 @@ void MallocChecker::ReportBadFree(CheckerContext &C, SVal ArgVal, if (!BT_BadFree) BT_BadFree.reset(new BuiltinBug("Bad free")); - llvm::SmallString<100> buf; + SmallString<100> buf; llvm::raw_svector_ostream os(buf); const MemRegion *MR = ArgVal.getAsRegion(); diff --git a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp index 17f88a54b2bdd3e51e9f1e74a72fd740fbaf2d3b..28f89931809da2850f1d45f3ea8e010cb8e54a16 100644 --- a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp @@ -175,7 +175,7 @@ public: TSI = i->ExplicitCastType; } - llvm::SmallString<64> buf; + SmallString<64> buf; llvm::raw_svector_ostream OS(buf); OS << "Result of '" diff --git a/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp index f842d289f6c4ca54f1ae9f1246ba28f97236d5df..5508a497844042e6874d7036d91af7ee3b0c93e0 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp @@ -128,12 +128,12 @@ void WalkAST::VisitCallExpr(CallExpr *CE) { if (ArgNum != InvalidArgIndex) { assert(ArgNum == 1 || ArgNum == 2); - llvm::SmallString<256> BufName; + SmallString<256> BufName; llvm::raw_svector_ostream OsName(BufName); assert(ArgNum == 1 || ArgNum == 2); OsName << " Invalid use of '" << Name << "'" ; - llvm::SmallString<256> Buf; + SmallString<256> Buf; llvm::raw_svector_ostream Os(Buf); Os << " The "<< ((ArgNum == 1) ? "first" : "second") << " argument to '" << Name << "' must be a C array of pointer-sized values, not '" diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index bfd86a3791f5fbdceafe9779d7b03d40db275d46..6622e6e06d68b6bc228e0d2c4bf65f02d296ccb6 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -3373,7 +3373,7 @@ RetainCountChecker::handleAutoreleaseCounts(ProgramStateRef state, state = state->set<RefBindings>(Sym, V); if (ExplodedNode *N = Bd.MakeNode(state, Pred, true)) { - llvm::SmallString<128> sbuf; + SmallString<128> sbuf; llvm::raw_svector_ostream os(sbuf); os << "Object over-autoreleased: object was sent -autorelease "; if (V.getAutoreleaseCount() > 1) @@ -3467,7 +3467,7 @@ const ProgramPointTag * RetainCountChecker::getDeadSymbolTag(SymbolRef sym) const { const SimpleProgramPointTag *&tag = DeadSymbolTags[sym]; if (!tag) { - llvm::SmallString<64> buf; + SmallString<64> buf; llvm::raw_svector_ostream out(buf); out << "RetainCountChecker : Dead Symbol : "; sym->dumpToStream(out); diff --git a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp index 3046f967c44cfdc153a3a3369a0ad72ad6452f94..d071ef8c1f748ecb7d0f716154fd33761f265c8a 100644 --- a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -100,7 +100,7 @@ void StackAddrEscapeChecker::EmitStackError(CheckerContext &C, const MemRegion * new BuiltinBug("Return of address to stack-allocated memory")); // Generate a report for this bug. - llvm::SmallString<512> buf; + SmallString<512> buf; llvm::raw_svector_ostream os(buf); SourceRange range = GenName(os, R, C.getSourceManager()); os << " returned to caller"; @@ -201,7 +201,7 @@ void StackAddrEscapeChecker::checkEndPath(CheckerContext &Ctx) const { for (unsigned i = 0, e = cb.V.size(); i != e; ++i) { // Generate a report for this bug. - llvm::SmallString<512> buf; + SmallString<512> buf; llvm::raw_svector_ostream os(buf); SourceRange range = GenName(os, cb.V[i].second, Ctx.getSourceManager()); diff --git a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp index 0be5cf1feb99c8ccd4e85f63508ab07acbca4f77..8a46035feec8f3fe0d93c2545c049c980ead1532 100644 --- a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp @@ -84,7 +84,7 @@ UndefCapturedBlockVarChecker::checkPostStmt(const BlockExpr *BE, BT.reset(new BuiltinBug("uninitialized variable captured by block")); // Generate a bug report. - llvm::SmallString<128> buf; + SmallString<128> buf; llvm::raw_svector_ostream os(buf); os << "Variable '" << VD->getName() diff --git a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp index c3cc2b591cbd06655c3a3d8951b91142130bb4d2..3161a21c93107ebf4d773f2e4dfa5c84df509f3b 100644 --- a/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp @@ -47,7 +47,7 @@ void UndefResultChecker::checkPostStmt(const BinaryOperator *B, if (!BT) BT.reset(new BuiltinBug("Result of operation is garbage or undefined")); - llvm::SmallString<256> sbuf; + SmallString<256> sbuf; llvm::raw_svector_ostream OS(sbuf); const Expr *Ex = NULL; bool isLeft = true; diff --git a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp index c4f77290f94793ec914dcbf7e31ecd35600efc34..2211940d652a0466ca964ec8bfdeb2667293457f 100644 --- a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp @@ -167,7 +167,7 @@ void UnixAPIChecker::CheckPthreadOnce(CheckerContext &C, if (!N) return; - llvm::SmallString<256> S; + SmallString<256> S; llvm::raw_svector_ostream os(S); os << "Call to 'pthread_once' uses"; if (const VarRegion *VR = dyn_cast<VarRegion>(R)) @@ -218,7 +218,7 @@ bool UnixAPIChecker::ReportZeroByteAllocation(CheckerContext &C, LazyInitialize(BT_mallocZero, "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)"); - llvm::SmallString<256> S; + SmallString<256> S; llvm::raw_svector_ostream os(S); os << "Call to '" << fn_name << "' has an allocation size of 0 bytes"; BugReport *report = new BugReport(*BT_mallocZero, os.str(), N); diff --git a/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp b/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp index d5276aa0987c6829c6dc13b5b9ccf713fc02d991..72b68c58bf35ee67d8e172ff26d0496269cd511e 100644 --- a/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp @@ -52,7 +52,7 @@ void VLASizeChecker::reportBug(VLASize_Kind Kind, if (!BT) BT.reset(new BuiltinBug("Dangerous variable-length array (VLA) declaration")); - llvm::SmallString<256> buf; + SmallString<256> buf; llvm::raw_svector_ostream os(buf); os << "Declared variable-length array (VLA) "; switch (Kind) { diff --git a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp index 4b3c42724b27ea011f7f8a3ead63b55bca2465bd..f769ea6ade81dc51b40293f736d178076cfa12cf 100644 --- a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp @@ -160,7 +160,7 @@ void WalkAST::VisitCXXMemberCallExpr(CallExpr *CE) { } void WalkAST::ReportVirtualCall(const CallExpr *CE, bool isPure) { - llvm::SmallString<100> buf; + SmallString<100> buf; llvm::raw_svector_ostream os(buf); os << "Call Path : "; diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 4eebdb7f8ddd7e4b6cfc607fa8cad89049ef2da9..94368b5f4e83e651281487ee893d48f60700752a 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -441,7 +441,7 @@ public: // Create the diagnostic. if (Loc::isLocType(VD->getType())) { - llvm::SmallString<64> buf; + SmallString<64> buf; llvm::raw_svector_ostream os(buf); os << '\'' << *VD << "' now aliases '" << *MostRecent << '\''; PathDiagnosticLocation L = @@ -1897,7 +1897,7 @@ void BugReporter::FlushReport(BugReportEquivClass& EQ) { StringRef desc = exampleReport->getShortDescription(); unsigned ErrorDiag; { - llvm::SmallString<512> TmpStr; + SmallString<512> TmpStr; llvm::raw_svector_ostream Out(TmpStr); for (StringRef::iterator I=desc.begin(), E=desc.end(); I!=E; ++I) if (*I == '%') @@ -1952,7 +1952,7 @@ void BugReporter::EmitBasicReport(StringRef name, BugType *BugReporter::getBugTypeForName(StringRef name, StringRef category) { - llvm::SmallString<136> fullDesc; + SmallString<136> fullDesc; llvm::raw_svector_ostream(fullDesc) << name << ":" << category; llvm::StringMapEntry<BugType *> & entry = StrBugTypes.GetOrCreateValue(fullDesc); diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 4153d7820b9608586baccc2977c1a5479d75492a..230e7c97ebd540982510ff5fcc4816e39d03f2e8 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -169,7 +169,7 @@ PathDiagnosticPiece *FindLastStoreBRVisitor::VisitNode(const ExplodedNode *N, return NULL; satisfied = true; - llvm::SmallString<256> sbuf; + SmallString<256> sbuf; llvm::raw_svector_ostream os(sbuf); if (const PostStmt *PS = N->getLocationAs<PostStmt>()) { @@ -599,7 +599,7 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond, bool shouldInvert = false; - llvm::SmallString<128> LhsString, RhsString; + SmallString<128> LhsString, RhsString; { llvm::raw_svector_ostream OutLHS(LhsString), OutRHS(RhsString); const bool isVarLHS = patternMatch(BExpr->getLHS(), OutLHS, BRC); @@ -623,7 +623,7 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond, return 0; // Should we invert the strings if the LHS is not a variable name? - llvm::SmallString<256> buf; + SmallString<256> buf; llvm::raw_svector_ostream Out(buf); Out << "Assuming " << (shouldInvert ? RhsString : LhsString) << " is "; @@ -673,7 +673,7 @@ ConditionBRVisitor::VisitConditionVariable(StringRef LhsString, const bool tookTrue, BugReporterContext &BRC, const LocationContext *LC) { - llvm::SmallString<256> buf; + SmallString<256> buf; llvm::raw_svector_ostream Out(buf); Out << "Assuming " << LhsString << " is "; @@ -705,7 +705,7 @@ ConditionBRVisitor::VisitTrueTest(const Expr *Cond, if (!VD) return 0; - llvm::SmallString<256> Buf; + SmallString<256> Buf; llvm::raw_svector_ostream Out(Buf); Out << "Assuming '";