diff options
| author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2010-03-13 10:17:05 +0000 | 
|---|---|---|
| committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2010-03-13 10:17:05 +0000 | 
| commit | ba2c65277aafb2adfd2b1aa0ef9d0d3076c27e82 (patch) | |
| tree | a53e23d6e8cf04249665ca910a05d7cb4bf5c5af /clang/lib/Frontend | |
| parent | e5f1c197af5fe3a0e7bee5e5f11e487f67bbb103 (diff) | |
| download | bcm5719-llvm-ba2c65277aafb2adfd2b1aa0ef9d0d3076c27e82.tar.gz bcm5719-llvm-ba2c65277aafb2adfd2b1aa0ef9d0d3076c27e82.zip  | |
Use SmallString instead of SmallVector
llvm-svn: 98436
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/HTMLDiagnostics.cpp | 12 | ||||
| -rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 14 | 
3 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Frontend/HTMLDiagnostics.cpp b/clang/lib/Frontend/HTMLDiagnostics.cpp index f695254cb46..fddd36e4ecb 100644 --- a/clang/lib/Frontend/HTMLDiagnostics.cpp +++ b/clang/lib/Frontend/HTMLDiagnostics.cpp @@ -40,13 +40,13 @@ class HTMLDiagnostics : public PathDiagnosticClient {    std::vector<const PathDiagnostic*> BatchedDiags;  public:    HTMLDiagnostics(const std::string& prefix, const Preprocessor &pp); -   +    virtual ~HTMLDiagnostics() { FlushDiagnostics(NULL); } -   +    virtual void FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade);    virtual void HandlePathDiagnostic(const PathDiagnostic* D); -   +    virtual llvm::StringRef getName() const {      return "HTMLDiagnostics";    } @@ -108,7 +108,7 @@ HTMLDiagnostics::FlushDiagnostics(llvm::SmallVectorImpl<std::string> *FilesMade)      ReportDiag(*D, FilesMade);      delete D;    } -   +    BatchedDiags.clear();  } @@ -294,7 +294,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,    llvm::raw_fd_ostream os(H.c_str(), ErrorMsg);    if (!ErrorMsg.empty()) { -    (llvm::errs() << "warning: could not create file '" << F.str()  +    (llvm::errs() << "warning: could not create file '" << F.str()                    << "'\n").flush();      return;    } @@ -502,7 +502,7 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,  }  static void EmitAlphaCounter(llvm::raw_ostream& os, unsigned n) { -  llvm::SmallVector<char, 10> buf; +  llvm::SmallString<10> buf;    do {      unsigned x = n % ('z' - 'a'); diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index be5bb0dade8..44e0e139060 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -61,7 +61,7 @@ static void PrintMacroDefinition(const IdentifierInfo &II, const MacroInfo &MI,    if (MI.tokens_empty() || !MI.tokens_begin()->hasLeadingSpace())      OS << ' '; -  llvm::SmallVector<char, 128> SpellingBuffer; +  llvm::SmallString<128> SpellingBuffer;    for (MacroInfo::tokens_iterator I = MI.tokens_begin(), E = MI.tokens_end();         I != E; ++I) {      if (I->hasLeadingSpace()) diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index d2aa5480b4b..60c1f4b9b8a 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -119,19 +119,19 @@ void TextDiagnosticPrinter::HighlightRange(const SourceRange &R,    }    assert(StartColNo <= EndColNo && "Invalid range!"); -   +    // Pick the first non-whitespace column.    while (StartColNo < SourceLine.size() &&           (SourceLine[StartColNo] == ' ' || SourceLine[StartColNo] == '\t'))      ++StartColNo; -   +    // Pick the last non-whitespace column.    if (EndColNo > SourceLine.size())      EndColNo = SourceLine.size();    while (EndColNo-1 &&           (SourceLine[EndColNo-1] == ' ' || SourceLine[EndColNo-1] == '\t'))      --EndColNo; -   +    // If the start/end passed each other, then we are trying to highlight a range    // that just exists in whitespace, which must be some sort of other bug.    assert(StartColNo <= EndColNo && "Trying to highlight whitespace??"); @@ -300,10 +300,10 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc,        if (E.isMacroID()) E = SM.getImmediateSpellingLoc(E);        Ranges[i] = SourceRange(S, E);      } -     +      // Get the pretty name, according to #line directives etc.      PresumedLoc PLoc = SM.getPresumedLoc(Loc); -     +      // If this diagnostic is not in the main file, print out the "included from"      // lines.      if (LastWarningLoc != PLoc.getIncludeLoc()) { @@ -563,7 +563,7 @@ static unsigned findEndOfWord(unsigned Start,    // We have the start of a balanced punctuation sequence (quotes,    // parentheses, etc.). Determine the full sequence is. -  llvm::SmallVector<char, 16> PunctuationEndStack; +  llvm::SmallString<16> PunctuationEndStack;    PunctuationEndStack.push_back(EndPunct);    while (End < Length && !PunctuationEndStack.empty()) {      if (Str[End] == PunctuationEndStack.back()) @@ -704,7 +704,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,      if (DiagOpts->ShowLocation) {        if (DiagOpts->ShowColors)          OS.changeColor(savedColor, true); -       +        // Emit a Visual Studio compatible line number syntax.        if (LangOpts && LangOpts->Microsoft) {          OS << PLoc.getFilename() << '(' << LineNo << ')';  | 

