Johan Engelen
70a6e73188
Cleanup runtime fwd decls and use ABI functiontype rewriting
2015-11-22 01:27:26 +01:00
David Nadlinger
c9c854f664
eh: Do not use GC for _d_exception records
2015-11-03 00:53:34 +02:00
David Nadlinger
9df487edff
gen/ir: clang-tidy the world
2015-11-02 11:30:40 +02:00
David Nadlinger
44b0f7b615
driver/gen/ir: clang-format the world
...
This uses the LLVM style, which makes sense for sharing code
with other LLVM projects. The DMD code we use will soon all
be in D anyway.
2015-11-02 00:28:01 +02:00
Martin
2d959ea540
Make use of C++11 range-based for
...
Should be available now that support for LLVM < 3.5 has been dropped.
2015-11-01 14:49:04 +01:00
Martin
60d676e2a1
Drop support for LLVM < 3.5
...
This allows to clean up the code a little.
2015-10-30 22:24:05 +01:00
David Nadlinger
431c14615e
Remove llvm::Value address in log
2015-09-26 15:24:36 +02:00
Martin
80c677be46
Slightly refactor ABIRewrite interface for clarification
...
* put(): pass DValue alone, without explicit D type
* get(): pass LLValue instead of a faked DValue
2015-09-26 00:30:24 +02:00
Martin
9e194bfe2c
Refactor store-to-new-alloca code occurrences.
2015-09-25 17:12:42 +02:00
Martin
a721b4f823
Revise DtoRawAlloca() alignments
2015-09-25 15:16:28 +02:00
David Nadlinger
78ddb15690
Fix throwing inside catch (should not target later catches of same try)
2015-09-14 09:01:17 +02:00
David Nadlinger
4bcae9731a
The big catch/finally rework, part 2
...
Now with *almost* working EH codegen. Does not compile Phobos yet
because we run into the "instruction does not dominate all uses"
issue when an r-value result of toElemDtor is used and we need to
run cleanups in between. Should easily be fixed by promoting those
values to allocas.
Most of the changes outside of ir/irfunction.{h, cpp} are just
because CreateCallOrInvoke moved locations. I took the
opportunity to also make use of the different arg count
overloads where possible.
2015-08-19 19:56:39 +02:00
David Nadlinger
4236ae9ce5
The big catch/finally rework, part 1
...
Never generates any landing pads or invoke instructions right now
for simplicity. The code for emitting them will be added back in
the next step.
The "after..." blocks without any precedessors remain for now, as
we need a clean way to suppress any codegen for that block (but
not new blocks, which might resolve labels) before tackling that
one.
Builds druntime/Phobos on OS X x86_64 (albeit without EH, of course).
2015-08-19 19:56:39 +02:00
David Nadlinger
bfc20df4c8
Remove IRScope::end
...
Specifying the basic block before which to insert the new one
is not mandatory when calling llvm::BasicBlock::Create. This
was the only use of the tracked "end" block. The concept was
phony anyway because there is no single "end" to a scope with
unwinding and so on.
For prettying up the IR, it is possible to change the order
of basic blocks using move{Before, After}().
2015-08-19 19:56:39 +02:00
David Nadlinger
16ce842122
OnScopeStatements are not supposed to make it to the glue layer
2015-08-16 22:59:41 +02:00
David Nadlinger
06d07dfefe
statements: Remove some commented code
2015-08-16 20:42:40 +02:00
David Nadlinger
d2135d4ade
Fix more duplicate static array postblit calls
2015-07-28 02:12:45 +02:00
David Nadlinger
0922254dd1
Directly emit IR into same llvm::Module instead of using Linker
...
GitHub: Fixes #970 .
2015-06-14 21:36:35 +02:00
Kai Nacke
8618c73177
Merge branch 'master' into merge-2.067
2015-06-05 02:56:49 +02:00
Kai Nacke
227f16bcce
DebugInfo: Better location for automatically appended return.
...
If function main() has return type void then a 'return 0;' is
automatically appended to the statements. Set the end of the
function as the location of this statement. This helps with the
debug information in LDC.
Don't do it at a more global level because disturbs the coverage
code.
2015-06-05 02:52:13 +02:00
Kai Nacke
cddb59f7b7
Merge branch 'master' into merge-2.067
2015-06-04 22:02:52 +02:00
Kai Nacke
b301407f9c
DebugInfo: Use the IRBuilder to create a ret instruction.
...
This ensures that a previous set debug location will be set on the
return instruction.
2015-06-04 21:22:38 +02:00
Kai Nacke
80acadc841
Merge branch 'master' into merge-2.067
2015-06-04 20:48:38 +02:00
Kai Nacke
104e7c991f
DebugInfo: Remove most calls to EmitFuncEnd()
...
Debug information is based on static lexical blocks. Most calls to
EmitFuncEnd() are done if control flow reaches the end of the
function which is quite different.
2015-06-04 20:19:54 +02:00
Kai Nacke
45ec6a0512
Merge branch 'master' into merge-2.067
2015-06-04 19:07:28 +02:00
Kai Nacke
0f86de548c
DebugInfo: EmitStopPoint() now has a Loc parameter.
2015-06-04 19:04:23 +02:00
Kai Nacke
ac7f8c70f8
Merge branch 'master' into merge-2.067
...
Conflicts:
dmd2/mars.h
driver/ldmd.cpp
gen/module.cpp
2015-04-08 22:23:50 +02:00
Johan Engelen
505f18ca2a
Add coverage analysis ("-cov=...") to ldc2
2015-04-07 22:11:02 +02:00
kai
0551f613e4
Remove last traces of AsmBlockStatement
2015-03-01 17:33:08 +01:00
kai
f61327c149
Replace AsmBlockStatement with CompoundAsmStatement.
2015-03-01 16:40:44 +01:00
Alexey Prokhin
ac2524d129
Remove old unused declarations
2014-10-05 16:55:23 +04:00
Alexey Prokhin
4e2d45a409
Move irFty fields to backend ir classes
2014-10-05 16:55:22 +04:00
Alexey Prokhin
a0b9f95869
There is no real need in FuncDeclaration::labmap
2014-10-05 16:08:35 +04:00
Andreas Hollandt
6db62ee8a9
remove all the "tmp" IR names
2014-10-02 14:36:51 +02:00
Kai Nacke
382ad184d8
Merge branch 'master' into merge-2.066
...
Conflicts:
dmd2/builtin.c
gen/classes.cpp
gen/functions.cpp
gen/llvmhelpers.cpp
gen/statements.cpp
gen/toir.cpp
runtime/druntime
runtime/phobos
2014-09-13 23:11:54 +02:00
Alexey Prokhin
18f33b1815
Make IrDsymbol to be a typesafe union to reduce memory usage
2014-09-12 14:43:49 +04:00
Alexey Prokhin
d9189acbc4
Move toElem/toConstElem to visitors
2014-08-27 16:22:02 +04:00
Alexey Prokhin
08c5d6f82e
Shut up compiler warnings about hidden visit() methods
2014-08-24 21:01:45 +04:00
Alexey Prokhin
ce1a41305b
Set enclosingScopeExit in glue layer after semantic is done
...
Otherwise, we may end up with a wrong enclosing statement. It could
happen if a try-finally is rewritten as a try-catch (see NrvoWalker).
In this case, enclosingScopeExit will still point to the old unused
try-finally.
2014-08-24 13:59:18 +04:00
Alexey Prokhin
6d5944f80b
Refactoring: Synchronized is rewritten to try-finally statement. Remove it
2014-08-24 13:59:18 +04:00
Alexey Prokhin
030a4b1a66
Fix DMD Issue 12045 - Destructor call omitted for NRVO'd struct in exceptional case
...
Destructor calls are correctly created by frontend and we don't need additional checks.
2014-08-22 16:01:35 +04:00
Alexey Prokhin
dd456760aa
Fix wrong codegen for labeled continue statement
...
X: foreach (i; functionReturningRange()) {
continue X; // range's destructor was incorrectly called here
}
2014-08-22 16:01:35 +04:00
Alexey Prokhin
76dec46df5
WIP: merge dmdfe 2.066
2014-08-22 16:01:28 +04:00
Alexey Prokhin
e0b9048998
Rename 'enclosingFinally' to the original 'tf' to minimize differences with mainstream
2014-07-11 18:06:58 +02:00
kai
45fca1f3b5
Add line number to error message of -nogc switch.
...
This was suggested by bearophile in the news group.
It also changes all Loc objects to be passed by reference.
2014-07-04 07:15:05 +02:00
kai
2b6dbb03f4
Add IF_LOG to more logging statements.
...
Evaluating arguments which call toChars() or toPrettyChars() are much more expensive then checking Logger::enabled().
2014-06-26 06:54:38 +02:00
kai
f8a53ab3dc
Merge branch 'merge-2.064' into merge-2.065
...
Conflicts:
runtime/druntime
2014-03-12 18:27:43 +01:00
kai
2f2fa92df3
Fix includes for LLVM 3.5
2014-03-07 06:40:39 +01:00
Kai Nacke
fe39da53e3
Merge of 2.065.0-b3.
...
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
Kai Nacke
3ef3e358f5
Wrong break target choosen for labeled break.
...
This fixes a test failure in runnable/foreach5.d.
2013-11-20 17:00:37 +01:00