From: Lang Hames Date: Sat, 29 Sep 2018 23:49:56 +0000 (+0000) Subject: [ORC] Clear SymbolToDefinitionMap when materializing a MaterializationUnit. X-Git-Tag: llvmorg-8.0.0-rc1~7602 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3053e41bfcee50d80e3597452df55e2ecb4198a;p=platform%2Fupstream%2Fllvm.git [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 --- 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);