diff options
author | Manman Ren <mren@apple.com> | 2013-04-04 00:22:54 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-04-04 00:22:54 +0000 |
commit | e3d75ee2a1c8ea11fd01fc49055d08f2da7f5668 (patch) | |
tree | 1917974353321b66c1fc013783533a6c8f465258 /lib/CodeGen/AsmPrinter/DIE.cpp | |
parent | 296ffab5625fe83d804f1dd5d5517954082b6622 (diff) |
Debug Info: according to DWARF 2, FORM_ref_addr the same size as an address on
the target system.
It was hard-coded to 4 bytes before. I can't get llvm to generate a
ref_addr on a reasonably sized testing case.
rdar://problem/13559431
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index 57e0acda89..326fbe5567 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -310,6 +310,12 @@ void DIEEntry::EmitValue(AsmPrinter *AP, unsigned Form) const { AP->EmitInt32(Entry->getOffset()); } +unsigned DIEEntry::SizeOf(AsmPrinter *AP, unsigned Form) const { + if (Form == dwarf::DW_FORM_ref_addr) + return AP->getDataLayout().getPointerSize(); + return sizeof(int32_t); +} + #ifndef NDEBUG void DIEEntry::print(raw_ostream &O) { O << format("Die: 0x%lx", (long)(intptr_t)Entry); |