[llvm-commits] [llvm] r77382 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
Bill Wendling
isanbard at gmail.com
Tue Jul 28 15:23:45 PDT 2009
Author: void
Date: Tue Jul 28 17:23:45 2009
New Revision: 77382
URL: http://llvm.org/viewvc/llvm-project?rev=77382&view=rev
Log:
Output the EH TType format and base offset only if there are types that we're
going to emit.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=77382&r1=77381&r2=77382&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Jul 28 17:23:45 2009
@@ -527,18 +527,27 @@
// 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;
More information about the llvm-commits
mailing list