aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-06 16:26:38 +0000
committerChris Lattner <sabre@nondot.org>2005-01-06 16:26:38 +0000
commit488742a28e6680e8fb394367967fbd9a1621fb1f (patch)
treea208ec762ec9b26b3e4fb3cd4086f97cf7387dcf /lib/VMCore/ConstantFold.cpp
parente67bc1384aa36841695789f38d2a09942ecf12b6 (diff)
No need to pessimize current code for future possibilities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index e2080642ca..48afb5d8e9 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -529,10 +529,9 @@ Constant *llvm::ConstantFoldCastInstruction(const Constant *V,
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
if (DestTy == Type::BoolTy)
// FIXME: When we support 'external weak' references, we have to prevent
- // this transformation from happening. In the meantime we avoid folding
- // any cast of an external symbol.
- if (!GV->isExternal())
- return ConstantBool::True;
+ // this transformation from happening. This code will need to be updated
+ // to ignore external weak symbols when we support it.
+ return ConstantBool::True;
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
if (CE->getOpcode() == Instruction::Cast) {
Constant *Op = const_cast<Constant*>(CE->getOperand(0));