From 30b9e322e159df8eaabb5b194cec6e11ba99c261 Mon Sep 17 00:00:00 2001 From: Danil Malyshev Date: Wed, 28 Mar 2012 21:46:36 +0000 Subject: Move getPointerToNamedFunction() from JIT/MCJIT to JITMemoryManager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153607 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ExecutionEngine/JITMemoryManager.h | 11 +++++++++++ include/llvm/ExecutionEngine/RuntimeDyld.h | 4 ++++ 2 files changed, 15 insertions(+) (limited to 'include/llvm/ExecutionEngine') diff --git a/include/llvm/ExecutionEngine/JITMemoryManager.h b/include/llvm/ExecutionEngine/JITMemoryManager.h index 8eb7590a21..4c75b6ab97 100644 --- a/include/llvm/ExecutionEngine/JITMemoryManager.h +++ b/include/llvm/ExecutionEngine/JITMemoryManager.h @@ -47,6 +47,17 @@ public: /// debugging, and may be turned on by default in debug mode. virtual void setPoisonMemory(bool poison) = 0; + /// getPointerToNamedFunction - This method returns the address of the + /// specified function. As such it is only useful for resolving library + /// symbols, not code generated symbols. + /// + /// If AbortOnFailure is false and no function with the given name is + /// found, this function silently returns a null pointer. Otherwise, + /// it prints a message to stderr and aborts. + /// + virtual void *getPointerToNamedFunction(const std::string &Name, + bool AbortOnFailure = true) = 0; + //===--------------------------------------------------------------------===// // Global Offset Table Management //===--------------------------------------------------------------------===// diff --git a/include/llvm/ExecutionEngine/RuntimeDyld.h b/include/llvm/ExecutionEngine/RuntimeDyld.h index 8ad316bc3f..81acc08673 100644 --- a/include/llvm/ExecutionEngine/RuntimeDyld.h +++ b/include/llvm/ExecutionEngine/RuntimeDyld.h @@ -54,6 +54,10 @@ public: // memory was actually used. virtual void endFunctionBody(const char *Name, uint8_t *FunctionStart, uint8_t *FunctionEnd) = 0; + + + virtual void *getPointerToNamedFunction(const std::string &Name, + bool AbortOnFailure = true) = 0; }; class RuntimeDyld { -- cgit v1.2.3