[PATCH] D41606: [COFF] support /ignore:4217

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 28 09:07:21 PST 2017


rnk added a subscriber: zturner.
rnk added a comment.

In https://reviews.llvm.org/D41606#964821, @smeenai wrote:

> General question: it looks like a lot of COFF tests are written using yaml2obj, whereas ELF always uses assembly files and llvm-mc (and I've been following that pattern for the few COFF patches I've written as well). Is there an actual preference for yaml2obj tests in COFF, or is it just a historic artifact? I personally find assembly tests a lot easier to understand.


I agree, I'd recommend using .s files for all non-PDB tests. I use yaml mostly for objects with codeview because it @zturner added a great symbolic representation for codeview.

However, our COFF yaml isn't a very good representation for code and relocations. Code is represented as a binary blob and relocations are stored on the side. Storing relocations separately is a problem for codeview symbol records because if you want to add one record, you have to determine its size and update the offsets of all the relocations after the symbol. Type records don't have this problem because they do not contain relocations. Type merging is significantly more complicated than symbol linking, so we naturally have more tests for it, and increasing the testability of symbol records hasn't been as much of a priority.

The best way to unify these tests would probably be to add more directives to MC to emit complete codeview records. We can still test invalid records by falling back to open coding them with .byte, .short, and .long data directives.


Repository:
  rL LLVM

https://reviews.llvm.org/D41606





More information about the llvm-commits mailing list