OSDN Git Service

little optimization: reuse getPointerToGlobalIfAvailable(CGV) value in emitGlobals()
authorNuno Lopes <nunoplopes@sapo.pt>
Tue, 14 Oct 2008 10:04:52 +0000 (10:04 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Tue, 14 Oct 2008 10:04:52 +0000 (10:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57484 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/ExecutionEngine.cpp

index acc89c9..55151cb 100644 (file)
@@ -963,7 +963,7 @@ void ExecutionEngine::emitGlobals() {
           LinkedGlobalsMap[std::make_pair(GV->getName(), GV->getType())];
         void *Ptr = getPointerToGlobalIfAvailable(CGV);
         assert(Ptr && "Canonical global wasn't codegen'd!");
-        addGlobalMapping(GV, getPointerToGlobalIfAvailable(CGV));
+        addGlobalMapping(GV, Ptr);
       }
     }