From c3c2fdf5a8242a1d0ff2942671311f12d1adee3f Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 18 Jul 2004 08:34:19 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/LowerGC.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); -- 2.34.1