summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexDiagnostic.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-18 14:24:02 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-18 14:24:02 +0000
commitb13f5d99af2764b77510feaad66e3f190ae1a458 (patch)
treeeaeb3fb367d3ef9da86bbd83611fa9f7b1b2f7f9 /clang/tools/libclang/CIndexDiagnostic.cpp
parente60b5161d142a9ac196afc2d6e0b90cdcf8b5489 (diff)
downloadbcm5719-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/tools/libclang/CIndexDiagnostic.cpp')
-rw-r--r--clang/tools/libclang/CIndexDiagnostic.cpp27
1 files changed, 7 insertions, 20 deletions
diff --git a/clang/tools/libclang/CIndexDiagnostic.cpp b/clang/tools/libclang/CIndexDiagnostic.cpp
index 3db37b97da1..531992efebc 100644
--- a/clang/tools/libclang/CIndexDiagnostic.cpp
+++ b/clang/tools/libclang/CIndexDiagnostic.cpp
@@ -204,26 +204,13 @@ CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt,
const FixItHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt];
if (ReplacementRange) {
- if (Hint.RemoveRange.isInvalid()) {
- // Create an empty range that refers to a single source
- // location (which is the insertion point).
- CXSourceRange Range = {
- { (void *)&StoredDiag->Diag.getLocation().getManager(),
- (void *)&StoredDiag->LangOpts },
- Hint.InsertionLoc.getRawEncoding(),
- Hint.InsertionLoc.getRawEncoding()
- };
-
- *ReplacementRange = Range;
- } else {
- // Create a range that covers the entire replacement (or
- // removal) range, adjusting the end of the range to point to
- // the end of the token.
- *ReplacementRange
- = translateSourceRange(StoredDiag->Diag.getLocation().getManager(),
- StoredDiag->LangOpts,
- Hint.RemoveRange);
- }
+ // Create a range that covers the entire replacement (or
+ // removal) range, adjusting the end of the range to point to
+ // the end of the token.
+ *ReplacementRange
+ = translateSourceRange(StoredDiag->Diag.getLocation().getManager(),
+ StoredDiag->LangOpts,
+ Hint.RemoveRange);
}
return createCXString(Hint.CodeToInsert);
OpenPOWER on IntegriCloud