Implement JIT support for global aliases, patch by David Chisnall!
authorChris Lattner <sabre@nondot.org>
Wed, 25 Jun 2008 20:21:35 +0000 (20:21 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Jun 2008 20:21:35 +0000 (20:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52738 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index f14d6f6ef48756756b328b9c0f0afefc1849e36f..cbfaa09e36dfd08da344792f984bd0f41090b8eb 100644 (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);