summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-10-16 08:59:57 +0000
committerBill Wendling <isanbard@gmail.com>2013-10-16 08:59:57 +0000
commit91e6f6e198b07b9c7eda858a39992ce5060f1e15 (patch)
treebba3722ba16608d20ce24a3d92a9a09f3585a953 /llvm/lib/Linker
parentec8ec333f02015fdbaacf9573ea703fd900092c5 (diff)
downloadbcm5719-llvm-91e6f6e198b07b9c7eda858a39992ce5060f1e15.tar.gz
bcm5719-llvm-91e6f6e198b07b9c7eda858a39992ce5060f1e15.zip
Add a 'deleteModule' method to the Linker class.
This deletes the Module ivar instead of having the LTO code generater do it. It also sets the pointer to 'NULL', so that if it's used again it will abort quickly. llvm-svn: 192778
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index b343b1ce8f8..8f2200e4ea2 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -1352,6 +1352,11 @@ Linker::Linker(Module *M) : Composite(M) {
Linker::~Linker() {
}
+void Linker::deleteModule() {
+ delete Composite;
+ Composite = NULL;
+}
+
bool Linker::linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg) {
ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src, Mode);
if (TheLinker.run()) {
OpenPOWER on IntegriCloud