summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-01-21 00:43:30 +0000
committerJim Grosbach <grosbach@apple.com>2010-01-21 00:43:30 +0000
commite029a6a5ed9917200583f1b613fa55953b4a0784 (patch)
tree07b77a6a6f4cfc44cf1c3eaaa31fcef9bd4793f2 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
parent7a77eae2f3d4d2f0ff0ea4b817c24823f4a8b5c6 (diff)
downloadbcm5719-llvm-e029a6a5ed9917200583f1b613fa55953b4a0784.tar.gz
bcm5719-llvm-e029a6a5ed9917200583f1b613fa55953b4a0784.zip
Make sure that landing pad entries in the EH call site table are in the proper
order for SjLj style exception handling. llvm-svn: 94055
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 615be0e1c79..d09f9d9bca4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud