[llvm-commits] [llvm] r132197 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
Eli Friedman
eli.friedman at gmail.com
Fri May 27 11:42:20 PDT 2011
On Fri, May 27, 2011 at 11:15 AM, Devang Patel <dpatel at apple.com> wrote:
> Author: dpatel
> Date: Fri May 27 13:15:52 2011
> New Revision: 132197
>
> URL: http://llvm.org/viewvc/llvm-project?rev=132197&view=rev
> Log:
> Handle signed types gracefully.
> This fixes regressions reported by buildbots as a fallout of r132193.
Still broken; see
http://smooshlab.apple.com:8013/builders/clang-x86_64-darwin10-gcc42-RA/builds/3462/steps/run.llvm.tests/logs/LLVM%20%3A%3A%20CodeGen___X86___dbg-const-int.ll
-Eli
> Modified:
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=132197&r1=132196&r2=132197&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri May 27 13:15:52 2011
> @@ -444,16 +444,28 @@
> DIType Ty) {
> assert (MO.isImm() && "Invalid machine operand!");
> DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
> - unsigned Imm = MO.getImm();
> unsigned form = dwarf::DW_FORM_udata;
> - switch (Ty.getSizeInBits()) {
> - case 8: form = dwarf::DW_FORM_data1; break;
> - case 16: form = dwarf::DW_FORM_data2; break;
> - case 32: form = dwarf::DW_FORM_data4; break;
> - case 64: form = dwarf::DW_FORM_data8; break;
> - default: break;
> - }
> - addUInt(Block, 0, form, Imm);
> + DIBasicType BTy(Ty);
> + if (BTy.Verify()) {
> + unsigned Encoding = BTy.getEncoding();
> + if (Encoding == dwarf::DW_ATE_signed ||
> + Encoding == dwarf::DW_ATE_signed_char) {
> + form = dwarf::DW_FORM_sdata;
> + addSInt(Block, 0, dwarf::DW_FORM_sdata, MO.getImm());
> + } else {
> + switch (Ty.getSizeInBits()) {
> + case 8: form = dwarf::DW_FORM_data1; break;
> + case 16: form = dwarf::DW_FORM_data2; break;
> + case 32: form = dwarf::DW_FORM_data4; break;
> + case 64: form = dwarf::DW_FORM_data8; break;
> + default: break;
> + }
> + addUInt(Block, 0, form, MO.getImm());
> + }
> + } else
> + //if this is not basic type then just use _udata.
> + addUInt(Block, 0, form, MO.getImm());
> +
> addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
> return true;
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list