From 6d88fde3afcddbc7093e657eae23fdf23437b1db Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 22 Jun 2016 20:29:42 +0000 Subject: IR: Introduce Module::global_objects(). This is a convenience iterator that allows clients to enumerate the GlobalObjects within a Module. Also start using it in a few places where it is obviously the right thing to use. Differential Revision: http://reviews.llvm.org/D21580 llvm-svn: 273470 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/ExecutionEngine') diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index de3d647438b..a8e68bf49ab 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -235,10 +235,8 @@ void ExecutionEngine::clearAllGlobalMappings() { void ExecutionEngine::clearGlobalMappingsFromModule(Module *M) { MutexGuard locked(lock); - for (Function &FI : *M) - EEState.RemoveMapping(getMangledName(&FI)); - for (GlobalVariable &GI : M->globals()) - EEState.RemoveMapping(getMangledName(&GI)); + for (GlobalObject &GO : M->global_objects()) + EEState.RemoveMapping(getMangledName(&GO)); } uint64_t ExecutionEngine::updateGlobalMapping(const GlobalValue *GV, -- cgit v1.2.3