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
This commit is contained in:
Anders Carlsson 2009-11-10 04:36:33 +00:00
Родитель cbe091f8ee
Коммит 2f019aadc9
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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)