diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-09-10 00:17:04 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-09-10 00:17:04 +0000 |
| commit | a482ec83c5bf5dd5039c5faf8b335464014c2a68 (patch) | |
| tree | e3eb3084773ff0c5b53a9f522d5f3f10c627b684 /llvm/lib/CodeGen | |
| parent | 73094e15c48b86d1e85f87bb0c3dc0cec65381a5 (diff) | |
| download | bcm5719-llvm-a482ec83c5bf5dd5039c5faf8b335464014c2a68.tar.gz bcm5719-llvm-a482ec83c5bf5dd5039c5faf8b335464014c2a68.zip | |
Pull check for SJLJ EH into a boolean and use that.
llvm-svn: 81409
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index a41d1b00e46..12543721373 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/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); |

