diff options
author | Kevin Enderby <enderby@apple.com> | 2013-01-16 17:46:23 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2013-01-16 17:46:23 +0000 |
commit | 75c9b9384f50e9387f24dd7ce6af403cbda6d19a (patch) | |
tree | 61a2d413c5737f6f53711be35c108d07f8f1241b /lib/MC | |
parent | fbb662f840c2f76988ff9f3f152695632cfc71be (diff) | |
download | external_llvm-75c9b9384f50e9387f24dd7ce6af403cbda6d19a.zip external_llvm-75c9b9384f50e9387f24dd7ce6af403cbda6d19a.tar.gz external_llvm-75c9b9384f50e9387f24dd7ce6af403cbda6d19a.tar.bz2 |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCDwarf.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 5691822..74851ce 100644 --- a/lib/MC/MCDwarf.cpp +++ b/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 |