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

llvm-svn: 52738
This commit is contained in:
Chris Lattner 2008-06-25 20:21:35 +00:00
parent 88ca48b09d
commit 58ecfbdad6
1 changed files with 2 additions and 0 deletions

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);