Reland 196270 "Generalize debug info / EH emission in AsmPrinter"

Addressing the existense AMDGPUAsmPrinter and other subclasses of AsmPrinter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Timur Iskhodzhanov
2013-12-03 15:10:23 +00:00
parent 94f5a677f6
commit ac07cd54ed
11 changed files with 181 additions and 83 deletions

View File

@ -390,7 +390,9 @@ unsigned DIEEntry::getRefAddrSize(AsmPrinter *AP) {
// specified to be four bytes in the DWARF 32-bit format and eight bytes
// in the DWARF 64-bit format, while DWARF Version 2 specifies that such
// references have the same size as an address on the target system.
if (AP->getDwarfDebug()->getDwarfVersion() == 2)
const DwarfDebug *DD = AP->getDwarfDebug();
assert(DD && "Expected Dwarf Debug info to be available");
if (DD->getDwarfVersion() == 2)
return AP->getDataLayout().getPointerSize();
return sizeof(int32_t);
}