summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2013-01-16 17:46:23 +0000
committerKevin Enderby <enderby@apple.com>2013-01-16 17:46:23 +0000
commite82ada6983858183ac591f7147b685e5bf16995b (patch)
treef569df7072422485d7fab8fb366d3ecee86309d8 /llvm/lib/MC/MCDwarf.cpp
parent8078a5a4497ee2b5a18e5694557fe61a9082755e (diff)
downloadbcm5719-llvm-e82ada6983858183ac591f7147b685e5bf16995b.tar.gz
bcm5719-llvm-e82ada6983858183ac591f7147b685e5bf16995b.zip
We want the dwarf AT_producer for assembly source files to match clang's
AT_producer. Which includes clang's version information so we can tell which version of the compiler was used. This is the first of two steps to allow us to do that. This is the llvm-mc change to provide a method to set the AT_producer string. The second step, coming soon to a clang near you, will have the clang driver pass the value of getClangFullVersion() via an flag when invoking the integrated assembler on assembly source files. rdar://12955296 llvm-svn: 172630
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 5691822e8e1..74851ce140a 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -638,9 +638,15 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
}
// AT_producer, the version of the assembler tool.
- MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM "));
- MCOS->EmitBytes(StringRef(PACKAGE_VERSION));
- MCOS->EmitBytes(StringRef(")"));
+ StringRef DwarfDebugProducer = context.getDwarfDebugProducer();
+ if (!DwarfDebugProducer.empty()){
+ MCOS->EmitBytes(DwarfDebugProducer);
+ }
+ else {
+ MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM "));
+ MCOS->EmitBytes(StringRef(PACKAGE_VERSION));
+ MCOS->EmitBytes(StringRef(")"));
+ }
MCOS->EmitIntValue(0, 1); // NULL byte to terminate the string.
// AT_language, a 4 byte value. We use DW_LANG_Mips_Assembler as the dwarf2
OpenPOWER on IntegriCloud