summaryrefslogtreecommitdiff
path: root/lib/LTO/LTOCodeGenerator.cpp
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
commitb4a0ba17183e1b4aa385e81e896c2a95671a40b2 (patch)
tree7fbdee4c9c414fe320011f76730b3673c111c8b5 /lib/LTO/LTOCodeGenerator.cpp
parent32c24da3730e8e5ea7df3ce7aeffa257b2e7f02f (diff)
downloadllvm-b4a0ba17183e1b4aa385e81e896c2a95671a40b2.tar.gz
llvm-b4a0ba17183e1b4aa385e81e896c2a95671a40b2.tar.bz2
llvm-b4a0ba17183e1b4aa385e81e896c2a95671a40b2.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO/LTOCodeGenerator.cpp')
-rw-r--r--lib/LTO/LTOCodeGenerator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp
index e35e33666e..88f606160d 100644
--- a/lib/LTO/LTOCodeGenerator.cpp
+++ b/lib/LTO/LTOCodeGenerator.cpp
@@ -66,7 +66,10 @@ LTOCodeGenerator::LTOCodeGenerator()
LTOCodeGenerator::~LTOCodeGenerator() {
delete TargetMach;
delete NativeObjectFile;
- delete Linker.getModule();
+ TargetMach = NULL;
+ NativeObjectFile = NULL;
+
+ Linker.deleteModule();
for (std::vector<char *>::iterator I = CodegenOptions.begin(),
E = CodegenOptions.end();