diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-04 20:10:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-04 20:10:41 +0000 |
commit | 9be49131363f79ad58a5deb4daf175a7b1c0ec66 (patch) | |
tree | c96203a146972306d41461bd10c977eb170e128b /lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | ca6190b108aeb4a2eeb6f5c6457bb17509b85d9d (diff) |
simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 6dad20962b..f8e656cd9e 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -354,7 +354,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads, I = LandingPads.begin(), E = LandingPads.end(); I != E; ++I) { const LandingPadInfo *LPI = *I; const std::vector<int> &TypeIds = LPI->TypeIds; - const unsigned NumShared = PrevLPI ? SharedTypeIds(LPI, PrevLPI) : 0; + unsigned NumShared = PrevLPI ? SharedTypeIds(LPI, PrevLPI) : 0; unsigned SizeSiteActions = 0; if (NumShared < TypeIds.size()) { @@ -362,7 +362,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads, unsigned PrevAction = (unsigned)-1; if (NumShared) { - const unsigned SizePrevIds = PrevLPI->TypeIds.size(); + unsigned SizePrevIds = PrevLPI->TypeIds.size(); assert(Actions.size()); PrevAction = Actions.size() - 1; SizeAction = @@ -622,18 +622,19 @@ void DwarfException::EmitExceptionTable() { // Final tallies. // Call sites. - const unsigned SiteStartSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4); - const unsigned SiteLengthSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4); - const unsigned LandingPadSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4); bool IsSJLJ = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj; bool HaveTTData = IsSJLJ ? (!TypeInfos.empty() || !FilterIds.empty()) : true; + unsigned CallSiteTableLength; - if (IsSJLJ) CallSiteTableLength = 0; - else - CallSiteTableLength = CallSites.size() * - (SiteStartSize + SiteLengthSize + LandingPadSize); + else { + unsigned SiteStartSize = 4; // dwarf::DW_EH_PE_udata4 + unsigned SiteLengthSize = 4; // dwarf::DW_EH_PE_udata4 + unsigned LandingPadSize = 4; // dwarf::DW_EH_PE_udata4 + CallSiteTableLength = + CallSites.size() * (SiteStartSize + SiteLengthSize + LandingPadSize); + } for (unsigned i = 0, e = CallSites.size(); i < e; ++i) { CallSiteTableLength += MCAsmInfo::getULEB128Size(CallSites[i].Action); @@ -650,7 +651,7 @@ void DwarfException::EmitExceptionTable() { // For SjLj exceptions, if there is no TypeInfo, then we just explicitly say // that we're omitting that bit. TTypeEncoding = dwarf::DW_EH_PE_omit; - TypeFormatSize = SizeOfEncodedValue(dwarf::DW_EH_PE_absptr); + TypeFormatSize = TD->getPointerSize(); // dwarf::DW_EH_PE_absptr } else { // Okay, we have actual filters or typeinfos to emit. As such, we need to // pick a type encoding for them. We're about to emit a list of pointers to |