diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-09 03:29:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-09 03:29:03 +0000 |
commit | 70bca51f92871c7f9d3eac9ab68292c149fab53c (patch) | |
tree | 8e78214646bc53a46f1798791e55b63827699c08 /include/llvm/ExecutionEngine/ExecutionEngine.h | |
parent | 992ab561f003ebdf7148cd1e01b498e4be2265e3 (diff) |
Add new method to check to see if a global is available
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ExecutionEngine/ExecutionEngine.h')
-rw-r--r-- | include/llvm/ExecutionEngine/ExecutionEngine.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ExecutionEngine/ExecutionEngine.h b/include/llvm/ExecutionEngine/ExecutionEngine.h index e833be7869..032d9fe309 100644 --- a/include/llvm/ExecutionEngine/ExecutionEngine.h +++ b/include/llvm/ExecutionEngine/ExecutionEngine.h @@ -62,6 +62,14 @@ public: CurVal = Addr; } + // getPointerToGlobalIfAvailable - This returns the address of the specified + // global value if it is available, otherwise it returns null. + // + void *getPointerToGlobalIfAvailable(const GlobalValue *GV) { + std::map<const GlobalValue*, void*>::iterator I = GlobalAddress.find(GV); + return I != GlobalAddress.end() ? I->second : 0; + } + // getPointerToGlobal - This returns the address of the specified global // value. This may involve code generation if it's a function. // |