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/Basic/Diagnostic.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/Basic/Diagnostic.cpp')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index d4c7aa95217..d8095f4f6d5 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -1152,11 +1152,6 @@ void StoredDiagnostic::Serialize(llvm::raw_ostream &OS) const { break; } - if (F->InsertionLoc.isValid() && F->InsertionLoc.isMacroID()) { - NumFixIts = 0; - break; - } - ++NumFixIts; } @@ -1166,7 +1161,6 @@ void StoredDiagnostic::Serialize(llvm::raw_ostream &OS) const { WriteSourceLocation(OS, SM, F->RemoveRange.getBegin()); WriteSourceLocation(OS, SM, F->RemoveRange.getEnd()); WriteUnsigned(OS, F->RemoveRange.isTokenRange()); - WriteSourceLocation(OS, SM, F->InsertionLoc); WriteString(OS, F->CodeToInsert); } } @@ -1294,12 +1288,11 @@ StoredDiagnostic::Deserialize(FileManager &FM, SourceManager &SM, if (ReadUnsigned(Memory, MemoryEnd, NumFixIts)) return Diag; for (unsigned I = 0; I != NumFixIts; ++I) { - SourceLocation RemoveBegin, RemoveEnd, InsertionLoc; + SourceLocation RemoveBegin, RemoveEnd; unsigned InsertLen = 0, RemoveIsTokenRange; if (ReadSourceLocation(FM, SM, Memory, MemoryEnd, RemoveBegin) || ReadSourceLocation(FM, SM, Memory, MemoryEnd, RemoveEnd) || ReadUnsigned(Memory, MemoryEnd, RemoveIsTokenRange) || - ReadSourceLocation(FM, SM, Memory, MemoryEnd, InsertionLoc) || ReadUnsigned(Memory, MemoryEnd, InsertLen) || Memory + InsertLen > MemoryEnd) { Diag.FixIts.clear(); @@ -1309,7 +1302,6 @@ StoredDiagnostic::Deserialize(FileManager &FM, SourceManager &SM, FixItHint Hint; Hint.RemoveRange = CharSourceRange(SourceRange(RemoveBegin, RemoveEnd), RemoveIsTokenRange); - Hint.InsertionLoc = InsertionLoc; Hint.CodeToInsert.assign(Memory, Memory + InsertLen); Memory += InsertLen; Diag.FixIts.push_back(Hint); |