From 27376106d94017a72fc602bd9279a6f9fd3018da Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 8 Jan 2007 18:42:27 +0000 Subject: [PATCH] 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 --- tools/lto/lto.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index fac1a3028f0..383da87a62d 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(); -- 2.34.1