diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-07-28 22:23:45 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-07-28 22:23:45 +0000 |
commit | 15349f81fb144c6cecca11559cd567735d5132c8 (patch) | |
tree | 4862ed091b3e603ec94a260d24b71c2b66684058 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | c43267a4725b643fd1763306af3bd33a01e9fe0e (diff) | |
download | bcm5719-llvm-15349f81fb144c6cecca11559cd567735d5132c8.tar.gz bcm5719-llvm-15349f81fb144c6cecca11559cd567735d5132c8.zip |
Output the EH TType format and base offset only if there are types that we're
going to emit.
llvm-svn: 77382
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 6a251beda28..60b8acdfbe2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -527,18 +527,27 @@ void DwarfException::EmitExceptionTable() { // Emit the header. Asm->EmitInt8(dwarf::DW_EH_PE_omit); Asm->EOL("LPStart format (DW_EH_PE_omit)"); - Asm->EmitInt8(TAI->PreferredEHDataFormat(DwarfEncoding::Data, true)); - Asm->EOL("TType format (DW_EH_PE_absptr)"); - Asm->EmitULEB128Bytes(TypeOffset); - Asm->EOL("TType base offset"); + + if (!TypeInfos.empty() || !FilterIds.empty()) { + Asm->EmitInt8(TAI->PreferredEHDataFormat(DwarfEncoding::Data, true)); + // FIXME: The comment here should correspond with what PreferredEHDataFormat + // returned. + Asm->EOL("TType format (DW_EH_PE_xxxxx)"); + Asm->EmitULEB128Bytes(TypeOffset); + Asm->EOL("TType base offset"); + } else { + Asm->EmitInt8(dwarf::DW_EH_PE_omit); + Asm->EOL("TType format (DW_EH_PE_omit)"); + } + Asm->EmitInt8(dwarf::DW_EH_PE_udata4); Asm->EOL("Call site format (DW_EH_PE_udata4)"); Asm->EmitULEB128Bytes(SizeSites); Asm->EOL("Call-site table length"); // Emit the landing pad site information. - for (unsigned i = 0; i < CallSites.size(); ++i) { - CallSiteEntry &S = CallSites[i]; + for (unsigned i = 0, e = CallSites.size(); i < e; ++i) { + const CallSiteEntry &S = CallSites[i]; const char *BeginTag; unsigned BeginNumber; |