Add a target asm info hook to specify that particular bits of data in the FDE

should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants
these bits to be 64-bits (.quad). However, other platforms may disagree.

This is just the info right now and is part of a work-in-progress which needs
this. We'll add the actual *use* of this soon.

llvm-svn: 80024
This commit is contained in:
Bill Wendling 2009-08-25 20:21:17 +00:00
parent 4cf325e090
commit 485591273c
3 changed files with 21 additions and 19 deletions

View File

@ -254,52 +254,49 @@ namespace llvm {
//===--- Dwarf Emission Directives -----------------------------------===// //===--- Dwarf Emission Directives -----------------------------------===//
/// AbsoluteDebugSectionOffsets - True if we should emit abolute section /// AbsoluteDebugSectionOffsets - True if we should emit abolute section
/// offsets for debug information. Defaults to false. /// offsets for debug information.
bool AbsoluteDebugSectionOffsets; bool AbsoluteDebugSectionOffsets; // Defaults to false.
/// AbsoluteEHSectionOffsets - True if we should emit abolute section /// AbsoluteEHSectionOffsets - True if we should emit abolute section
/// offsets for EH information. Defaults to false. /// offsets for EH information. Defaults to false.
bool AbsoluteEHSectionOffsets; bool AbsoluteEHSectionOffsets;
/// HasLEB128 - True if target asm supports leb128 directives. /// HasLEB128 - True if target asm supports leb128 directives.
/// bool HasLEB128; // Defaults to false.
bool HasLEB128; // Defaults to false.
/// hasDotLocAndDotFile - True if target asm supports .loc and .file /// hasDotLocAndDotFile - True if target asm supports .loc and .file
/// directives for emitting debugging information. /// directives for emitting debugging information.
/// bool HasDotLocAndDotFile; // Defaults to false.
bool HasDotLocAndDotFile; // Defaults to false.
/// SupportsDebugInformation - True if target supports emission of debugging /// SupportsDebugInformation - True if target supports emission of debugging
/// information. /// information.
bool SupportsDebugInformation; bool SupportsDebugInformation; // Defaults to false.
/// SupportsExceptionHandling - True if target supports /// SupportsExceptionHandling - True if target supports exception handling.
/// exception handling. ExceptionHandling::ExceptionsType ExceptionsType; // Defaults to None
///
// Defaults to None
ExceptionHandling::ExceptionsType ExceptionsType;
/// RequiresFrameSection - true if the Dwarf2 output needs a frame section /// RequiresFrameSection - true if the Dwarf2 output needs a frame section
/// bool DwarfRequiresFrameSection; // Defaults to true.
bool DwarfRequiresFrameSection; // Defaults to true.
/// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to /// DwarfUsesInlineInfoSection - True if DwarfDebugInlineSection is used to
/// encode inline subroutine information. /// encode inline subroutine information.
bool DwarfUsesInlineInfoSection; // Defaults to false. bool DwarfUsesInlineInfoSection; // Defaults to false.
/// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it /// Is_EHSymbolPrivate - If set, the "_foo.eh" is made private so that it
/// doesn't show up in the symbol table of the object file. /// doesn't show up in the symbol table of the object file.
bool Is_EHSymbolPrivate; // Defaults to true. bool Is_EHSymbolPrivate; // Defaults to true.
/// ForceEncodingOfFDETo32Bits - If set, the encoding of some of the FDE
/// data is forced to 32-bit.
bool ForceEncodingOfFDETo32Bits; // Defaults to true.
/// GlobalEHDirective - This is the directive used to make exception frame /// GlobalEHDirective - This is the directive used to make exception frame
/// tables globally visible. /// tables globally visible.
/// const char *GlobalEHDirective; // Defaults to NULL.
const char *GlobalEHDirective; // Defaults to NULL.
/// SupportsWeakEmptyEHFrame - True if target assembler and linker will /// SupportsWeakEmptyEHFrame - True if target assembler and linker will
/// handle a weak_definition of constant 0 for an omitted EH frame. /// handle a weak_definition of constant 0 for an omitted EH frame.
bool SupportsWeakOmittedEHFrame; // Defaults to true. bool SupportsWeakOmittedEHFrame; // Defaults to true.
/// DwarfSectionOffsetDirective - Special section offset directive. /// DwarfSectionOffsetDirective - Special section offset directive.
const char* DwarfSectionOffsetDirective; // Defaults to NULL const char* DwarfSectionOffsetDirective; // Defaults to NULL
@ -508,6 +505,9 @@ namespace llvm {
bool is_EHSymbolPrivate() const { bool is_EHSymbolPrivate() const {
return Is_EHSymbolPrivate; return Is_EHSymbolPrivate;
} }
bool forceEncodingOfFDETo32Bits() const {
return ForceEncodingOfFDETo32Bits;
}
const char *getGlobalEHDirective() const { const char *getGlobalEHDirective() const {
return GlobalEHDirective; return GlobalEHDirective;
} }

View File

@ -78,6 +78,7 @@ MCAsmInfo::MCAsmInfo() {
DwarfRequiresFrameSection = true; DwarfRequiresFrameSection = true;
DwarfUsesInlineInfoSection = false; DwarfUsesInlineInfoSection = false;
Is_EHSymbolPrivate = true; Is_EHSymbolPrivate = true;
ForceEncodingOfFDETo32Bits = true;
GlobalEHDirective = 0; GlobalEHDirective = 0;
SupportsWeakOmittedEHFrame = true; SupportsWeakOmittedEHFrame = true;
DwarfSectionOffsetDirective = 0; DwarfSectionOffsetDirective = 0;

View File

@ -52,6 +52,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
// doesn't hurt anything. // doesn't hurt anything.
// FIXME: I need to get this from Triple. // FIXME: I need to get this from Triple.
Is_EHSymbolPrivate = false; Is_EHSymbolPrivate = false;
ForceEncodingOfFDETo32Bits = false;
GlobalEHDirective = "\t.globl\t"; GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false; SupportsWeakOmittedEHFrame = false;