diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-22 20:29:42 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-06-22 20:29:42 +0000 |
commit | 6d88fde3afcddbc7093e657eae23fdf23437b1db (patch) | |
tree | c94289078301e2e2194b6c843ac77d388d8be575 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
parent | 4a07bf63727fedea6441d5ccca8dbe26071a7c0e (diff) | |
download | bcm5719-llvm-6d88fde3afcddbc7093e657eae23fdf23437b1db.tar.gz bcm5719-llvm-6d88fde3afcddbc7093e657eae23fdf23437b1db.zip |
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
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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, |