summaryrefslogtreecommitdiffstats
path: root/tools/libclang/CIndexDiagnostic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CIndexDiagnostic.cpp')
-rw-r--r--tools/libclang/CIndexDiagnostic.cpp27
1 files changed, 7 insertions, 20 deletions
diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp
index 3db37b9..531992e 100644
--- a/tools/libclang/CIndexDiagnostic.cpp
+++ b/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