[llvm-commits] [PATCH] MCFragments Clean Up
David Meyer
pdox at google.com
Tue Nov 2 16:40:48 PDT 2010
Rafael,
If I didn't do this, ComputeSize() would need two more arguments:
SectionAddress and FragmentOffset. MCAlignFragment uses SectionAddress +
FragmentOffset, while MCOrgFragment uses FragmentOffset. I was trying to
avoid cluttering up the function arguments with specific values needed for
one or two fragment types. Since we have to pass the MCAsmLayout anyway, it
seems reasonable that it should be capable of answering those values for the
current fragment (since they are guaranteed to be known).
In order to avoid passing FragmentOffset, your patch uses private member
"Offset" directly, which is fragile (what if it is uninitialized?) and
against the convention of using the accessor. Also, this won't work when you
move the code away from MCFragment and into the subclasses. (Offset is a
private member of MCFragment).
- David M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101102/101f5a06/attachment.html>
More information about the llvm-commits
mailing list