summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-01-08 18:42:27 +0000
committerDevang Patel <dpatel@apple.com>2007-01-08 18:42:27 +0000
commit27376106d94017a72fc602bd9279a6f9fd3018da (patch)
treea41b685544a07b64b4ad1da600c73a5a77735687 /tools/lto
parent43f344a26695ba85a1a0b5407c038d9c3f980327 (diff)
downloadllvm-27376106d94017a72fc602bd9279a6f9fd3018da.tar.gz
llvm-27376106d94017a72fc602bd9279a6f9fd3018da.tar.bz2
llvm-27376106d94017a72fc602bd9279a6f9fd3018da.tar.xz
Modules are consumed when they are merged together by Linker.
Clear modules vector so that destructure does not try to delete these modules again. Patch by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/lto.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index fac1a3028f..383da87a62 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -353,6 +353,8 @@ LTO::optimizeModules(const std::string &OutputFilename,
for (unsigned i = 1, e = modules.size(); i != e; ++i)
if (theLinker.LinkModules(bigOne, modules[i], errMsg))
return LTO_MODULE_MERGE_FAILURE;
+ // all modules have been handed off to the linker.
+ modules.clear();
sys::Path FinalOutputPath(FinalOutputFilename);
FinalOutputPath.eraseSuffix();