GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure

about other platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61415 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2008-12-24 05:25:49 +00:00
parent e5b7e0ec08
commit d4121bef3c
4 changed files with 26 additions and 4 deletions

View File

@ -448,6 +448,11 @@ namespace llvm {
///
bool DwarfRequiresFrameSection; // Defaults to true.
/// FDEEncodingRequiresSData4 - If set, the FDE Encoding in the EH section
/// includes DW_EH_PE_sdata4.
///
bool FDEEncodingRequiresSData4; // Defaults to true
/// GlobalEHDirective - This is the directive used to make exception frame
/// tables globally visible.
///
@ -814,6 +819,9 @@ namespace llvm {
bool doesDwarfRequireFrameSection() const {
return DwarfRequiresFrameSection;
}
bool doesFDEEncodingRequireSData4() const {
return FDEEncodingRequiresSData4;
}
const char *getGlobalEHDirective() const {
return GlobalEHDirective;
}

View File

@ -3017,13 +3017,25 @@ private:
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
Asm->EOL("LSDA Encoding (pcrel sdata4)");
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
Asm->EOL("FDE Encoding (pcrel sdata4)");
if (TAI->doesFDEEncodingRequireSData4()) {
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
Asm->EOL("FDE Encoding (pcrel sdata4)");
} else {
Asm->EmitInt8(DW_EH_PE_pcrel);
Asm->EOL("FDE Encoding (pcrel)");
}
} else {
Asm->EmitULEB128Bytes(1);
Asm->EOL("Augmentation Size");
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
Asm->EOL("FDE Encoding (pcrel sdata4)");
if (TAI->doesFDEEncodingRequireSData4()) {
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
Asm->EOL("FDE Encoding (pcrel sdata4)");
} else {
Asm->EmitInt8(DW_EH_PE_pcrel);
Asm->EOL("FDE Encoding (pcrel)");
}
}
// Indicate locations of general callee saved registers in frame.

View File

@ -99,6 +99,7 @@ void TargetAsmInfo::fillDefaultValues() {
SupportsDebugInformation = false;
SupportsExceptionHandling = false;
DwarfRequiresFrameSection = true;
FDEEncodingRequiresSData4 = true;
GlobalEHDirective = 0;
SupportsWeakOmittedEHFrame = true;
DwarfSectionOffsetDirective = 0;

View File

@ -70,6 +70,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM):
COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
HasDotTypeDotSizeDirective = false;
HasSingleParameterDotFile = false;
FDEEncodingRequiresSData4 = false;
if (TM.getRelocationModel() == Reloc::Static) {
StaticCtorsSection = ".constructor";
StaticDtorsSection = ".destructor";