Add MCSymbolCOFF

Pete Cooper peter_cooper at apple.com
Sat Jun 6 19:21:02 PDT 2015


> On Jun 6, 2015, at 2:47 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> Patches 3, 4 and 5 are fine.
Thanks
> 
> On Patch 6
> 
> +  /// MachOSymbolFlags - We store the value for the 'desc' symbol field in the
> 
> Don't repeat names in comments.
Good point.  That was a copy/paste mistake.
> 
> It should delete MCMachOSymbolFlags.h or use it. Don't copy the values.
I delete it in patch 7, but i’ll fold that in to patch 6 to make it cleaner.
> 
> Why is the common symbol handling that it removes a nop?
I moved all the logic for getting the encoded flags in to a method on the MCSymbolMachO class.  The common stuff was just part of that.  This was just to prevent leaking any of the flags from the MCSymbolMachO class, but i can remove that part if you prefer I leave it as it was.  I can make the required flags/mask accessible from MCSymbolMachO if needed.

Cheers,
Pete
> 
> Cheers,
> Rafael
> 
> 
> 
> 
> On 5 June 2015 at 22:03, Pete Cooper <peter_cooper at apple.com> wrote:
>> Here’s the full set of patches I have so far.  The next step will be to change Flags to uint16_t to pack MCSymbol better.  I’ll get to that next week.
>> 
>> Cheers,
>> Pete
>> 
>> 
>> 
>>> On Jun 5, 2015, at 4:39 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>>> 
>>> Hey Rafael
>>> 
>>> This is ultimately part of an effort to reduce the size of MCSymbol even further.
>>> 
>>> One of the problematic fields is MCSymbol::Flags which needs to be a uint16_t on MachO and ELF but uint32_t on COFF.
>>> 
>>> These patches create a MCSymbolCOFF class which for now is just used to hide the flags code for the type field of an encoded COFF symbol.  I’ll later move the type itself out of the uint32_t flags in MCSymbol and reduce that to a uint16_t.
>>> 
>>> I’m also going to create an MCSymbolMachO which will really just be used to contain all the flags logic.  I’d like to make setFlags, getFlags, and modifyFlags all be protected and actually handle the flags in the subclasses.  You already did all of this for ELF, but i’ll do MachO and COFF.
>>> 
>>> Cheers,
>>> Pete
>>> 
>>> <0001-Change-MCSymbol-IsELF-to-an-enum-to-support-future-M.patch><0002-Add-MCSymbolCOFF-class-and-use-it-to-get-and-set-the.patch>
>> 
>> 





More information about the llvm-commits mailing list