summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* There is an impedance matching problem between LLVM andDuncan Sands2007-08-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc exception handling: if an exception unwinds through an invoke, then execution must branch to the invoke's unwind target. We previously tried to enforce this by appending a cleanup action to every selector, however this does not always work correctly due to an optimization in the C++ unwinding runtime: if only cleanups would be run while unwinding an exception, then the program just terminates without actually executing the cleanups, as invoke semantics would require. I was hoping this wouldn't be a problem, but in fact it turns out to be the cause of all the remaining failures in the LLVM testsuite (these also fail with -enable-correct-eh-support, so turning on -enable-eh didn't make things worse!). Instead we need to append a full-blown catch-all to the end of each selector. The correct way of doing this depends on the personality function, i.e. it is language dependent, so can only be done by gcc. Thus this patch which generalizes the eh.selector intrinsic so that it can handle all possible kinds of action table entries (before it didn't accomodate cleanups): now 0 indicates a cleanup, and filters have to be specified using the number of type infos plus one rather than the number of type infos. Related gcc patches will cause Ada to pass a cleanup (0) to force the selector to always fire, while C++ will use a C++ catch-all (null). llvm-svn: 41484
* Long live the exception handling!Anton Korobeynikov2007-07-141-0/+4
| | | | | | | | | | | | | | | This patch fills the last necessary bits to enable exceptions handling in LLVM. Currently only on x86-32/linux. In fact, this patch adds necessary intrinsics (and their lowering) which represent really weird target-specific gcc builtins used inside unwinder. After corresponding llvm-gcc patch will land (easy) exceptions should be more or less workable. However, exceptions handling support should not be thought as 'finished': I expect many small and not so small glitches everywhere. llvm-svn: 39855
* Make sure only one copy of a filter is placed in theDuncan Sands2007-07-051-3/+21
| | | | | | | | exception handling table if we encounter it multiple times. Filters could be folded harder than this, but that would mean a lot more work for not much gain. llvm-svn: 37908
* The semantics of invoke require that we always jump to the unwind blockDuncan Sands2007-06-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | (landing pad) when an exception unwinds through the call. This doesn't quite match the way the dwarf unwinder works: by default it only jumps to the landing pad if the catch or filter specification matches, and otherwise it keeps on unwinding. There are two ways of specifying to the unwinder that it should "always" (more on why there are quotes here later) jump to the landing pad: follow the specification by a 0 typeid, or follow it by the typeid for the NULL typeinfo. GCC does the first, and this patch makes LLVM do the same as gcc. However there is a problem: the unwinder performs optimizations based on C++ semantics (it only expects destructors to be run if the 0 typeid fires - known as "cleanups"), meaning it assumes that no exceptions will be raised and that the raised exception will be reraised at the end of the cleanup code. So if someone writes their own LLVM code using the exception intrinsics they will get a nasty surprise if they don't follow these rules. The other possibility of using the typeid corresponding to NULL (catch-all) causes the unwinder to make no assumptions, so this is probably what we should use in the long-run. However since we are still having trouble getting exception handling working properly, for the moment it seems best to closely imitate GCC. llvm-svn: 37399
* Integrate exception filter support and exception catch support. ThisDuncan Sands2007-06-021-4/+23
| | | | | | | | simplifies the code in DwarfWriter, allows for multiple filters and makes it trivial to specify filters accompanied by cleanups or catch-all specifications (see next patch). What a deal! Patch blessed by Anton. llvm-svn: 37398
* Mark all calls as "could throw", when exceptions are enabled. Emit necessary ↵Anton Korobeynikov2007-05-231-4/+12
| | | | | | LP info too. This fixes PR1439 llvm-svn: 37311
* Emit multiple common EH frames for multiple (including blank) personalityAnton Korobeynikov2007-05-131-13/+30
| | | | | | | | functions. This partly fixes PR1414: now we're restricted only to one personality function per eh frame, not per module. Further work on "multiple personalities" topic needs representative example. llvm-svn: 37018
* More DWARF-related things cleanup:Anton Korobeynikov2007-05-121-3/+12
| | | | | | | | | | 1. Fix PR1380 2. Apply Duncan's patch from PR1410 3. Insert workaround for "one personality function per module" as noted in PR1414 4. Emit correct debug frames for x86/linux. This partly fixes DebugInfo/2006-11-06-StackTrace.cpp: stack trace is shown correctly, but arguments for function on top of stack are displayed incorrectly. llvm-svn: 37015
* Fix ↵Devang Patel2007-05-111-1/+1
| | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049516.html llvm-svn: 36998
* Ooops. Some debugging stuff :)Anton Korobeynikov2007-05-101-1/+0
| | | | llvm-svn: 36978
* Allow multiple invokes per landing pad. This (probably) fixes PR1410.Anton Korobeynikov2007-05-101-8/+21
| | | | llvm-svn: 36977
* Drop 'const'Devang Patel2007-05-031-3/+3
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-3/+3
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Fix build error.Lauro Ramos Venancio2007-05-021-1/+1
| | | | llvm-svn: 36648
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-1/+8
| | | | llvm-svn: 36632
* Collect eh filter info.Jim Laskey2007-03-011-12/+19
| | | | llvm-svn: 34804
* Add structures used for collecting eh information.Jim Laskey2007-02-211-0/+94
| | | | llvm-svn: 34473
* Support for non-landing pad exception handling.Jim Laskey2007-02-011-0/+3
| | | | llvm-svn: 33755
* Out of line function.Jim Laskey2007-01-291-0/+7
| | | | llvm-svn: 33641
* rename filesJim Laskey2007-01-261-0/+1696
llvm-svn: 33552
OpenPOWER on IntegriCloud