aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/ExecutionEngine/ExecutionEngine.h8
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.
//