summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/WinEHPrepare.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing a memory leak in WinEHPrepareAndrew Kaylor2015-04-031-0/+2
| | | | llvm-svn: 234059
* Fixing a build errorAndrew Kaylor2015-04-031-1/+1
| | | | llvm-svn: 234045
* Fixing build warnings.Andrew Kaylor2015-04-031-2/+0
| | | | llvm-svn: 234043
* [WinEH] Handle nested landing pads in outlined catch handlersAndrew Kaylor2015-04-031-27/+247
| | | | | | Differential Revision: http://reviews.llvm.org/D8596 llvm-svn: 234041
* [WinEH] Fold cast into assertion based on review feedbackReid Kleckner2015-04-031-3/+2
| | | | llvm-svn: 234034
* Fix unused variable in NDEBUG buildsReid Kleckner2015-04-021-0/+1
| | | | llvm-svn: 233978
* [WinEH] Make llvm.eh.actions use frameescape indices for catch paramsReid Kleckner2015-04-021-9/+44
| | | | | | | | | | | | | | | | | | This makes it possible to use the same representation of llvm.eh.actions in outlined handlers as we use in the parent function because i32's are just constants that can be copied freely between functions. I had to add a sentinel alloca to the list of child allocas so that we don't try to sink the catch object into the handler. Normally, one would use nullptr for this kind of thing, but TinyPtrVector doesn't support null elements. More than that, it's elements have to have a suitable alignment. Therefore, I settled on this for my sentinel: AllocaInst *getCatchObjectSentinel() { return static_cast<AllocaInst *>(nullptr) + 1; } llvm-svn: 233947
* Fix WinEHPrepare bug with multiple catch handlersAndrew Kaylor2015-04-011-179/+126
| | | | | | Differential Revision: http://reviews.llvm.org/D8682 llvm-svn: 233824
* [WinEH] Generate .xdata for catch handlersDavid Majnemer2015-03-311-10/+0
| | | | | | | | | | | | | | This lets us catch exceptions in simple cases. N.B. Things that do not work include (but are not limited to): - Throwing from within a catch handler. - Catching an object with a named catch parameter. - 'CatchHigh' is fictitious, we aren't sure of its purpose. - We aren't entirely efficient with regards to the number of EH states that we generate. - IP-to-State tables are sensitive to the order of emission. llvm-svn: 233767
* [WinEH] Run cleanup handlers when an exception is thrownDavid Majnemer2015-03-301-67/+9
| | | | | | | | Generate tables in the .xdata section representing what actions to take when an exception is thrown. This currently fills in state for cleanups, catch handlers are still unfinished. llvm-svn: 233636
* Fixing a bug with optimized catch-all handlers in WinEHPrepareAndrew Kaylor2015-03-271-5/+14
| | | | llvm-svn: 233439
* WinEH: Create a parent frame alloca for HandlerType xdata tablesDavid Majnemer2015-03-271-0/+10
| | | | | | | | We don't have any logic to emit those tables yet, so the SDAG lowering of this intrinsic is just a stub. We can see the intrinsic in the prepared IR, though. llvm-svn: 233354
* WinEH: Create an unwind help alloca for __CxxFrameHandler3 xdata tablesReid Kleckner2015-03-251-0/+13
| | | | | | | | We don't have any logic to emit those tables yet, so the sdag lowering of this intrinsic is just a stub. We can see the intrinsic in the prepared IR, though. llvm-svn: 233209
* [winehprepare] Update and sort includes. NFC.Benjamin Kramer2015-03-231-1/+2
| | | | llvm-svn: 232994
* Fixing a bug with WinEH PHI handlingAndrew Kaylor2015-03-201-1/+19
| | | | llvm-svn: 232851
* WinEH: Make llvm.eh.actions emission match the EH docsReid Kleckner2015-03-191-8/+5
| | | | | | | | | This switches the sense of the i32 values and updates the test cases. We can also use CHECK-SAME to clean up some tests, and reduce the visual noise from bitcasts. llvm-svn: 232774
* Use WinEHPrepare to outline SEH finally blocksReid Kleckner2015-03-181-41/+109
| | | | | | | | | | | No outlining is necessary for SEH catch blocks. Use the blockaddr of the handler in place of the usual outlined function. Reviewers: majnemer, andrew.w.kaylor Differential Revision: http://reviews.llvm.org/D8370 llvm-svn: 232664
* Make llvm.eh.actions an intrinsic and add docs for itReid Kleckner2015-03-121-5/+3
| | | | | | | | These docs *don't* match the way WinEHPrepare uses them yet, and verifier support isn't implemented either. The implementation will come after the documentation text is reviewed and agreed upon. llvm-svn: 232003
* Stop calling DwarfEHPrepare from WinEHPrepareReid Kleckner2015-03-121-39/+8
| | | | | | | | Instead, run both EH preparation passes, and have them both ignore functions with unrecognized EH personalities. Pass delegation involved some hacky code for creating an AnalysisResolver that we don't need now. llvm-svn: 231995
* Fix some clang warnings in WinEHPrepareReid Kleckner2015-03-111-3/+2
| | | | llvm-svn: 231985
* Extended support for native Windows C++ EH outliningAndrew Kaylor2015-03-111-139/+857
| | | | | | Differential Review: http://reviews.llvm.org/D7886 llvm-svn: 231981
* DataLayout is mandatory, update the API to reflect it with references.Mehdi Amini2015-03-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Now that the DataLayout is a mandatory part of the module, let's start cleaning the codebase. This patch is a first attempt at doing that. This patch is not exactly NFC as for instance some places were passing a nullptr instead of the DataLayout, possibly just because there was a default value on the DataLayout argument to many functions in the API. Even though it is not purely NFC, there is no change in the validation. I turned as many pointer to DataLayout to references, this helped figuring out all the places where a nullptr could come up. I had initially a local version of this patch broken into over 30 independant, commits but some later commit were cleaning the API and touching part of the code modified in the previous commits, so it seemed cleaner without the intermediate state. Test Plan: Reviewers: echristo Subscribers: llvm-commits From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231740
* Reland r229944: EH: Prune unreachable resume instructions during Dwarf EH ↵Reid Kleckner2015-03-091-3/+25
| | | | | | | | | | | | preparation Fix the double-deletion of AnalysisResolver when delegating through to Dwarf EH preparation by creating one from scratch. Hopefully the new pass manager simplifies this. This reverts commit r229952. llvm-svn: 231719
* Fix uninitialized memory references in WinEHPrepareAndrew Kaylor2015-03-051-1/+3
| | | | llvm-svn: 231405
* Replace llvm.frameallocate with llvm.frameescapeReid Kleckner2015-03-051-159/+54
| | | | | | | | | | Turns out it's pretty straightforward and simplifies the implementation. Reviewers: andrew.w.kaylor Differential Revision: http://reviews.llvm.org/D8051 llvm-svn: 231386
* Make DataLayout Non-Optional in the ModuleMehdi Amini2015-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: DataLayout keeps the string used for its creation. As a side effect it is no longer needed in the Module. This is "almost" NFC, the string is no longer canonicalized, you can't rely on two "equals" DataLayout having the same string returned by getStringRepresentation(). Get rid of DataLayoutPass: the DataLayout is in the Module The DataLayout is "per-module", let's enforce this by not duplicating it more than necessary. One more step toward non-optionality of the DataLayout in the module. Make DataLayout Non-Optional in the Module Module->getDataLayout() will never returns nullptr anymore. Reviewers: echristo Subscribers: resistor, llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D7992 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231270
* WinEH: Remove vestigial EH objectReid Kleckner2015-03-031-43/+13
| | | | | | | | Ultimately, we'll need to leave something behind to indicate which alloca will hold the exception, but we can figure that out when it comes time to emit the __CxxFrameHandler3 catch handler table. llvm-svn: 231164
* Fixing problem with field initialization orderAndrew Kaylor2015-03-031-2/+2
| | | | llvm-svn: 231122
* Outline cleanup handlers for native Windows C++ exception handlingAndrew Kaylor2015-03-031-97/+251
| | | | | | Differential Revision: http://reviews.llvm.org/D7865 llvm-svn: 231117
* Remap arguments and non-alloca values used by outlined C++ exception handlers.Andrew Kaylor2015-03-031-40/+76
| | | | | | Differential Revision: http://reviews.llvm.org/D7844 llvm-svn: 231042
* Fixing a problem with insert location in WinEH outliningAndrew Kaylor2015-02-251-0/+1
| | | | llvm-svn: 230535
* Fixing eol-styleAndrew Kaylor2015-02-241-625/+625
| | | | llvm-svn: 230378
* Removing unused private field.Andrew Kaylor2015-02-231-3/+1
| | | | llvm-svn: 230259
* Second attempt to fix WinEHCatchDirector build failures.Andrew Kaylor2015-02-231-1/+0
| | | | llvm-svn: 230257
* Attempting to fix WinEHCatchDirector destructor related build failures.Andrew Kaylor2015-02-231-0/+1
| | | | llvm-svn: 230252
* Remap frame variables for native Windows exception handling.Andrew Kaylor2015-02-231-390/+627
| | | | | | Differential Revision: http://reviews.llvm.org/D7770 llvm-svn: 230249
* Revert r229944: EH: Prune unreachable resume instructions during Dwarf EH ↵Chandler Carruth2015-02-201-12/+3
| | | | | | | | | preparation This doesn't pass 'ninja check-llvm' for me. Lots of tests, including the ones updated, fail with crashes and other explosions. llvm-svn: 229952
* EH: Prune unreachable resume instructions during Dwarf EH preparationReid Kleckner2015-02-201-3/+12
| | | | | | | | | | | | | | | | | Today a simple function that only catches exceptions and doesn't run destructor cleanups ends up containing a dead call to _Unwind_Resume (PR20300). We can't remove these dead resume instructions during normal optimization because inlining might introduce additional landingpads that do have cleanups to run. Instead we can do this during EH preparation, which is guaranteed to run after inlining. Fixes PR20300. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D7744 llvm-svn: 229944
* Style and formatting fixes for r229715Andrew Kaylor2015-02-181-1/+0
| | | | llvm-svn: 229758
* dos2unix the WinEH file and testsReid Kleckner2015-02-181-391/+391
| | | | llvm-svn: 229735
* Remove unused member variables (-Wunused-private-field)David Blaikie2015-02-181-7/+3
| | | | llvm-svn: 229722
* Adding implementation to outline C++ catch handlers for native Windows 64 ↵Andrew Kaylor2015-02-181-102/+395
| | | | | | | | exception handling. Differential Revision: http://reviews.llvm.org/D7363 llvm-svn: 229715
* Don't promote asynch EH invokes of nounwind functions to callsReid Kleckner2015-02-111-1/+1
| | | | | | | | | | | If the landingpad of the invoke is using a personality function that catches asynch exceptions, then it can catch a trap. Also add some landingpads to invalid LLVM IR test cases that lack them. Over-the-shoulder reviewed by David Majnemer. llvm-svn: 228782
* Fix memory leak in WinEHPrepare introduced in r227405.Alexey Samsonov2015-01-301-1/+3
| | | | | | This leak was detected by ASan bootstrap of LLVM. llvm-svn: 227625
* Update comments to use unreachable instead of llvm.trap, as implemented nowReid Kleckner2015-01-291-1/+1
| | | | llvm-svn: 227502
* EHPrepare: Remove leftover initialization code for DomTrees.Benjamin Kramer2015-01-291-5/+2
| | | | | | While there modernize some loops. NFC. llvm-svn: 227436
* Remove an unused private field added r227405 to fix a Clang warning.Chandler Carruth2015-01-291-2/+1
| | | | llvm-svn: 227415
* Remove unused variableReid Kleckner2015-01-291-2/+0
| | | | llvm-svn: 227408
* Add a Windows EH preparation pass that zaps resumesReid Kleckner2015-01-291-0/+106
If the personality is not a recognized MSVC personality function, this pass delegates to the dwarf EH preparation pass. This chaining supports people on *-windows-itanium or *-windows-gnu targets. Currently this recognizes some personalities used by MSVC and turns resume instructions into traps to avoid link errors. Even if cleanups are not used in the source program, LLVM requires the frontend to emit a code path that resumes unwinding after an exception. Clang does this, and we get unreachable resume instructions. PR20300 covers cleaning up these unreachable calls to resume. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D7216 llvm-svn: 227405
OpenPOWER on IntegriCloud