diff options
author | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-02-05 02:13:05 +0000 |
---|---|---|
committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2012-02-05 02:13:05 +0000 |
commit | f7ccbad5d9949e7ddd1cbef43d482553b811e026 (patch) | |
tree | 1c2ab53fd417f5f54e55420b2807abacb972125b /lib/Frontend | |
parent | 6f42b62b6194f53bcbc349f5d17388e1936535d7 (diff) |
Basic: import SmallString<> into clang namespace
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CacheTokens.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 10 | ||||
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/DiagnosticRenderer.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/FrontendActions.cpp | 12 | ||||
-rw-r--r-- | lib/Frontend/HeaderIncludeGen.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/LogDiagnosticPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/PrintPreprocessedOutput.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/SerializedDiagnosticPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnostic.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnosticBuffer.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Frontend/VerifyDiagnosticConsumer.cpp | 4 |
16 files changed, 32 insertions, 32 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index fce28b7488..1f2508730f 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 8195445fe0..e74529d7e9 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 a3669d798a..1a6876c4ad 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 fec9b6691b..653da75f25 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 062b8a9d12..548a4a833c 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 c0302329c1..96b0b831ea 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 f703674ce2..79920df20a 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 e1a8c53de8..67b2287604 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 93c9989020..f0cf7f4914 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 8eb46732b9..3fee957499 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 93dd004251..43b64b2186 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 bdf0b550c7..649f294bf8 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 d2b8660c62..5b8fd5675d 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 f8ea9f1361..57105f15a3 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 b5d0bcb0cb..465dcad80c 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 c8d6be6509..67bc5efa1a 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; |