[llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Apr 21 16:34:01 PDT 2003


Changes in directory llvm/lib/Target/X86:

InstSelectSimple.cpp updated: 1.85 -> 1.86

---
Log message:

Add support for a simple constantexpr: cast of one ptr type to another


---
Diffs of the changes:

Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.85 llvm/lib/Target/X86/InstSelectSimple.cpp:1.86
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.85	Thu Jan 16 12:07:23 2003
+++ llvm/lib/Target/X86/InstSelectSimple.cpp	Mon Apr 21 16:33:44 2003
@@ -307,6 +307,11 @@
       emitGEPOperation(MBB, IP, CE->getOperand(0),
                        CE->op_begin()+1, CE->op_end(), R);
       return;
+    } else if (CE->getOpcode() == Instruction::Cast &&
+               isa<PointerType>(CE->getType()) &&
+               isa<PointerType>(CE->getOperand(0)->getType())) {
+      copyConstantToRegister(MBB, IP, cast<Constant>(CE->getOperand(0)), R);
+      return;
     }
 
     std::cerr << "Offending expr: " << C << "\n";





More information about the llvm-commits mailing list