aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-10 04:36:33 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-10 04:36:33 +0000
commit2f019aadc96f8fa3185c684c7150bd596d045064 (patch)
tree9ba14dfe455fae5662231df5d6f58426d44201aa
parentcbe091f8ee3ff4479a15d45e2875492358bbce82 (diff)
Don't try to emit null fixit hints.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86664 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/Diagnostic.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h
index 77a2079b76..16787542eb 100644
--- a/include/clang/Basic/Diagnostic.h
+++ b/include/clang/Basic/Diagnostic.h
@@ -105,6 +105,10 @@ public:
/// modification is known.
CodeModificationHint() : RemoveRange(), InsertionLoc() { }
+ bool isNull() const {
+ return !RemoveRange.isValid() && !InsertionLoc.isValid();
+ }
+
/// \brief Create a code modification hint that inserts the given
/// code string at a specific location.
static CodeModificationHint CreateInsertion(SourceLocation InsertionLoc,
@@ -586,6 +590,9 @@ public:
}
void AddCodeModificationHint(const CodeModificationHint &Hint) const {
+ if (Hint.isNull())
+ return;
+
assert(NumCodeModificationHints < Diagnostic::MaxCodeModificationHints &&
"Too many code modification hints!");
if (DiagObj)