[llvm] r176408 - recommit r172363 & r171325 (reverted in r172756)

Arnold Schwaighofer aschwaighofer at apple.com
Mon Mar 4 10:02:18 PST 2013


On Mar 4, 2013, at 11:27 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:

>>> Shuxin: I'm not breaking any assumption here.
>> If you don't think you break the assumption,  tell us your immediate reaction to
>> the class name "ObjectSizeOffsetVisitor".
>> 
>> It seem so odd to me that  xxx_ObjectWhatever() return a meaningful value however we have no idea which
>> object it is talking about.
>> 

Nuno,

I think, the issue is mostly one of naming things as precisely as possible or at least have the documentation describe it as accurate as possible.

If we call a function "getObjectSize" vs. "getPtrAdjustedSizeOfPointedToByObject(s)", this can make a big difference. I claim it could have prevented the basicaa bug we had: I think it was probably due to the misconception that getObjectSize will always return the size of the pointed to underlying object - as it turns out this was not the case  - or it has evolved over time not to be the case anymore. Either way, by naming things more precisely we can avoid future bugs.

That is all I am voting for.

Best,
Arnold



More information about the llvm-commits mailing list