diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LowerGC.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LowerGC.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerGC.cpp b/llvm/lib/Transforms/Scalar/LowerGC.cpp index ce67d0e7a17..0c03b91d55e 100644 --- a/llvm/lib/Transforms/Scalar/LowerGC.cpp +++ b/llvm/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<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); |