[llvm-commits] [llvm] r47042 - in /llvm/trunk: include/llvm/CodeGen/MachineRegisterInfo.h lib/CodeGen/MachineRegisterInfo.cpp

Chris Lattner clattner at apple.com
Tue Feb 12 21:25:16 PST 2008


On Feb 12, 2008, at 6:45 PM, Evan Cheng wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=47042&view=rev
> Log:
> Added debugging routine dumpUses.

Nice.

> +++ llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h Tue Feb 12  
> 20:45:38 2008
> +#ifndef NDEBUG
> +  void dumpUses(unsigned RegNo) const;
> +#endif

I wouldn't bother ifdefing this.  This is a recipe for getting compile  
errors later if someone forgets to #ifdef all uses.

> +#ifndef NDEBUG
> +void MachineRegisterInfo::dumpUses(unsigned Reg) const {
> +  for (use_iterator I = use_begin(Reg), E = use_end(); I != E; ++I)
> +    I.getOperand().getParent()->dump();
> +}
> +#endif

This can be simplified to: I->dump();

-Chris



More information about the llvm-commits mailing list