From: Chris Lattner Date: Tue, 30 Nov 2004 17:41:49 +0000 (+0000) Subject: Fix the JIT when being used from llvm-db X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=532343b24e78dc6120921c09151195a59b94058a;p=oota-llvm.git Fix the JIT when being used from llvm-db git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18391 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index 0cd476984f2..dec71116404 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -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)