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
This commit is contained in:
Chris Lattner 2003-04-21 21:33:44 +00:00
parent 2719bac905
commit 4b12cdec01
2 changed files with 10 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";

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