From: Reid Spencer Date: Sun, 18 Jul 2004 08:34:19 +0000 (+0000) Subject: Expand the coercion of constants to include the newly constant Globals. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c3c2fdf5a8242a1d0ff2942671311f12d1adee3f;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp index ce67d0e7a17..0c03b91d55e 100644 --- a/lib/Transforms/Scalar/LowerGC.cpp +++ b/lib/Transforms/Scalar/LowerGC.cpp @@ -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(I->getOperand(OpNum)); - if (C && !isa(I->getOperand(OpNum))) + if (Constant *C = dyn_cast(I->getOperand(OpNum))) I->setOperand(OpNum, ConstantExpr::getCast(C, Ty)); else { CastInst *C = new CastInst(I->getOperand(OpNum), Ty, "", I);