[PATCH] D26469: Improve DWARF parsing and attribute retrieval speed by improving DWARF abbreviation declarations.

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 21:40:12 PST 2016


probinson added subscribers: beanz, probinson.
probinson added a comment.

I agree with Adrian, this is way too big to review.

So, following test-first practice, let's talk about the DWARF-test-case-generator first.  There are already 3 different ways it could go.

- A standalone generator like you've done here.
- A driver for LLVM's DWARF generator, as @dblaikie suggested.
- A DWARF-speaking yaml2obj, which @beanz is proposing on cfe-dev.

The standalone generator looks like it would work well for unittests but not so much for more traditional LIT tests, unless you also want to produce a tool that can parse some textual representation and produce DWARF from it.

A driver for LLVM's DwarfDebug would get nice code re-use, but limit the test space to what DwarfDebug knows how to produce.  I think it would be more robust to make sure we had confidence in a reader/dumper before starting to persuade the compiler to emit some of the more finicky bits of DWARF 5.  And, I personally would want a WAY nicer input syntax than having to hand-write IR metadata (oy, what a headache).

Speaking of generating binary files from text input, isn't that exactly what yaml2obj does?  I don't know whether people like it or hate it, but it does appear to have worked examples of emitting objects that get used for tests.  Teaching it a convenient DWARF syntax and how to emit DWARF sections into an object file seems like a more fruitful avenue than confining the generator to unittests.  (Maybe you could repurpose the code here, save a lot of typing.)


https://reviews.llvm.org/D26469





More information about the llvm-commits mailing list