[llvm-commits] [llvm] r81409 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
Bill Wendling
isanbard at gmail.com
Wed Sep 9 17:17:05 PDT 2009
Author: void
Date: Wed Sep 9 19:17:04 2009
New Revision: 81409
URL: http://llvm.org/viewvc/llvm-project?rev=81409&view=rev
Log:
Pull check for SJLJ EH into a boolean and use that.
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=81409&r1=81408&r2=81409&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Sep 9 19:17:04 2009
@@ -599,19 +599,22 @@
const unsigned LandingPadSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
unsigned SizeSites;
- bool HaveTTData = (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
- ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
+ bool IsSJLJ = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj;
- if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
+ bool HaveTTData = IsSJLJ ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
+
+ if (IsSJLJ)
SizeSites = 0;
- } else
+ else
SizeSites = CallSites.size() *
(SiteStartSize + SiteLengthSize + LandingPadSize);
+
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
- if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
+ if (IsSJLJ)
SizeSites += MCAsmInfo::getULEB128Size(i);
}
+
// Type infos.
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
@@ -640,7 +643,7 @@
}
EmitLabel("exception", SubprogramCount);
- if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
+ if (IsSJLJ) {
SmallString<16> LSDAName;
raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() <<
"_LSDA_" << Asm->getFunctionNumber();
@@ -710,7 +713,7 @@
#endif
// SjLj Exception handilng
- if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
+ if (IsSJLJ) {
Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
Asm->EOL("Call site format", dwarf::DW_EH_PE_udata4);
Asm->EmitULEB128Bytes(SizeSites);
More information about the llvm-commits
mailing list