summaryrefslogtreecommitdiffstats
path: root/llvm/tools
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
commit6469fc275af601c7666f33ede355d456cc196103 (patch)
tree14cbb2069ccd7e5c7ee0f5614f0e7dd5909b7d53 /llvm/tools
parent61108f23780f48fd21848be905e8aeae3238dc00 (diff)
downloadbcm5719-llvm-6469fc275af601c7666f33ede355d456cc196103.tar.gz
bcm5719-llvm-6469fc275af601c7666f33ede355d456cc196103.zip
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 llvm-svn: 143509
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index c188a76f547..8718b10ec21 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/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()) {
OpenPOWER on IntegriCloud