- Nov 21, 2015
-
-
Tom Stellard authored
------------------------------------------------------------------------ r247435 | david.majnemer | 2015-09-11 13:34:34 -0400 (Fri, 11 Sep 2015) | 8 lines [X86] Make sure startproc/endproc are paired We used different conditions to determine if we should emit startproc vs endproc. Use the same condition to ensure that they will always be paired. This fixes PR24374. ------------------------------------------------------------------------ llvm-svn: 253742
-
- Jul 14, 2015
-
-
Keno Fischer authored
Summary: Before this change, personality directives were not emitted if there was no invoke left in the function (of course until recently this also meant that we couldn't know what the personality actually was). This patch forces personality directives to still be emitted, unless it is known to be a noop in the absence of invokes, or the user explicitly specified `nounwind` (and not `uwtable`) on the function. Reviewers: majnemer, rnk Subscribers: rnk, llvm-commits Differential Revision: http://reviews.llvm.org/D10884 llvm-svn: 242185
-
- Jul 13, 2015
-
-
Reid Kleckner authored
The outlined funclets call intrinsics which reference labels from the LSDA. This situation can easily arise in small functions with a single cleanup at -O0, where Clang marks a definition as nounwind, and then WinEHPrepare "discovers" that the landingpad is dead by accident and deletes it. We now need to ask the LLVM IR Function for it's personality directly, rather than going through MachineModuleInfo. Fixes PR23892. llvm-svn: 242063
-
- Jul 10, 2015
-
-
Reid Kleckner authored
Apparently this is important, otherwise _except_handler3 assumes that the registration node is corrupted and ignores it. Also fix a bug in WinEHPrepare where we would insert code after a terminator instruction. llvm-svn: 241877
-
- Jul 07, 2015
-
-
Reid Kleckner authored
Summary: Initially, these intrinsics seemed like part of a family of "frame" related intrinsics, but now I think that's more confusing than helpful. Initially, the LangRef specified that this would create a new kind of allocation that would be allocated at a fixed offset from the frame pointer (EBP/RBP). We ended up dropping that design, and leaving the stack frame layout alone. These intrinsics are really about sharing local stack allocations, not frame pointers. I intend to go further and add an `llvm.localaddress()` intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being used to address locals, which should not be confused with the frame pointer. Naming suggestions at this point are welcome, I'm happy to re-run sed. Reviewers: majnemer, nicholas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11011 llvm-svn: 241633
-
- Jun 30, 2015
-
-
Reid Kleckner authored
The incoming EBP value established by the runtime is actually a pointer to the end of the EH registration object, and not the true parent function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo anymore because we know that the exception info pointer is at a fixed offset from this incoming EBP. The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the EH runtime and returns a pointer that is usable with llvm.framerecover. The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit specific preparation pass in blocks targetted by the EH runtime. It re-establishes any physical registers used by the parent function to address the stack, such as the frame, base, and stack pointers. Neither of these intrinsics correctly handle stack realignment prologues yet, but it's possible to add that later. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D10848 llvm-svn: 241125
-
- Jun 11, 2015
-
-
Reid Kleckner authored
We were putting them in the filter field, which is correct for 64-bit but wrong for 32-bit. Also switch the order of scope table entry emission so outermost entries are emitted first, and fix an obvious state assignment bug. llvm-svn: 239574
-
Reid Kleckner authored
This intrinsic is like framerecover plus a load. It recovers the EH registration stack allocation from the parent frame and loads the exception information field out of it, giving back a pointer to an EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter expressions instead of accessing the EXCEPTION_POINTERS parameter that is available on x64. This required a minor change to MC to allow defining a label variable to another absolute framerecover label variable. llvm-svn: 239567
-
- Jun 10, 2015
-
-
Reid Kleckner authored
Our usage of 1 was a holdover from __C_specific_handler. llvm-svn: 239482
-
Reid Kleckner authored
llvm-svn: 239449
-
Reid Kleckner authored
Use a "safeseh" string attribute to do this. You would think we chould just accumulate the set of personalities like we do on dwarf, but this fails to account for the LSDA-loading thunks we use for __CxxFrameHandler3. Each of those needs to make it into .sxdata as well. The string attribute seemed like the most straightforward approach. llvm-svn: 239448
-
Reid Kleckner authored
llvm-svn: 239445
-
- Jun 09, 2015
-
-
Reid Kleckner authored
This gets all the handler info through to the asm printer and we can look at the .xdata tables now. I've convinced one small catch-all test case to work, but other than that, it would be a stretch to say this is functional. The state numbering algorithm avoids doing any scope reconstruction as we do for C++ to simplify the implementation. llvm-svn: 239433
-
- May 30, 2015
-
-
Jim Grosbach authored
llvm-svn: 238634
-
- May 29, 2015
-
-
Reid Kleckner authored
Small (really small!) C++ exception handling examples work on 32-bit x86 now. This change disables the use of .seh_* directives in WinException when CFI is not in use. It also uses absolute symbol references in the tables instead of imagerel32 relocations. Also fixes a cache invalidation bug in MMI personality classification. llvm-svn: 238575
-
- May 28, 2015
-
-
Reid Kleckner authored
This is in preparation for reusing this for 32-bit x86 EH table emission. Also updates the type name for consistency. NFC llvm-svn: 238521
-
- May 18, 2015
-
-
Jim Grosbach authored
The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
-
- May 11, 2015
-
-
Andrew Kaylor authored
Differential Revision: http://reviews.llvm.org/D9512 llvm-svn: 237014
-
- Apr 24, 2015
-
-
Lang Hames authored
AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a reference for this is crufty. llvm-svn: 235752
-
- Apr 23, 2015
-
-
Reid Kleckner authored
This reverts commit r235617. r235649 should have addressed the problems. llvm-svn: 235667
-
Reid Kleckner authored
We still have some "uses remain after removal" issues in -O0 builds. This reverts commit r235557. llvm-svn: 235617
-
- Apr 22, 2015
-
-
Reid Kleckner authored
This removes the -sehprepare flag and makes __C_specific_handler functions always to use WinEHPrepare. This was tested by building all of chromium_builder_tests and running a few tests that use SEH, but if something breaks, we can revert this. llvm-svn: 235557
-
- Apr 21, 2015
-
-
Reid Kleckner authored
Keep the old SEH fan-in lowering on by default for now, since projects rely on it. This will make it easy to test this change with a simple flag flip. llvm-svn: 235399
-
- Apr 17, 2015
-
-
David Majnemer authored
CatchHigh may be smaller than TryHigh if we reuse an outlined catch handler for two different invokes with different EH states. We have no evidence which shows that CatchHigh must be greater than TryHigh or TryLow. We can revisit this if we turn out to be wrong. llvm-svn: 235223
-
David Majnemer authored
Catch blocks which are empty may be in the same state as their try blocks. It is not meaningful to give the catch block its own state number in this case because it can't do anything exceptional. llvm-svn: 235212
-
-
Reid Kleckner authored
llvm-svn: 235155
-
Reid Kleckner authored
This now emits simple, unoptimized xdata tables for __C_specific_handler based on the handlers listed in @llvm.eh.actions calls produced by WinEHPrepare. This adds support for running __finally blocks when exceptions are thrown, and removes the old landingpad fan-in codepath. I ran some manual execution tests on small basic test cases with and without optimization, as well as on Chrome base_unittests, which uses a small amount of SEH. I'm sure there are bugs, and we may need to revert. llvm-svn: 235154
-
- Apr 15, 2015
-
-
Reid Kleckner authored
This avoids emitting code for unreachable landingpad blocks that contain calls to llvm.eh.actions and indirectbr. It's also a first step towards unifying the SEH and WinEH lowering codepaths. I'm keeping the old fan-in lowering of SEH around until the preparation version works well enough that we can switch over without breaking existing users. llvm-svn: 235037
-
Reid Kleckner authored
Fixed the test by removing extraneous quotes. llvm-svn: 235028
-
Reid Kleckner authored
This reverts commit r235025. The test isn't passing yet. llvm-svn: 235027
-
Reid Kleckner authored
Fixes assertions in MC when a local label wasn't defined. llvm-svn: 235025
-
- Apr 14, 2015
-
-
Reid Kleckner authored
Since adding invokes of llvm.donothing to cleanups, we come here now, and trivial EH cleanup usage from clang fails to compile. llvm-svn: 234948
-
- Apr 10, 2015
-
-
David Majnemer authored
The IPToState table must be emitted after we have generated labels for all functions in the table. Don't rely on the order of the list of globals. Instead, utilize WinEHFuncInfo to tell us how many catch handlers we expect to outline. Once we know we've visited all the catch handlers, emit the cppxdata. llvm-svn: 234566
-
- Apr 07, 2015
-
-
Reid Kleckner authored
The lack of a catch object is indicated by a frame escape index of -1. Fixes PR23137. llvm-svn: 234346
-
- Apr 03, 2015
-
-
David Majnemer authored
Now all fields in the WinEH xdata have been filled out. llvm-svn: 234067
-
David Majnemer authored
This add support for catching an exception such that an exception object available to the catch handler will be initialized by the runtime. llvm-svn: 234062
-
- Mar 31, 2015
-
-
David Majnemer authored
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
-
- Mar 30, 2015
-
-
David Majnemer authored
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
-
- Mar 17, 2015
-
-
Rafael Espindola authored
llvm-svn: 232475
-