[cfe-commits] r140477 - in /cfe/trunk: include/clang/Frontend/TextDiagnosticPrinter.h lib/Frontend/TextDiagnosticPrinter.cpp
Chandler Carruth
chandlerc at gmail.com
Sun Sep 25 16:01:05 PDT 2011
Author: chandlerc
Date: Sun Sep 25 18:01:05 2011
New Revision: 140477
URL: http://llvm.org/viewvc/llvm-project?rev=140477&view=rev
Log:
Inline this method now that its completely trivial, and prepare for
hoisting parts of the text diagnostic.
Modified:
cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
Modified: cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h?rev=140477&r1=140476&r2=140477&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h (original)
+++ cfe/trunk/include/clang/Frontend/TextDiagnosticPrinter.h Sun Sep 25 18:01:05 2011
@@ -64,12 +64,6 @@
const DiagnosticInfo &Info,
const SourceManager &SM,
PresumedLoc PLoc);
-
- void EmitCaretDiagnostic(SourceLocation Loc,
- SmallVectorImpl<CharSourceRange> &Ranges,
- const SourceManager &SM,
- ArrayRef<FixItHint> Hints);
-
};
} // end namespace clang
Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=140477&r1=140476&r2=140477&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Sun Sep 25 18:01:05 2011
@@ -763,21 +763,6 @@
} // end namespace
-void TextDiagnosticPrinter::EmitCaretDiagnostic(
- SourceLocation Loc,
- SmallVectorImpl<CharSourceRange>& Ranges,
- const SourceManager &SM,
- ArrayRef<FixItHint> Hints) {
- assert(LangOpts && "Unexpected diagnostic outside source file processing");
- assert(DiagOpts && "Unexpected diagnostic without options set");
-
- // FIXME: Remove this method and have clients directly build and call Emit on
- // the TextDiagnostic object.
- TextDiagnostic TextDiag(*this, OS, SM, *LangOpts, *DiagOpts);
- unsigned MacroDepth = 0;
- TextDiag.Emit(Loc, Ranges, Hints, MacroDepth);
-}
-
/// \brief Skip over whitespace in the string, starting at the given
/// index.
///
@@ -1244,9 +1229,15 @@
Ranges.push_back(Hint.RemoveRange);
}
- EmitCaretDiagnostic(LastLoc, Ranges, LastLoc.getManager(),
- llvm::makeArrayRef(Info.getFixItHints(),
- Info.getNumFixItHints()));
+ assert(LangOpts && "Unexpected diagnostic outside source file processing");
+ assert(DiagOpts && "Unexpected diagnostic without options set");
+
+ TextDiagnostic TextDiag(*this, OS, Info.getSourceManager(),
+ *LangOpts, *DiagOpts);
+ unsigned MacroDepth = 0;
+ TextDiag.Emit(LastLoc, Ranges, llvm::makeArrayRef(Info.getFixItHints(),
+ Info.getNumFixItHints()),
+ MacroDepth);
}
OS.flush();
More information about the cfe-commits
mailing list