forked from OSchip/llvm-project
Revert "Add workaround for false positive in -Wfree-nonheap-object"
This reverts commit 499571ea83
.
This commit is contained in:
parent
9a72580a54
commit
0082764605
|
@ -237,9 +237,7 @@ detail::OperandStorage::~OperandStorage() {
|
||||||
if (isDynamicStorage()) {
|
if (isDynamicStorage()) {
|
||||||
TrailingOperandStorage &storage = getDynamicStorage();
|
TrailingOperandStorage &storage = getDynamicStorage();
|
||||||
storage.~TrailingOperandStorage();
|
storage.~TrailingOperandStorage();
|
||||||
// Workaround false positive in -Wfree-nonheap-object
|
free(&storage);
|
||||||
auto *mem = &storage;
|
|
||||||
free(mem);
|
|
||||||
} else {
|
} else {
|
||||||
getInlineStorage().~TrailingOperandStorage();
|
getInlineStorage().~TrailingOperandStorage();
|
||||||
}
|
}
|
||||||
|
@ -373,11 +371,8 @@ MutableArrayRef<OpOperand> detail::OperandStorage::resize(Operation *owner,
|
||||||
new (&newOperands[numOperands]) OpOperand(owner);
|
new (&newOperands[numOperands]) OpOperand(owner);
|
||||||
|
|
||||||
// If the current storage is also dynamic, free it.
|
// If the current storage is also dynamic, free it.
|
||||||
if (isDynamicStorage()) {
|
if (isDynamicStorage())
|
||||||
// Workaround false positive in -Wfree-nonheap-object
|
free(&storage);
|
||||||
auto *mem = &storage;
|
|
||||||
free(mem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the storage representation to use the new dynamic storage.
|
// Update the storage representation to use the new dynamic storage.
|
||||||
dynamicStorage.setPointerAndInt(newStorage, true);
|
dynamicStorage.setPointerAndInt(newStorage, true);
|
||||||
|
|
Loading…
Reference in New Issue