Fix the JIT when being used from llvm-db
authorChris Lattner <sabre@nondot.org>
Tue, 30 Nov 2004 17:41:49 +0000 (17:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Nov 2004 17:41:49 +0000 (17:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18391 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index 0cd476984f232208ac07524d73b4917526745609..dec71116404b571eea81e4510111e58b877d03c6 100644 (file)
@@ -275,7 +275,7 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
   void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F);
   if (ResultPtr) return ResultPtr;
 
-  if (F->hasExternalLinkage()) {
+  if (F->hasExternalLinkage() && F->isExternal()) {
     // If this is an external function pointer, we can force the JIT to
     // 'compile' it, which really just adds it to the map.
     if (DoesntNeedStub)