summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-05-05 17:44:16 +0000
committerReid Kleckner <reid@kleckner.net>2015-05-05 17:44:16 +0000
commit0738a9c02ef62d83791d0da8e220ead21723ea40 (patch)
treee2628543dd3636d26c795bc90235c55ab4b2a3df /llvm/lib/CodeGen/WinEHPrepare.cpp
parent61b305edfd861d27726d7b0a9cdffd18d6423cdb (diff)
downloadbcm5719-llvm-0738a9c02ef62d83791d0da8e220ead21723ea40.tar.gz
bcm5719-llvm-0738a9c02ef62d83791d0da8e220ead21723ea40.zip
Re-land "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"
This reverts commit r236360. This change exposed a bug in WinEHPrepare by opting win32 code into EH preparation. We already knew that WinEHPrepare has bugs, and is the status quo for x64, so I don't think that's a reason to hold off on this change. I disabled exceptions in the sanitizer tests in r236505 and an earlier revision. llvm-svn: 236508
Diffstat (limited to 'llvm/lib/CodeGen/WinEHPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/WinEHPrepare.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index c1067c5d560..db91c02ee46 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -8,9 +8,11 @@
//===----------------------------------------------------------------------===//
//
// This pass lowers LLVM IR exception handling into something closer to what the
-// backend wants. It snifs the personality function to see which kind of
-// preparation is necessary. If the personality function uses the Itanium LSDA,
-// this pass delegates to the DWARF EH preparation pass.
+// backend wants for functions using a personality function from a runtime
+// provided by MSVC. Functions with other personality functions are left alone
+// and may be prepared by other passes. In particular, all supported MSVC
+// personality functions require cleanup code to be outlined, and the C++
+// personality requires catch handler code to be outlined.
//
//===----------------------------------------------------------------------===//
@@ -31,7 +33,6 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Pass.h"
-#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
@@ -922,7 +923,7 @@ bool WinEHPrepare::prepareExceptionHandlers(
if (SEHExceptionCodeSlot) {
if (SEHExceptionCodeSlot->hasNUses(0))
SEHExceptionCodeSlot->eraseFromParent();
- else
+ else if (isAllocaPromotable(SEHExceptionCodeSlot))
PromoteMemToReg(SEHExceptionCodeSlot, *DT);
}
OpenPOWER on IntegriCloud