diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-10 14:32:26 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-10 14:32:26 -0800 |
commit | 28ff124c6e275da72d2550576f5c3282d0521d60 (patch) | |
tree | 84bd340bd1abfcbea3e7d52f0e9d60ec199bbebb /lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | |
parent | daf116d3a6d43e8e4ae3f10e75181fd59e2e62a6 (diff) |
exceptions support in backend itself
Diffstat (limited to 'lib/Transforms/NaCl/LowerEmExceptionsPass.cpp')
-rw-r--r-- | lib/Transforms/NaCl/LowerEmExceptionsPass.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp index fdf78bf6eb..18afc46c68 100644 --- a/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp +++ b/lib/Transforms/NaCl/LowerEmExceptionsPass.cpp @@ -17,6 +17,10 @@ // threw = postinvoke(); (check __THREW__) // br threw, l1, l2 // +// We do this to avoid introducing a new LLVM IR type, or to try to reuse +// invoke-landingpad for our special purposes (as they are checked very +// carefully by llvm) +// // 2) Lower landingpads to return a single i8*, avoid the structural type // which is unneeded anyhow. // @@ -127,7 +131,7 @@ bool LowerEmExceptions::runOnModule(Module &M) { CallInst *Post = CallInst::Create(PostInvoke, "", II); // Insert a branch based on the postInvoke - BranchInst::Create(II->getNormalDest(), II->getUnwindDest(), Post, II); + BranchInst::Create(II->getUnwindDest(), II->getNormalDest(), Post, II); // Replace the landingpad with a landingpad call to get the low part, and a getHigh for the high LandingPadInst *LP = II->getLandingPadInst(); |