[PATCH] D42334: [NFC] Refactor Apple Accelerator Tables

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 07:07:58 PST 2018


labath added a comment.

I've uploaded https://reviews.llvm.org/D42420 so you can see my current work on the debug_names generation. It's still quite ugly and there are several interactions that I still have to figure out (e.g., how do I get the list of CUs I am indexing), but the thing I want to show is that there are more opportunities for code sharing here than on the parsing side: obviously the header is completely different, but the code for emission of some individual subtables can be shared as long as we can customize the top-level emit() function to control the order.  Also, the functions for gathering and processing the data (AddName, finalize) can largely be shared.

The one idea I think could make things cleaner, but I haven't tried out yet, is to split this code into two parts:

- one would deal purely with abstract data representation: gathering names, computing hashes, bucket counts, etc. This one would identical for both tables.
- the other part would deal with serialization of the abstract representation. Here we would have two classes for the two table kinds plus a base class for common functionality.

I don't think any of that affects this patch directly, but it may be interesting for you to see where the common functionality is.


https://reviews.llvm.org/D42334





More information about the llvm-commits mailing list