From 97d3bf50494d9b26d864d63efa23029fd505be10 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 6 Jan 2005 16:26:38 +0000 Subject: [PATCH] No need to pessimize current code for future possibilities. llvm-svn: 19311 --- lib/VMCore/ConstantFolding.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/VMCore/ConstantFolding.cpp b/lib/VMCore/ConstantFolding.cpp index e2080642ca6..48afb5d8e96 100644 --- a/lib/VMCore/ConstantFolding.cpp +++ b/lib/VMCore/ConstantFolding.cpp @@ -529,10 +529,9 @@ Constant *llvm::ConstantFoldCastInstruction(const Constant *V, if (const GlobalValue *GV = dyn_cast(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(V)) { if (CE->getOpcode() == Instruction::Cast) { Constant *Op = const_cast(CE->getOperand(0));