Implement JIT support for global aliases, patch by David Chisnall!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-06-25 20:21:35 +00:00
parent 890aaa8710
commit 18e0459837

View File

@ -551,6 +551,8 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
/// global immediately instead of queuing it for codegen later!
return TheJIT->getOrEmitGlobalVariable(GV);
}
if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V))
return TheJIT->getPointerToGlobal(GA->resolveAliasedGlobal());
// If we have already compiled the function, return a pointer to its body.
Function *F = cast<Function>(V);