mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
[MCJIT] Add a FindGlobalVariableNamed utility
Summary: This adds FindGlobalVariableNamed to ExecutionEngine (plus implementation in MCJIT), which is an analog of FindFunctionNamed for GlobalVariables. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10421 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240202 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -153,6 +153,14 @@ Function *ExecutionEngine::FindFunctionNamed(const char *FnName) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GlobalVariable *ExecutionEngine::FindGlobalVariableNamed(const char *Name, bool AllowInternal) {
|
||||
for (unsigned i = 0, e = Modules.size(); i != e; ++i) {
|
||||
GlobalVariable *GV = Modules[i]->getGlobalVariable(Name,AllowInternal);
|
||||
if (GV && !GV->isDeclaration())
|
||||
return GV;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t ExecutionEngineState::RemoveMapping(StringRef Name) {
|
||||
GlobalAddressMapTy::iterator I = GlobalAddressMap.find(Name);
|
||||
|
Reference in New Issue
Block a user