summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-21 21:33:44 +0000
committerChris Lattner <sabre@nondot.org>2003-04-21 21:33:44 +0000
commit5b348718df4062efccf1559928c51df9ecce946e (patch)
tree0ec4a212499c3ad0e06367b7dabf2858d36ec9ac /llvm/lib
parent4522f446c12aa8fd841aa7b313e901bbffd6a62f (diff)
downloadbcm5719-llvm-5b348718df4062efccf1559928c51df9ecce946e.tar.gz
bcm5719-llvm-5b348718df4062efccf1559928c51df9ecce946e.zip
Add support for a simple constantexpr: cast of one ptr type to another
llvm-svn: 5829
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp
index 91d3013ecd0..6adccb15e8a 100644
--- a/llvm/lib/Target/X86/InstSelectSimple.cpp
+++ b/llvm/lib/Target/X86/InstSelectSimple.cpp
@@ -307,6 +307,11 @@ void ISel::copyConstantToRegister(MachineBasicBlock *MBB,
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";
OpenPOWER on IntegriCloud