summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-04 02:43:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-04 02:43:00 +0000
commit105193772d84057493968310c1d1c6dd0f1ae735 (patch)
tree49b0aa2d644fe8c7bfb1555b783433b6c55fafcf /tools
parentbcc6ac93bae207431efff90dfb3e741ffdf11469 (diff)
downloadllvm-105193772d84057493968310c1d1c6dd0f1ae735.tar.gz
llvm-105193772d84057493968310c1d1c6dd0f1ae735.tar.bz2
llvm-105193772d84057493968310c1d1c6dd0f1ae735.tar.xz
Don't construct or delete a module on the Linker.
The linker is now responsible only for actually linking the modules, it is up to the clients to create and destroy them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/LTOCodeGenerator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp
index 683a480d3f..de2c1fd4b8 100644
--- a/tools/lto/LTOCodeGenerator.cpp
+++ b/tools/lto/LTOCodeGenerator.cpp
@@ -69,7 +69,7 @@ const char* LTOCodeGenerator::getVersionString() {
LTOCodeGenerator::LTOCodeGenerator()
: _context(getGlobalContext()),
- _linker("ld-temp.o", _context), _target(NULL),
+ _linker(new Module("ld-temp.o", _context)), _target(NULL),
_emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
_codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
_nativeObjectFile(NULL) {
@@ -81,6 +81,7 @@ LTOCodeGenerator::LTOCodeGenerator()
LTOCodeGenerator::~LTOCodeGenerator() {
delete _target;
delete _nativeObjectFile;
+ delete _linker.getModule();
for (std::vector<char*>::iterator I = _codegenOptions.begin(),
E = _codegenOptions.end(); I != E; ++I)