diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-31 22:18:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-31 22:18:14 +0000 |
commit | 46b754c76bd6a720dd1dd3be248cb93a4e25d3e5 (patch) | |
tree | 89615dfd40d20168d5261f624e8ea6c7636e1552 /lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | 81c9a069377e9474d010f04eebe8325fd11429e3 (diff) |
add some comments on how this is *supposed* to work. We don't
need the PreferredEHDataFormat hook, but I have yet-more refactoring to
do before I can zap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 0c710fc813..8eb97af0f9 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -539,6 +539,9 @@ void DwarfException::EmitExceptionTable() { unsigned SizeAlign = (4 - TotalSize) & 3; // Begin the exception table. + //MCSection *LSDASection = TAI->getLSDASection(); + //Asm->SwitchToSection(LSDASection); + Asm->SwitchToDataSection(TAI->getDwarfExceptionSection()); Asm->EmitAlignment(2, 0, 0, false); O << "GCC_except_table" << SubprogramCount << ":\n"; @@ -560,8 +563,32 @@ void DwarfException::EmitExceptionTable() { Asm->EmitInt8(dwarf::DW_EH_PE_omit); Asm->EOL("TType format (DW_EH_PE_omit)"); } else { + // FIXME: Instead of using "PreferredEHDataFormat", we should use a simple + // approach to determine what needs to happen. Basically, if the target + // wants the LSDA to be emitted into a read-only segment (like .text) then + // (unless in static mode) it can't output direct pointers to the typeinfo + // objects, which may be in an arbitrary locations. Instead, it has to use + // and indirect stub pointer to get to the typeinfo. + // + // If the target wants to dump the LSDA's into a segment writable by the + // dynamic linker, then it can just use a normal pointer, and the dynamic + // linker will fix it up. + + // TODO: Replace the getDwarfExceptionSection() callback on TAI with a new + // getLSDASection() method on TLOF. Merge and sanitize the implementations, + // and figure out what the ".gcc_except_table" directive expands to on elf + // systems. + + // + //if (LSDASection->isWritable()) { + //Asm->EmitInt8(DW_EH_PE_absptr); + //} else { + //Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4); + //} + Asm->EmitInt8(TAI->PreferredEHDataFormat()); + // FIXME: The comment here should correspond with what PreferredEHDataFormat // returned. Asm->EOL("TType format (DW_EH_PE_xxxxx)"); |