summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2011-11-01 22:27:22 +0000
committerKevin Enderby <enderby@apple.com>2011-11-01 22:27:22 +0000
commit613b7576896fbd03fe495f4ee27b404f81386774 (patch)
tree2650c11c10a570a3683afe918366e5c93b246529 /tools/llvm-mc
parent60cb643f7561e5be7a3b5fe705535e96de72cbf5 (diff)
downloadllvm-613b7576896fbd03fe495f4ee27b404f81386774.tar.gz
llvm-613b7576896fbd03fe495f4ee27b404f81386774.tar.bz2
llvm-613b7576896fbd03fe495f4ee27b404f81386774.tar.xz
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
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp6
1 files changed, 6 insertions, 0 deletions
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<bool>
SaveTempLabels("L", cl::desc("Don't discard temporary labels"));
+static cl::opt<bool>
+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()) {