From c3053e41bfcee50d80e3597452df55e2ecb4198a Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sat, 29 Sep 2018 23:49:56 +0000 Subject: [PATCH] [ORC] Clear SymbolToDefinitionMap when materializing a MaterializationUnit. The map is inaccessible at this point, so we may as well reclaim the memory early. llvm-svn: 343395 --- llvm/lib/ExecutionEngine/Orc/Layer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/lib/ExecutionEngine/Orc/Layer.cpp b/llvm/lib/ExecutionEngine/Orc/Layer.cpp index 38afead..f74f1c8 100644 --- a/llvm/lib/ExecutionEngine/Orc/Layer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Layer.cpp @@ -76,6 +76,11 @@ BasicIRLayerMaterializationUnit::BasicIRLayerMaterializationUnit( void BasicIRLayerMaterializationUnit::materialize( MaterializationResponsibility R) { + // Throw away the SymbolToDefinition map: it's not usable after we hand + // off the module. + SymbolToDefinition.clear(); + + // If cloneToNewContextOnEmit is set, clone the module now. if (L.getCloneToNewContextOnEmit()) TSM = cloneToNewContext(TSM); -- 2.7.4