diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 08:34:19 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 08:34:19 +0000 |
commit | c44cb6bd9f94ec66ed25fc561b8687bcfaee153a (patch) | |
tree | 8a79ad6bb59123deaa3651ee7d1e30b467dcee95 | |
parent | 539429d9b5267a19238b49657eab29293b99aa7c (diff) | |
download | bcm5719-llvm-c44cb6bd9f94ec66ed25fc561b8687bcfaee153a.tar.gz bcm5719-llvm-c44cb6bd9f94ec66ed25fc561b8687bcfaee153a.zip |
Expand the coercion of constants to include the newly constant Globals.
llvm-svn: 14966
-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); |