Start handling more global variables.
authorEric Christopher <echristo@apple.com>
Wed, 13 Oct 2010 09:11:46 +0000 (09:11 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 13 Oct 2010 09:11:46 +0000 (09:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116401 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMFastISel.cpp

index 418a9852ebc0783e3378ad2716831cd1287758e1..4a2a58edc9c5e17cba997049ee5d46c346eaa530 100644 (file)
@@ -620,8 +620,11 @@ bool ARMFastISel::ARMComputeRegOffset(const Value *Obj, unsigned &Reg,
 
   // FIXME: Handle global variables.
   if (const GlobalValue *GV = dyn_cast<GlobalValue>(Obj)) {
-    (void)GV;
-    return false;
+    unsigned Tmp = ARMMaterializeGV(GV, TLI.getValueType(Obj->getType()));
+    if (Tmp == 0) return false;
+    
+    Reg = Tmp;
+    return true;
   }
 
   // Try to get this in a register if nothing else has worked.