diff options
author | Chris Lattner <sabre@nondot.org> | 2003-04-21 21:33:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-04-21 21:33:44 +0000 |
commit | 4b12cdec01ca51dbe6f1ee75b868d8f65504925a (patch) | |
tree | 2cd0dd23c21ec17803fbf89f900c95349111ad26 /lib/Target/X86/InstSelectSimple.cpp | |
parent | 2719bac90525985f4ebb97324b4c087d47b54384 (diff) |
Add support for a simple constantexpr: cast of one ptr type to another
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5829 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/InstSelectSimple.cpp')
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index 91d3013ecd..6adccb15e8 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/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"; |