зеркало из https://github.com/microsoft/clang-1.git
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:
Родитель
cbe091f8ee
Коммит
2f019aadc9
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче