aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86WinEHState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/X86/X86WinEHState.cpp')
-rw-r--r--lib/Target/X86/X86WinEHState.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/X86/X86WinEHState.cpp b/lib/Target/X86/X86WinEHState.cpp
index 0472a85f50da..6d6dedc60736 100644
--- a/lib/Target/X86/X86WinEHState.cpp
+++ b/lib/Target/X86/X86WinEHState.cpp
@@ -149,6 +149,12 @@ void WinEHStatePass::getAnalysisUsage(AnalysisUsage &AU) const {
}
bool WinEHStatePass::runOnFunction(Function &F) {
+ // Don't insert state stores or exception handler thunks for
+ // available_externally functions. The handler needs to reference the LSDA,
+ // which will not be emitted in this case.
+ if (F.hasAvailableExternallyLinkage())
+ return false;
+
// Check the personality. Do nothing if this personality doesn't use funclets.
if (!F.hasPersonalityFn())
return false;