summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-11-17 23:30:59 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-11-17 23:30:59 +0000
commit70507e59fe06e187045ad1c6abd518495683f038 (patch)
tree582b5ec8a7faae2e861351b5443195591ea36e55
parent2da41787371e06f6919c4aa4a6b4107c4ed0d8cf (diff)
downloadbcm5719-llvm-70507e59fe06e187045ad1c6abd518495683f038.tar.gz
bcm5719-llvm-70507e59fe06e187045ad1c6abd518495683f038.zip
COFF: Destroy LTOModules as they are linked.
This should help reduce memory consumption during LTO. Differential Revision: http://reviews.llvm.org/D14672 llvm-svn: 253397
-rw-r--r--lld/COFF/InputFiles.h1
-rw-r--r--lld/COFF/SymbolTable.cpp2
2 files changed, 1 insertions, 2 deletions
diff --git a/lld/COFF/InputFiles.h b/lld/COFF/InputFiles.h
index ca9ed3f5ddb..6a263fbaddf 100644
--- a/lld/COFF/InputFiles.h
+++ b/lld/COFF/InputFiles.h
@@ -205,7 +205,6 @@ public:
std::vector<SymbolBody *> &getSymbols() override { return SymbolBodies; }
MachineTypes getMachineType() override;
- LTOModule *getModule() const { return M.get(); }
std::unique_ptr<LTOModule> takeModule() { return std::move(M); }
private:
diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp
index e9f08f0bf5e..802d354d5d9 100644
--- a/lld/COFF/SymbolTable.cpp
+++ b/lld/COFF/SymbolTable.cpp
@@ -406,7 +406,7 @@ std::vector<ObjectFile *> SymbolTable::createLTOObjects(LTOCodeGenerator *CG) {
CG->setModule(BitcodeFiles[0]->takeModule());
for (unsigned I = 1, E = BitcodeFiles.size(); I != E; ++I)
- CG->addModule(BitcodeFiles[I]->getModule());
+ CG->addModule(BitcodeFiles[I]->takeModule().get());
bool DisableVerify = true;
#ifdef NDEBUG
OpenPOWER on IntegriCloud