aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-07-28 22:23:45 +0000
committerBill Wendling <isanbard@gmail.com>2009-07-28 22:23:45 +0000
commitb0d9c3e7fdc952ae7cbe169b01ccaf1b80329403 (patch)
tree30ee5ab078635d0da64db37d7a633e72b443e5ba /lib/CodeGen/AsmPrinter/DwarfException.cpp
parente240beb0652f47adb5f58040ce17e43dcf25653f (diff)
Output the EH TType format and base offset only if there are types that we're
going to emit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 6a251beda2..60b8acdfbe 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/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;