[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Chris Lattner
clattner at apple.com
Thu Nov 30 20:51:49 PST 2006
On Nov 30, 2006, at 7:56 PM, Reid Spencer wrote:
>
> case Instruction::PtrToInt:
> - // Cast of a global address to boolean is always true.
> - if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
> - if (DestTy == Type::BoolTy && !GV->hasExternalWeakLinkage())
> - return ConstantBool::getTrue();
> - }
> break;
Thanks Reid, the patch looks great. I think you can remove this
empty case now though,
-Chris
More information about the llvm-commits
mailing list