diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-10-15 01:21:55 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-10-15 01:21:55 +0000 |
| commit | 09c74643126c701b47ffea18c358704a5cf5856d (patch) | |
| tree | 294e21511d8088baaaed79793a5ab37d15c224c7 /clang/lib/Frontend | |
| parent | acd4d3d52abb9d35154c98911d60124ceeb765a9 (diff) | |
| download | bcm5719-llvm-09c74643126c701b47ffea18c358704a5cf5856d.tar.gz bcm5719-llvm-09c74643126c701b47ffea18c358704a5cf5856d.zip | |
Change 'Emit' to 'EmitCaret' which sums up what it *should* be doing.
Also note that it is actually doing much more than it should. This paves
the way for building a more generic 'Emit' routine that is the real
entry point here.
llvm-svn: 142035
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 6af66c797a9..10e7238218c 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -326,12 +326,14 @@ public: : Printer(Printer), OS(OS), SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts) { } - /// \brief Emit the caret diagnostic text. + /// \brief Emit the caret and underlining text. /// /// Walks up the macro expansion stack printing the code snippet, caret, /// underlines and FixItHint display as appropriate at each level. Walk is /// accomplished by calling itself recursively. /// + /// FIXME: Remove macro expansion from this routine, it shouldn't be tied to + /// caret diagnostics. /// FIXME: Break up massive function into logical units. /// /// \param Loc The location for this caret. @@ -339,7 +341,7 @@ public: /// \param Hints The FixIt hints active for this diagnostic. /// \param MacroSkipEnd The depth to stop skipping macro expansions. /// \param OnMacroInst The current depth of the macro expansion stack. - void Emit(SourceLocation Loc, + void EmitCaret(SourceLocation Loc, SmallVectorImpl<CharSourceRange>& Ranges, ArrayRef<FixItHint> Hints, unsigned &MacroDepth, @@ -363,7 +365,7 @@ public: SourceLocation OneLevelUp = getImmediateMacroCallerLoc(SM, Loc); // FIXME: Map ranges? - Emit(OneLevelUp, Ranges, Hints, MacroDepth, OnMacroInst + 1); + EmitCaret(OneLevelUp, Ranges, Hints, MacroDepth, OnMacroInst + 1); // Map the location. Loc = getImmediateMacroCalleeLoc(SM, Loc); @@ -1261,9 +1263,10 @@ void TextDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, } unsigned MacroDepth = 0; - TextDiag.Emit(LastLoc, Ranges, llvm::makeArrayRef(Info.getFixItHints(), - Info.getNumFixItHints()), - MacroDepth); + TextDiag.EmitCaret(LastLoc, Ranges, + llvm::makeArrayRef(Info.getFixItHints(), + Info.getNumFixItHints()), + MacroDepth); } OS.flush(); |

