diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.cpp | 27 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 3 | ||||
-rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 4 |
3 files changed, 1 insertions, 33 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp index d8cdbf8..dfeabb4 100644 --- a/llvm/lib/IR/LLVMContextImpl.cpp +++ b/llvm/lib/IR/LLVMContextImpl.cpp @@ -147,33 +147,6 @@ LLVMContextImpl::~LLVMContextImpl() { delete Pair.second; } -void LLVMContextImpl::dropTriviallyDeadConstantArrays() { - SmallSetVector<ConstantArray *, 4> WorkList; - - // When ArrayConstants are of substantial size and only a few in them are - // dead, starting WorkList with all elements of ArrayConstants can be - // wasteful. Instead, starting WorkList with only elements that have empty - // uses. - for (ConstantArray *C : ArrayConstants) - if (C->use_empty()) - WorkList.insert(C); - - while (!WorkList.empty()) { - ConstantArray *C = WorkList.pop_back_val(); - if (C->use_empty()) { - for (const Use &Op : C->operands()) { - if (auto *COp = dyn_cast<ConstantArray>(Op)) - WorkList.insert(COp); - } - C->destroyConstant(); - } - } -} - -void Module::dropTriviallyDeadConstantArrays() { - Context.pImpl->dropTriviallyDeadConstantArrays(); -} - namespace llvm { /// Make MDOperand transparent for hashing. diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index 9b60b57..71369772f 100644 --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -1808,9 +1808,6 @@ public: LLVMContextImpl(LLVMContext &C); ~LLVMContextImpl(); - /// Destroy the ConstantArrays if they are not used. - void dropTriviallyDeadConstantArrays(); - mutable OptPassGate *OPG = nullptr; /// Access the object which can disable optional passes and individual diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 98d6905..e456669 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -1753,7 +1753,5 @@ Error IRMover::move(std::unique_ptr<Module> Src, IRLinker TheIRLinker(Composite, SharedMDs, IdentifiedStructTypes, std::move(Src), ValuesToLink, std::move(AddLazyFor), IsPerformingImport); - Error E = TheIRLinker.run(); - Composite.dropTriviallyDeadConstantArrays(); - return E; + return TheIRLinker.run(); } |