mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-13 07:00:59 +00:00
Pull check for SJLJ EH into a boolean and use that.
llvm-svn: 81409
This commit is contained in:
parent
bf36b07bff
commit
0ec5ddeecf
@ -599,19 +599,22 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
const unsigned LandingPadSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
|
const unsigned LandingPadSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
|
||||||
unsigned SizeSites;
|
unsigned SizeSites;
|
||||||
|
|
||||||
bool HaveTTData = (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
|
bool IsSJLJ = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj;
|
||||||
? (!TypeInfos.empty() || !FilterIds.empty()) : true;
|
|
||||||
|
|
||||||
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
|
bool HaveTTData = IsSJLJ ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
|
||||||
|
|
||||||
|
if (IsSJLJ)
|
||||||
SizeSites = 0;
|
SizeSites = 0;
|
||||||
} else
|
else
|
||||||
SizeSites = CallSites.size() *
|
SizeSites = CallSites.size() *
|
||||||
(SiteStartSize + SiteLengthSize + LandingPadSize);
|
(SiteStartSize + SiteLengthSize + LandingPadSize);
|
||||||
|
|
||||||
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
|
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
|
||||||
SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
|
SizeSites += MCAsmInfo::getULEB128Size(CallSites[i].Action);
|
||||||
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj)
|
if (IsSJLJ)
|
||||||
SizeSites += MCAsmInfo::getULEB128Size(i);
|
SizeSites += MCAsmInfo::getULEB128Size(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type infos.
|
// Type infos.
|
||||||
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
|
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
|
||||||
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
|
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
|
||||||
@ -640,7 +643,7 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EmitLabel("exception", SubprogramCount);
|
EmitLabel("exception", SubprogramCount);
|
||||||
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
|
if (IsSJLJ) {
|
||||||
SmallString<16> LSDAName;
|
SmallString<16> LSDAName;
|
||||||
raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() <<
|
raw_svector_ostream(LSDAName) << MAI->getPrivateGlobalPrefix() <<
|
||||||
"_LSDA_" << Asm->getFunctionNumber();
|
"_LSDA_" << Asm->getFunctionNumber();
|
||||||
@ -710,7 +713,7 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SjLj Exception handilng
|
// SjLj Exception handilng
|
||||||
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
|
if (IsSJLJ) {
|
||||||
Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
|
Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
|
||||||
Asm->EOL("Call site format", dwarf::DW_EH_PE_udata4);
|
Asm->EOL("Call site format", dwarf::DW_EH_PE_udata4);
|
||||||
Asm->EmitULEB128Bytes(SizeSites);
|
Asm->EmitULEB128Bytes(SizeSites);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user