[llvm] r209998 - Support: add Windows ARM EH data structures

Saleem Abdulrasool compnerd at compnerd.org
Mon Jun 2 06:52:17 PDT 2014


On Monday, June 2, 2014, Renato Golin <renato.golin at linaro.org> wrote:

> On 2 June 2014 02:17, Saleem Abdulrasool <compnerd at compnerd.org
> <javascript:;>> wrote:
> > +  bool H() const {
> > +    assert((Flag() == RuntimeFunctionFlag::RFF_Packed ||
> > +            Flag() == RuntimeFunctionFlag::RFF_PackedFragment) &&
> > +           "packed form required for this operation");
> > +    return ((UnwindData & 0x00008000) >> 15);
> > +  }
> > +  uint8_t Reg() const {
> > +    assert((Flag() == RuntimeFunctionFlag::RFF_Packed ||
> > +            Flag() == RuntimeFunctionFlag::RFF_PackedFragment) &&
> > +           "packed form required for this operation");
> > +    return ((UnwindData & 0x00070000) >> 16);
> > +  }
> > +  bool R() const {
> > +    assert((Flag() == RuntimeFunctionFlag::RFF_Packed ||
> > +            Flag() == RuntimeFunctionFlag::RFF_PackedFragment) &&
> > +           "packed form required for this operation");
> > +    return ((UnwindData & 0x00080000) >> 19);
> > +  }
>
> Hi Saleem,
>
> These (and the ones below), look like they could be a single function
> with a bit of magic...


Yes, they could.  I considered it for a while and decided against it.
 Ideally, these structures would use bitfields.  However, that is not
possible due to portability of these tools (WoA itself is little endian
only).  These functions are meant to be accessors for those fields.

By having the two separate, these functions you have direct access to
individual fields as well as the ability to easily work with them.

Consider the case of readobj which is going to be using these structures.
 Rather than obscuring the data, forcing the reconstruction of the
information, why not simply have an additional set of functions?

Perhaps I should add a comment explaining that the structure definition is
based solely on what Microsoft defines them to be?


> cheers,
> --renato
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/daefe57f/attachment.html>


More information about the llvm-commits mailing list