[llvm-commits] [llvm] r53869 - in /llvm/trunk/lib/Target/Mips: MipsAsmPrinter.cpp MipsISelLowering.cpp MipsISelLowering.h MipsInstrInfo.td MipsSubtarget.cpp MipsSubtarget.h MipsTargetAsmInfo.cpp

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Mon Jul 21 15:56:20 PDT 2008


On Mon, Jul 21, 2008 at 5:28 PM, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Hi, Bruno
>
>> +  const TargetData *TD = getTargetData();
>> +  const Value *V = dyn_cast<Value>(GV);
> You don't need dyn_cast here at all, since GlobalValue is Value.

oops

>> +  const GlobalVariable *GVA = dyn_cast<GlobalVariable>(V);
> And this one seems to be unsafe, GVA will be null, if somebody called
> this function with Function*. Why don't use cast then?

I'm checking for functions in the function which calls this one. Anyway,
your approach is safer, I'll fix it :)

Thanks

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc
"When faced with untenable alternatives, you
 should consider your imperative."



More information about the llvm-commits mailing list