Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info.
Diff Detail
Event Timeline
test/MC/ELF/gen-dwarf.s | ||
---|---|---|
2 | I'm assuming this is a no-op for now? (well, other than to exercise the codepath - but adding or removing this flag doesn't change any behavior?) Or perhaps this test case actually verifies the dwarf version? Could you add another test case (possibly just a new RUN line on this test case with a different check prefix) to verify that if you pass a different dwarf version it appears in the output? |
You can use a common prefix for multiple FileChecks like this:
FileCheck --check-prefix=ASM --check-prefix=V2
FileCheck --check-prefix=ASM --check-prefix=V3
ASM: stuff
V2: byte 2
V3: byte 3
ASM: stuff
Which makes the test a bit simpler to read by removing duplication.
include/llvm/MC/MCContext.h | ||
---|---|---|
151 | I'd probably make this a uint16_t (and similarly for the get/set functions) since that's the limit on the output. | |
tools/llvm-mc/llvm-mc.cpp | ||
409 | This error case could use test coverage. (careful about matching on the program name - the program name in windows will be different (.exe suffix) - usually best just to omit that portion of the error message from the match line) |
I'd probably make this a uint16_t (and similarly for the get/set functions) since that's the limit on the output.