[llvm-commits] [llvm] r63677 - /llvm/trunk/lib/CodeGen/MachineFunction.cpp

Bill Wendling isanbard at gmail.com
Tue Feb 3 16:48:52 PST 2009


On Tue, Feb 3, 2009 at 4:29 PM, Evan Cheng <evan.cheng at apple.com> wrote:
>
> On Feb 3, 2009, at 4:06 PM, Bill Wendling wrote:
>
>> On Tue, Feb 3, 2009 at 3:21 PM, Evan Cheng <evan.cheng at apple.com>
>> wrote:
>>> On Feb 3, 2009, at 2:55 PM, Bill Wendling wrote:
>>>
>>>> const DebugLocTuple &MachineFunction::getDebugLocTuple(DebugLoc
>>>> DL) {
>>>
>>> It doesn't have to return a reference since DebugLocTuple is light
>>> weight. Also, this method should be const.
>>>
>> It's 3 unsigned ints, so it's not that small, but I don't really care
>> that much. Fixed.
>
> Thanks. MachineFunction owns the tuples, nothing else should modify
> them. Returning ref's means something else can mess with them (const
> can always be casted away).
>
const_cast is evil! :-)

-bw



More information about the llvm-commits mailing list