[PATCH] Record the DWARF version in MCContext
David Blaikie
dblaikie at gmail.com
Wed Apr 16 10:02:29 PDT 2014
================
Comment at: include/llvm/MC/MCContext.h:151
@@ +150,3 @@
+ /// The maximum version of dwarf that we should emit.
+ unsigned DwarfVersion;
+
----------------
I'd probably make this a uint16_t (and similarly for the get/set functions) since that's the limit on the output.
================
Comment at: tools/llvm-mc/llvm-mc.cpp:409
@@ -405,1 +408,3 @@
Ctx.setGenDwarfForAssembly(GenDwarfForAssembly);
+ if (DwarfVersion < 2 || DwarfVersion > 4) {
+ errs() << ProgName << ": Dwarf version " << DwarfVersion
----------------
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)
http://reviews.llvm.org/D3399
More information about the llvm-commits
mailing list