aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-09-10 00:17:04 +0000
committerBill Wendling <isanbard@gmail.com>2009-09-10 00:17:04 +0000
commitd1a5b37a62e829e56b6225e0934a01d9f8823387 (patch)
treede368f5041087d001621e2788d85ffc2c28549d4 /lib/CodeGen/AsmPrinter/DwarfException.cpp
parent40121bccbee44d387ab5d6a5194c5fc27c542e12 (diff)
Pull check for SJLJ EH into a boolean and use that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp
index a41d1b00e4..1254372137 100644
--- a/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -599,19 +599,22 @@ void DwarfException::EmitExceptionTable() {
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 @@ void DwarfException::EmitExceptionTable() {
}
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 @@ void DwarfException::EmitExceptionTable() {
#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);