diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-07-17 16:27:35 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-07-17 16:27:35 +0000 |
commit | 19f8bc65f6c4733c41aef5d36a87e733c2e69841 (patch) | |
tree | e9447b59996bde4776a9ea9c865df9ab6990c03e /llvm/lib/MC/MCDwarf.cpp | |
parent | 6e81905eced1f688a16ff92bdf40931fe8321eff (diff) | |
download | bcm5719-llvm-19f8bc65f6c4733c41aef5d36a87e733c2e69841.tar.gz bcm5719-llvm-19f8bc65f6c4733c41aef5d36a87e733c2e69841.zip |
MC: collapse emission of producer
Rather than use three EmitBytes, concatenate the string at compile time,
constructing a single StringRef and emitting the data in one shot. This also
creates nicer assembly output. NFC.
llvm-svn: 213273
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 54cef1f786d..b14a452d85d 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -740,14 +740,10 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS, // AT_producer, the version of the assembler tool. StringRef DwarfDebugProducer = context.getDwarfDebugProducer(); - if (!DwarfDebugProducer.empty()){ + if (!DwarfDebugProducer.empty()) MCOS->EmitBytes(DwarfDebugProducer); - } - else { - MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM ")); - MCOS->EmitBytes(StringRef(PACKAGE_VERSION)); - MCOS->EmitBytes(StringRef(")")); - } + else + MCOS->EmitBytes(StringRef("llvm-mc (based on LLVM " PACKAGE_VERSION ")")); 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 |