aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 08:34:19 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 08:34:19 +0000
commitc3c2fdf5a8242a1d0ff2942671311f12d1adee3f (patch)
tree9718533214b45854614a3c9777734e7e03ead5e4 /lib
parent5f0eb64079812119328d6d450815a38fae122089 (diff)
downloadexternal_llvm-c3c2fdf5a8242a1d0ff2942671311f12d1adee3f.zip
external_llvm-c3c2fdf5a8242a1d0ff2942671311f12d1adee3f.tar.gz
external_llvm-c3c2fdf5a8242a1d0ff2942671311f12d1adee3f.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LowerGC.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp
index ce67d0e..0c03b91 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<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);