From 7389acda89a2c4e99e09057f5265dc56d7f2a31a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 23 Mar 2012 07:18:22 +0000 Subject: Dematerialize the source functions after we're done with them. This saves a bit of memory during LTO. llvm-svn: 153313 --- llvm/lib/Linker/LinkModules.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Linker/LinkModules.cpp') diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 02905bc3397..dca523c7ab1 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1226,6 +1226,7 @@ bool ModuleLinker::run() { } linkFunctionBody(cast(ValueMap[SF]), SF); + SF->Dematerialize(); } // Resolve all uses of aliases with aliasees. @@ -1265,7 +1266,8 @@ bool ModuleLinker::run() { // Link in function body. linkFunctionBody(DF, SF); - + SF->Dematerialize(); + // "Remove" from vector by setting the element to 0. *I = 0; -- cgit v1.2.3