From 613b7576896fbd03fe495f4ee27b404f81386774 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Tue, 1 Nov 2011 22:27:22 +0000 Subject: First part of support for generating dwarf for assembly source files with the -g flag. In this part we generate the .file for the source being assembled and the .loc's for the assembled instructions. The next part will be to generate the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. Once the next part is done test cases will be added. rdar://9275556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143509 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-mc/llvm-mc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/llvm-mc') diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index c188a76f54..8718b10ec2 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -152,6 +152,10 @@ NoInitialTextSection("n", cl::desc("Don't assume assembly file starts " static cl::opt SaveTempLabels("L", cl::desc("Don't discard temporary labels")); +static cl::opt +GenDwarfForAssembly("g", cl::desc("Generate dwarf debugging info for assembly " + "source files")); + enum ActionType { AC_AsLex, AC_Assemble, @@ -377,6 +381,8 @@ static int AssembleInput(const char *ProgName) { if (SaveTempLabels) Ctx.setAllowTemporaryLabels(false); + Ctx.setGenDwarfForAssembly(GenDwarfForAssembly); + // Package up features to be passed to target/subtarget std::string FeaturesStr; if (MAttrs.size()) { -- cgit v1.2.3