Revert "Add workaround for false positive in -Wfree-nonheap-object"

This reverts commit 499571ea83.
This commit is contained in:
Christopher Di Bella 2021-07-21 21:29:24 +00:00
parent 9a72580a54
commit 0082764605
1 changed files with 3 additions and 8 deletions

View File

@ -237,9 +237,7 @@ detail::OperandStorage::~OperandStorage() {
if (isDynamicStorage()) {
TrailingOperandStorage &storage = getDynamicStorage();
storage.~TrailingOperandStorage();
// Workaround false positive in -Wfree-nonheap-object
auto *mem = &storage;
free(mem);
free(&storage);
} else {
getInlineStorage().~TrailingOperandStorage();
}
@ -373,11 +371,8 @@ MutableArrayRef<OpOperand> detail::OperandStorage::resize(Operation *owner,
new (&newOperands[numOperands]) OpOperand(owner);
// If the current storage is also dynamic, free it.
if (isDynamicStorage()) {
// Workaround false positive in -Wfree-nonheap-object
auto *mem = &storage;
free(mem);
}
if (isDynamicStorage())
free(&storage);
// Update the storage representation to use the new dynamic storage.
dynamicStorage.setPointerAndInt(newStorage, true);