diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-01-21 00:43:30 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-01-21 00:43:30 +0000 |
commit | d0a0c382ea51d36dc7e5938291763da73b4262dc (patch) | |
tree | 7915691c3b9bc343921177c6faac70d7ea9b600e /lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | fd0b0288e2ee5ccf3f1d47090542710c67a77cf7 (diff) |
Make sure that landing pad entries in the EH call site table are in the proper
order for SjLj style exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 615be0e1c7..d09f9d9bca 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -590,7 +590,16 @@ ComputeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites, } // Otherwise, create a new call-site. - CallSites.push_back(Site); + if (MAI->getExceptionHandlingType() == ExceptionHandling::Dwarf) + CallSites.push_back(Site); + else { + // SjLj EH must maintain the call sites in the order assigned + // to them by the SjLjPrepare pass. + unsigned SiteNo = MMI->getCallSiteBeginLabel(BeginLabel); + if (CallSites.size() < SiteNo) + CallSites.resize(SiteNo); + CallSites[SiteNo - 1] = Site; + } PreviousIsInvoke = true; } else { // Create a gap. |