[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

LLVM llvm at cs.uiuc.edu
Sat Jul 17 17:39:58 PDT 2004



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.189 -> 1.190

---
Log message:

bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Replace ConstantPointerRef usage with GlobalValue usage


---
Diffs of the changes:  (+4 -6)

Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.189 llvm/lib/Target/CBackend/Writer.cpp:1.190
--- llvm/lib/Target/CBackend/Writer.cpp:1.189	Wed Jul 14 21:14:29 2004
+++ llvm/lib/Target/CBackend/Writer.cpp	Sat Jul 17 19:39:48 2004
@@ -620,8 +620,8 @@
       printType(Out, CPV->getType());
       Out << ")/*NULL*/0)";
       break;
-    } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CPV)) {
-      writeOperand(CPR->getValue());
+    } else if (GlobalValue *GV = dyn_cast<GlobalValue>(CPV)) {
+      writeOperand(GV);
       break;
     }
     // FALL THROUGH
@@ -641,7 +641,8 @@
       return;
     }
   
-  if (Constant *CPV = dyn_cast<Constant>(Operand)) {
+  Constant* CPV = dyn_cast<Constant>(Operand);
+  if (CPV && !isa<GlobalValue>(CPV)) {
     printConstant(CPV); 
   } else {
     Out << Mang->getValueName(Operand);
@@ -1412,9 +1413,6 @@
   // If accessing a global value with no indexing, avoid *(&GV) syndrome
   if (GlobalValue *V = dyn_cast<GlobalValue>(Ptr)) {
     HasImplicitAddress = true;
-  } else if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Ptr)) {
-    HasImplicitAddress = true;
-    Ptr = CPR->getValue();         // Get to the global...
   } else if (isDirectAlloca(Ptr)) {
     HasImplicitAddress = true;
   }





More information about the llvm-commits mailing list