Commit graph

37 commits

Author SHA1 Message Date
David Nadlinger
2b800b8732 Fix catch clause codegen.
In the 2.064 frontend, the catch variables have a zero
initializer, so DtoDeclarationExp overwrote the actually
caught exception with null.
2013-10-29 19:21:15 +01:00
David Nadlinger
55c02f725a Fix IRLandingPadCatchInfo initialization order warning. 2013-10-29 19:21:15 +01:00
David Nadlinger
787c147986 Use Module::members -> Dsymbol::codegen to define symbols.
This commit fundamentally changes the way symbol emission in
LDC works: Previously, whenever a declaration was used in some
way, the compiler would check whether it actually needs to be
defined in the currently processed module, based only on the
symbol itself. This lack of contextual information proved to
be a major problem in correctly handling emission of templates
(see e.g. #454).

Now, the DtoResolve…() family of functions and similar only
ever declare the symbols, and definition is handled by doing
a single pass over Module::members for the root module. This
is the same strategy that DMD uses as well, which should
also reduce the maintainance burden down the road (which is
important as during the last few releases, there was pretty
much always a symbol emission related problem slowing us
down).

Our old approach might have been a bit better tuned w.r.t.
avoiding emission of unneeded template instances, but 2.064
will bring improvements here (DMD: FuncDeclaration::toObjFile).
Barring such issues, the change shoud also marginally improve
compile times because of declarations no longer being emitted
when they are not needed.

In the future, we should also consider refactoring the code
so that it no longer directly accesses Dsymbol::ir but uses
wrapper functions that ensure that the appropriate
DtoResolve…() function has been called.

GitHub: Fixes #454.
2013-10-13 19:18:24 +02:00
kai
c28c7fb134 Introduce a debug info builder.
Moves all code from todebug into a new class.
Also caches the compilation unit in order to fix a LLVM 3.4 compile error.
2013-07-29 00:04:08 +02:00
Alexey Prokhin
407f45b07d Extend IRLandingPad to support arbitrary finally blocks.
Just laying down the ground work before fixing issue 426.
2013-07-10 13:34:16 +04:00
Alexey Prokhin
09c471ae74 Properly implement exception chaining 2013-06-18 17:06:00 +04:00
Alexey Prokhin
49f8cfe99e Fixed codegen of nested try-catch-finally blocks 2013-06-18 14:16:51 +04:00
David Nadlinger
1215ffacd3 Complete IrStruct->IrAggr rename. 2013-06-17 13:14:15 +02:00
David Nadlinger
f894a7809c Update catch landingpad codegen to match latest druntime change. 2013-05-11 23:29:39 +02:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
Alexey Prokhin
2f60c4dcda Codegen the try block before the catches and finally 2012-04-21 22:37:32 +04:00
Alexey Prokhin
91f4e5d015 Added emission of dwarf lexical blocks.
Also, dropped support for DISABLE_DEBUG_INFO definition.
2011-12-04 15:34:35 +04:00
Alexey Prokhin
aee896f85b Port exceptions to llvm 3.0 2011-10-25 15:43:49 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
ed84a21462 Fixed try/finally statements inside another finally 2011-07-22 19:44:16 +04:00
Alexey Prokhin
f351084089 Fix #408: Exception not caught for -inline. Thanks, lindquist, for your hint. 2011-04-30 15:30:57 +04:00
Tomas Lindquist Olsen
1fac40d2bd Update to work with LLVM 2.7.
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).

Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.

Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
2010-05-19 12:42:32 +02:00
Tomas Lindquist Olsen
84a319ad23 Fixed issue in exception runtime with recent LLVM revisions, with this in place EH seems to work properly on x86-64. These fixes need to be merged into tango trunk still! 2009-10-21 05:46:56 +02:00
Benjamin Kramer
c220dcac05 IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
2009-08-14 00:39:18 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +02:00
Benjamin Kramer
d7049de966 More factory methods moved to LLVMContext 2009-07-15 18:09:41 +02:00
Christian Kamm
42b3da8ac7 Move function codegen data from IrFunction to new FuncGen.
This change reduces memory consumption significantly by releasing the
memory held by the STL containers that are now inside FuncGen.
2009-06-20 19:11:44 +02:00
Christian Kamm
5b799deeb4 Fix #308 by giving finally code emitted by EnclosingTryFinally a different landing pad. 2009-05-23 00:23:39 +02:00
Tomas Lindquist Olsen
f5d635dfc7 Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 . 2009-05-14 13:26:40 +02:00
Tomas Lindquist Olsen
37cf5a5789 Added Doxygen file.
Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
2009-04-15 20:06:25 +02:00
Tomas Lindquist Olsen
ec986231e5 Eliminated the need for resolve, declare, const-init and define lists to drive code generation. 2009-03-27 21:50:32 +01:00
Tomas Lindquist Olsen
c4c1c1d72e Added initial D2 support, D2 frontend and changes to codegen to make things compile. 2008-11-11 01:38:48 +01:00
Christian Kamm
5b17d36ce2 Tried using DtoDeclarationExp for VarDecls in Statements to fix nesting issues
(see bug #104), but a separate helper that doesn't initialize would be nicer.
2008-11-01 16:48:17 +01:00
Christian Kamm
16c32afa18 Fix issue with EH table indices and nested try-catch. 2008-09-21 17:18:35 +02:00
Christian Kamm
8362b86c5a Move AllocaInst creation into DtoAlloca helper. Will enable special zero-init of fp80 reals' padding. 2008-08-05 19:28:19 +02:00
Christian Kamm
c1fbcd9942 [svn r376] Fix bug with finally blocks and labels. The labels would get emitted multiple times and conflict.
It is now possible to add label scopes in IrFunction and all labels names will be prefixed accordingly.

Also disallow goto into finally blocks.

Fixes nocompile/finally_02 and others.
2008-07-14 11:48:55 +02:00
Tomas Lindquist Olsen
f03d8f37c1 [svn r370] Fixed landing pads on 64bit was broken (hardcoded 32bit type, should be size_t) 2008-07-13 21:41:45 +02:00
Christian Kamm
f5dbc0e0d2 [svn r353] Fix typo. (fixes empty catch handlers, like catch_02.d) 2008-07-11 22:33:21 +02:00
Christian Kamm
8b1bcd5724 [svn r341] Fix all regressions between [332] and [340]:
- fixed assert on empty catch body
- fixed(?) typedefed classes in catch specification
- fixed assert with catchall
Added some documentation.
2008-07-05 13:05:29 +02:00
Christian Kamm
ce79feeb9b [svn r340] Rework exception handling to work with nested tryfinally and trycatch. 2008-07-05 10:22:56 +02:00