summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mc/llvm-mc.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2014-05-01 08:46:02 +0000
committerOliver Stannard <oliver.stannard@arm.com>2014-05-01 08:46:02 +0000
commit7eacbd5a7105e9620e061a20143bdd0c6c5d6f99 (patch)
tree9f27a7bea3a1a69140c9cd4c387a45f07f1aeb6e /llvm/tools/llvm-mc/llvm-mc.cpp
parentf01ce1990c4305d62db34f03c3fb3c69a08f15e5 (diff)
downloadbcm5719-llvm-7eacbd5a7105e9620e061a20143bdd0c6c5d6f99.tar.gz
bcm5719-llvm-7eacbd5a7105e9620e061a20143bdd0c6c5d6f99.zip
Record the DWARF version in MCContext
Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index dbe012b4d4a..516f6234f29 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -154,6 +154,9 @@ static cl::opt<bool>
GenDwarfForAssembly("g", cl::desc("Generate dwarf debugging info for assembly "
"source files"));
+static cl::opt<int>
+DwarfVersion("dwarf-version", cl::desc("Dwarf version"), cl::init(4));
+
static cl::opt<std::string>
DebugCompilationDir("fdebug-compilation-dir",
cl::desc("Specifies the debug info's compilation dir"));
@@ -406,6 +409,12 @@ int main(int argc, char **argv) {
Ctx.setAllowTemporaryLabels(false);
Ctx.setGenDwarfForAssembly(GenDwarfForAssembly);
+ if (DwarfVersion < 2 || DwarfVersion > 4) {
+ errs() << ProgName << ": Dwarf version " << DwarfVersion
+ << " is not supported." << '\n';
+ return 1;
+ }
+ Ctx.setDwarfVersion(DwarfVersion);
if (!DwarfDebugFlags.empty())
Ctx.setDwarfDebugFlags(StringRef(DwarfDebugFlags));
if (!DwarfDebugProducer.empty())
OpenPOWER on IntegriCloud