diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2006-12-01 00:25:12 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2006-12-01 00:25:12 +0000 |
commit | 78ee7b78c3c47b71c4b7a1475438d6574216a64b (patch) | |
tree | 95741db67fdcf0223e347e9448bc8baf7997cf84 /lib/VMCore/ConstantFold.cpp | |
parent | 44c030a7ee8ea2bbc9482313313480eb1795a63f (diff) |
Introducing external weak linkage. Darwin codegen should be added later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 9974071385..fd6ad108a9 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -894,11 +894,8 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V, case Instruction::PtrToInt: // Cast of a global address to boolean is always true. - if (isa<GlobalValue>(V)) { - if (DestTy == Type::BoolTy) - // FIXME: When we support 'external weak' references, we have to - // prevent this transformation from happening. This code will need - // to be updated to ignore external weak symbols when we support it. + if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) { + if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage()) return ConstantBool::getTrue(); } break; |