[llvm] r231298 - Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.
Frédéric Riss
friss at apple.com
Wed Mar 4 22:16:27 PST 2015
> On Mar 4, 2015, at 10:09 PM, Robinson, Paul <Paul_Robinson at playstation.sony.com> wrote:
>
>> -----Original Message-----
>> From: llvm-commits-bounces at cs.uiuc.edu <mailto:llvm-commits-bounces at cs.uiuc.edu> [mailto:llvm-commits-
>> bounces at cs.uiuc.edu <mailto:bounces at cs.uiuc.edu>] On Behalf Of Frederic Riss
>> Sent: Wednesday, March 04, 2015 2:08 PM
>> To: llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> Subject: [llvm] r231298 - Teach DIEInteger to emit FORM_strp and
>> FORM_ref_addr attributes.
>>
>> Author: friss
>> Date: Wed Mar 4 16:07:36 2015
>> New Revision: 231298
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=231298&view=rev
>> Log:
>> Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.
>>
>> To be used/tested by llvm-dsymutil. (llvm-dsymutil does a 'static' link,
>> no need for relocations for most things, so it'll just emit raw integers
>> for most attributes)
>>
>> Modified:
>> llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
>> URL: http://llvm.org/viewvc/llvm-
>> project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=231298&r1=231297&r2=
>> 231298&view=diff
>> ==========================================================================
>> ====
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Wed Mar 4 16:07:36 2015
>> @@ -218,6 +218,7 @@ void DIEInteger::EmitValue(const AsmPrin
>> case dwarf::DW_FORM_ref2: // Fall thru
>> case dwarf::DW_FORM_data2: Size = 2; break;
>> case dwarf::DW_FORM_sec_offset: // Fall thru
>> + case dwarf::DW_FORM_strp: // Fall thru
>> case dwarf::DW_FORM_ref4: // Fall thru
>> case dwarf::DW_FORM_data4: Size = 4; break;
>> case dwarf::DW_FORM_ref8: // Fall thru
>> @@ -229,6 +230,9 @@ void DIEInteger::EmitValue(const AsmPrin
>> case dwarf::DW_FORM_sdata: Asm->EmitSLEB128(Integer); return;
>> case dwarf::DW_FORM_addr:
>> Size = Asm->getDataLayout().getPointerSize(); break;
>> + case dwarf::DW_FORM_ref_addr:
>> + Size = SizeOf(Asm, dwarf::DW_FORM_ref_addr);
>> + break;
>> default: llvm_unreachable("DIE Value form not supported yet");
>> }
>> Asm->OutStreamer.EmitIntValue(Integer, Size);
>> @@ -245,6 +249,7 @@ unsigned DIEInteger::SizeOf(const AsmPri
>> case dwarf::DW_FORM_ref2: // Fall thru
>> case dwarf::DW_FORM_data2: return sizeof(int16_t);
>> case dwarf::DW_FORM_sec_offset: // Fall thru
>> + case dwarf::DW_FORM_strp: // Fall thru
>> case dwarf::DW_FORM_ref4: // Fall thru
>> case dwarf::DW_FORM_data4: return sizeof(int32_t);
>> case dwarf::DW_FORM_ref8: // Fall thru
>> @@ -255,6 +260,11 @@ unsigned DIEInteger::SizeOf(const AsmPri
>> case dwarf::DW_FORM_udata: return getULEB128Size(Integer);
>> case dwarf::DW_FORM_sdata: return getSLEB128Size(Integer);
>> case dwarf::DW_FORM_addr: return AP->getDataLayout().getPointerSize();
>> + case dwarf::DW_FORM_ref_addr:
>> + if (AP->OutStreamer.getContext().getDwarfVersion() == 2)
>> + return AP->getDataLayout().getPointerSize();
>> + return sizeof(int32_t);
>> + break;
>
> Don't need break after return.
r231353, thanks!
Fred
> --paulr
>
>> default: llvm_unreachable("DIE Value form not supported yet");
>> }
>> }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150304/541b7279/attachment.html>
More information about the llvm-commits
mailing list