mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Expand the coercion of constants to include the newly constant Globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14966 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5f0eb64079
commit
c3c2fdf5a8
@ -140,8 +140,7 @@ bool LowerGC::doInitialization(Module &M) {
|
||||
/// not have the specified type, insert a cast.
|
||||
static void Coerce(Instruction *I, unsigned OpNum, Type *Ty) {
|
||||
if (I->getOperand(OpNum)->getType() != Ty) {
|
||||
Constant *C = dyn_cast<Constant>(I->getOperand(OpNum));
|
||||
if (C && !isa<GlobalValue>(I->getOperand(OpNum)))
|
||||
if (Constant *C = dyn_cast<Constant>(I->getOperand(OpNum)))
|
||||
I->setOperand(OpNum, ConstantExpr::getCast(C, Ty));
|
||||
else {
|
||||
CastInst *C = new CastInst(I->getOperand(OpNum), Ty, "", I);
|
||||
|
Loading…
x
Reference in New Issue
Block a user