[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
    Chris Lattner 
    clattner at apple.com
       
    Thu Nov 30 21:32:54 PST 2006
    
    
  
On Nov 30, 2006, at 9:01 PM, Reid Spencer wrote:
> On Thu, 2006-11-30 at 20:51 -0800, Chris Lattner wrote:
>> 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,
>
> The default asserts, trying to catch bad opcodes.
Ah, good call, thanks again!
-Chris
    
    
More information about the llvm-commits
mailing list