diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-18 14:24:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-18 14:24:02 +0000 |
commit | b13f5d99af2764b77510feaad66e3f190ae1a458 (patch) | |
tree | eaeb3fb367d3ef9da86bbd83611fa9f7b1b2f7f9 /clang/lib/Frontend/TextDiagnosticPrinter.cpp | |
parent | e60b5161d142a9ac196afc2d6e0b90cdcf8b5489 (diff) | |
download | bcm5719-llvm-b13f5d99af2764b77510feaad66e3f190ae1a458.tar.gz bcm5719-llvm-b13f5d99af2764b77510feaad66e3f190ae1a458.zip |
Simplify FixItHint by eliminated the unnecessary InsertionLoc
location. Patch by Eelis van der Weegen!
llvm-svn: 111362
Diffstat (limited to 'clang/lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r-- | clang/lib/Frontend/TextDiagnosticPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/TextDiagnosticPrinter.cpp b/clang/lib/Frontend/TextDiagnosticPrinter.cpp index 1b5b7e2ea86..bc1b50475bc 100644 --- a/clang/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/TextDiagnosticPrinter.cpp @@ -447,11 +447,11 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc, if (NumHints && DiagOpts->ShowFixits) { for (const FixItHint *Hint = Hints, *LastHint = Hints + NumHints; Hint != LastHint; ++Hint) { - if (Hint->InsertionLoc.isValid()) { + if (!Hint->CodeToInsert.empty()) { // We have an insertion hint. Determine whether the inserted // code is on the same line as the caret. std::pair<FileID, unsigned> HintLocInfo - = SM.getDecomposedInstantiationLoc(Hint->InsertionLoc); + = SM.getDecomposedInstantiationLoc(Hint->RemoveRange.getBegin()); if (SM.getLineNumber(HintLocInfo.first, HintLocInfo.second) == SM.getLineNumber(FID, FileOffset)) { // Insert the new code into the line just below the code |