diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-03-31 17:25:35 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-03-31 17:25:35 +0000 | 
| commit | 30e631862f647b5eb7c05b25248d960d7ecae20b (patch) | |
| tree | a32c221a34079b6bdfd525ef601fbdb717212875 /clang/lib/Frontend | |
| parent | 4cd5866f8ead15aa2634bd63bff4975aa2e395fb (diff) | |
| download | bcm5719-llvm-30e631862f647b5eb7c05b25248d960d7ecae20b.tar.gz bcm5719-llvm-30e631862f647b5eb7c05b25248d960d7ecae20b.zip  | |
Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder
llvm-svn: 100018
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/FixItRewriter.cpp | 14 | ||||
| -rw-r--r-- | clang/lib/Frontend/HTMLDiagnostics.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 14 | 
3 files changed, 16 insertions, 15 deletions
diff --git a/clang/lib/Frontend/FixItRewriter.cpp b/clang/lib/Frontend/FixItRewriter.cpp index 20d452e76a6..0b04cf2b44d 100644 --- a/clang/lib/Frontend/FixItRewriter.cpp +++ b/clang/lib/Frontend/FixItRewriter.cpp @@ -93,7 +93,7 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,      // completely ignore it, even if it's an error: fix-it locations      // are meant to perform specific fix-ups even in the presence of      // other errors. -    if (Info.getNumFixItHints() == 0) +    if (Info.getNumCodeModificationHints() == 0)        return;      // See if the location of the error is one that matches what the @@ -122,10 +122,10 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,    // Make sure that we can perform all of the modifications we    // in this diagnostic. -  bool CanRewrite = Info.getNumFixItHints() > 0; -  for (unsigned Idx = 0, Last = Info.getNumFixItHints(); +  bool CanRewrite = Info.getNumCodeModificationHints() > 0; +  for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints();         Idx < Last; ++Idx) { -    const FixItHint &Hint = Info.getFixItHint(Idx); +    const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx);      if (Hint.RemoveRange.isValid() &&          Rewrite.getRangeSize(Hint.RemoveRange) == -1) {        CanRewrite = false; @@ -140,7 +140,7 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,    }    if (!CanRewrite) { -    if (Info.getNumFixItHints() > 0) +    if (Info.getNumCodeModificationHints() > 0)        Diag(Info.getLocation(), diag::note_fixit_in_macro);      // If this was an error, refuse to perform any rewriting. @@ -152,9 +152,9 @@ void FixItRewriter::HandleDiagnostic(Diagnostic::Level DiagLevel,    }    bool Failed = false; -  for (unsigned Idx = 0, Last = Info.getNumFixItHints(); +  for (unsigned Idx = 0, Last = Info.getNumCodeModificationHints();         Idx < Last; ++Idx) { -    const FixItHint &Hint = Info.getFixItHint(Idx); +    const CodeModificationHint &Hint = Info.getCodeModificationHint(Idx);      if (!Hint.RemoveRange.isValid()) {        // We're adding code.        if (Rewrite.InsertTextBefore(Hint.InsertionLoc, Hint.CodeToInsert)) diff --git a/clang/lib/Frontend/HTMLDiagnostics.cpp b/clang/lib/Frontend/HTMLDiagnostics.cpp index 022a34d0bd4..da99cb8b7b8 100644 --- a/clang/lib/Frontend/HTMLDiagnostics.cpp +++ b/clang/lib/Frontend/HTMLDiagnostics.cpp @@ -484,7 +484,8 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,    // FIXME: This code is disabled because it seems to mangle the HTML    // output. I'm leaving it here because it's generally the right idea,    // but needs some help from someone more familiar with the rewriter. -  for (const FixItHint *Hint = P.fixit_begin(), *HintEnd = P.fixit_end(); +  for (const CodeModificationHint *Hint = P.code_modifications_begin(), +                               *HintEnd = P.code_modifications_end();         Hint != HintEnd; ++Hint) {      if (Hint->RemoveRange.isValid()) {        HighlightRange(R, LPosInfo.first, Hint->RemoveRange, diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 4e91f8d4c22..24d51e2c78d 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -276,7 +276,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc,                                                  SourceRange *Ranges,                                                  unsigned NumRanges,                                                  SourceManager &SM, -                                                const FixItHint *Hints, +                                          const CodeModificationHint *Hints,                                                  unsigned NumHints,                                                  unsigned Columns) {    assert(LangOpts && "Unexpected diagnostic outside source file processing"); @@ -409,7 +409,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc,    std::string FixItInsertionLine;    if (NumHints && DiagOpts->ShowFixits) { -    for (const FixItHint *Hint = Hints, *LastHint = Hints + NumHints; +    for (const CodeModificationHint *Hint = Hints, *LastHint = Hints + NumHints;           Hint != LastHint; ++Hint) {        if (Hint->InsertionLoc.isValid()) {          // We have an insertion hint. Determine whether the inserted @@ -833,7 +833,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,    if (DiagOpts->ShowCarets && Info.getLocation().isValid() &&        ((LastLoc != Info.getLocation()) || Info.getNumRanges() ||         (LastCaretDiagnosticWasNote && Level != Diagnostic::Note) || -       Info.getNumFixItHints())) { +       Info.getNumCodeModificationHints())) {      // Cache the LastLoc, it allows us to omit duplicate source/caret spewage.      LastLoc = Info.getLocation();      LastCaretDiagnosticWasNote = (Level == Diagnostic::Note); @@ -845,9 +845,9 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,      for (unsigned i = 0; i != NumRanges; ++i)        Ranges[i] = Info.getRange(i); -    unsigned NumHints = Info.getNumFixItHints(); +    unsigned NumHints = Info.getNumCodeModificationHints();      for (unsigned idx = 0; idx < NumHints; ++idx) { -      const FixItHint &Hint = Info.getFixItHint(idx); +      const CodeModificationHint &Hint = Info.getCodeModificationHint(idx);        if (Hint.RemoveRange.isValid()) {          assert(NumRanges < 20 && "Out of space");          Ranges[NumRanges++] = Hint.RemoveRange; @@ -855,8 +855,8 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level,      }      EmitCaretDiagnostic(LastLoc, Ranges, NumRanges, LastLoc.getManager(), -                        Info.getFixItHints(), -                        Info.getNumFixItHints(), +                        Info.getCodeModificationHints(), +                        Info.getNumCodeModificationHints(),                          DiagOpts->MessageLength);    }  | 

