Support: Recognize Borland DWARF extensions.

This patch adds DWARF values for the Delphi language and Borland C++
language extensions.

Reviewed by: dblaikie
Subscribers: llvm-commits, majnemer
Differential Revision: http://reviews.llvm.org/D14522


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dawn Perchik 2015-11-11 18:47:36 +00:00
parent b8f7aeb218
commit 89837ac9ba
3 changed files with 58 additions and 0 deletions

View File

@ -113,6 +113,11 @@ HANDLE_DW_TAG(0x4106, GNU_template_template_param)
HANDLE_DW_TAG(0x4107, GNU_template_parameter_pack)
HANDLE_DW_TAG(0x4108, GNU_formal_parameter_pack)
HANDLE_DW_TAG(0x4200, APPLE_property)
HANDLE_DW_TAG(0xb000, BORLAND_property)
HANDLE_DW_TAG(0xb001, BORLAND_Delphi_string)
HANDLE_DW_TAG(0xb002, BORLAND_Delphi_dynamic_array)
HANDLE_DW_TAG(0xb003, BORLAND_Delphi_set)
HANDLE_DW_TAG(0xb004, BORLAND_Delphi_variant)
HANDLE_DW_OP(0x03, addr)
HANDLE_DW_OP(0x06, deref)
@ -315,6 +320,7 @@ HANDLE_DW_LANG(0x0021, C_plus_plus_14)
HANDLE_DW_LANG(0x0022, Fortran03)
HANDLE_DW_LANG(0x0023, Fortran08)
HANDLE_DW_LANG(0x8001, Mips_Assembler)
HANDLE_DW_LANG(0xb000, BORLAND_Delphi)
// DWARF attribute type encodings.
HANDLE_DW_ATE(0x01, address)

View File

@ -240,6 +240,25 @@ enum Attribute : uint16_t {
DW_AT_GNU_pubtypes = 0x2135,
DW_AT_GNU_discriminator = 0x2136,
// Borland extensions.
DW_AT_BORLAND_property_read = 0x3b11,
DW_AT_BORLAND_property_write = 0x3b12,
DW_AT_BORLAND_property_implements = 0x3b13,
DW_AT_BORLAND_property_index = 0x3b14,
DW_AT_BORLAND_property_default = 0x3b15,
DW_AT_BORLAND_Delphi_unit = 0x3b20,
DW_AT_BORLAND_Delphi_class = 0x3b21,
DW_AT_BORLAND_Delphi_record = 0x3b22,
DW_AT_BORLAND_Delphi_metaclass = 0x3b23,
DW_AT_BORLAND_Delphi_constructor = 0x3b24,
DW_AT_BORLAND_Delphi_destructor = 0x3b25,
DW_AT_BORLAND_Delphi_anonymous_method = 0x3b26,
DW_AT_BORLAND_Delphi_interface = 0x3b27,
DW_AT_BORLAND_Delphi_ABI = 0x3b28,
DW_AT_BORLAND_Delphi_return = 0x3b29,
DW_AT_BORLAND_Delphi_frameptr = 0x3b30,
DW_AT_BORLAND_closure = 0x3b31,
// LLVM project extensions.
DW_AT_LLVM_include_path = 0x3e00,
DW_AT_LLVM_config_macros = 0x3e01,
@ -371,6 +390,14 @@ enum CallingConvention {
DW_CC_program = 0x02,
DW_CC_nocall = 0x03,
DW_CC_lo_user = 0x40,
DW_CC_GNU_borland_fastcall_i386 = 0x41,
DW_CC_BORLAND_safecall = 0xb0,
DW_CC_BORLAND_stdcall = 0xb1,
DW_CC_BORLAND_pascal = 0xb2,
DW_CC_BORLAND_msfastcall = 0xb3,
DW_CC_BORLAND_msreturn = 0xb4,
DW_CC_BORLAND_thiscall = 0xb5,
DW_CC_BORLAND_fastcall = 0xb6,
DW_CC_hi_user = 0xff
};

View File

@ -177,6 +177,23 @@ const char *llvm::dwarf::AttributeString(unsigned Attribute) {
case DW_AT_MIPS_assumed_size: return "DW_AT_MIPS_assumed_size";
case DW_AT_lo_user: return "DW_AT_lo_user";
case DW_AT_hi_user: return "DW_AT_hi_user";
case DW_AT_BORLAND_property_read: return "DW_AT_BORLAND_property_read";
case DW_AT_BORLAND_property_write: return "DW_AT_BORLAND_property_write";
case DW_AT_BORLAND_property_implements: return "DW_AT_BORLAND_property_implements";
case DW_AT_BORLAND_property_index: return "DW_AT_BORLAND_property_index";
case DW_AT_BORLAND_property_default: return "DW_AT_BORLAND_property_default";
case DW_AT_BORLAND_Delphi_unit: return "DW_AT_BORLAND_Delphi_unit";
case DW_AT_BORLAND_Delphi_class: return "DW_AT_BORLAND_Delphi_class";
case DW_AT_BORLAND_Delphi_record: return "DW_AT_BORLAND_Delphi_record";
case DW_AT_BORLAND_Delphi_metaclass: return "DW_AT_BORLAND_Delphi_metaclass";
case DW_AT_BORLAND_Delphi_constructor: return "DW_AT_BORLAND_Delphi_constructor";
case DW_AT_BORLAND_Delphi_destructor: return "DW_AT_BORLAND_Delphi_destructor";
case DW_AT_BORLAND_Delphi_anonymous_method: return "DW_AT_BORLAND_Delphi_anonymous_method";
case DW_AT_BORLAND_Delphi_interface: return "DW_AT_BORLAND_Delphi_interface";
case DW_AT_BORLAND_Delphi_ABI: return "DW_AT_BORLAND_Delphi_ABI";
case DW_AT_BORLAND_Delphi_return: return "DW_AT_BORLAND_Delphi_return";
case DW_AT_BORLAND_Delphi_frameptr: return "DW_AT_BORLAND_Delphi_frameptr";
case DW_AT_BORLAND_closure: return "DW_AT_BORLAND_closure";
case DW_AT_APPLE_optimized: return "DW_AT_APPLE_optimized";
case DW_AT_APPLE_flags: return "DW_AT_APPLE_flags";
case DW_AT_APPLE_isa: return "DW_AT_APPLE_isa";
@ -374,6 +391,14 @@ const char *llvm::dwarf::ConventionString(unsigned Convention) {
case DW_CC_nocall: return "DW_CC_nocall";
case DW_CC_lo_user: return "DW_CC_lo_user";
case DW_CC_hi_user: return "DW_CC_hi_user";
case DW_CC_GNU_borland_fastcall_i386: return "DW_CC_GNU_borland_fastcall_i386";
case DW_CC_BORLAND_safecall: return "DW_CC_BORLAND_safecall";
case DW_CC_BORLAND_stdcall: return "DW_CC_BORLAND_stdcall";
case DW_CC_BORLAND_pascal: return "DW_CC_BORLAND_pascal";
case DW_CC_BORLAND_msfastcall: return "DW_CC_BORLAND_msfastcall";
case DW_CC_BORLAND_msreturn: return "DW_CC_BORLAND_msreturn";
case DW_CC_BORLAND_thiscall: return "DW_CC_BORLAND_thiscall";
case DW_CC_BORLAND_fastcall: return "DW_CC_BORLAND_fastcall";
}
return nullptr;
}