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

llvm-svn: 5829
This commit is contained in:
Chris Lattner 2003-04-21 21:33:44 +00:00
parent 4522f446c1
commit 5b348718df
1 changed files with 5 additions and 0 deletions

View File

@ -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";