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
David Nadlinger
1d142129e3
Handle "initializer outlining" for loop rewrites in 2.064.
2013-10-29 19:21:15 +01:00
David Nadlinger
cb341586e3
First merge of 2.064 beta.
...
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.
Doesn't build Phobos yet.
2013-10-29 19:21:15 +01:00
Alexey Prokhin
b819975c84
Eliminate the need for TypeFunction::funcdecl
2013-10-05 19:03:03 +04: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
David Nadlinger
292caa1438
Merge the 2.063 frontend.
2013-06-12 20:16:37 +02:00
kai
522c06ff7f
Do not memcpy with same source and destination.
...
This can happen for sret_args. Drop the assignment in this case.
2013-05-10 12:59:14 +02:00
kai
7d65a311b1
More changes to std::vector usage.
...
Replace with std::vector with static array, llvm::SmallVector or
add code to reserve space.
2013-03-17 23:58:30 +01: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
30caa4bfe6
Merge branch 'master' into merge-2.061-2
2013-01-12 01:27:02 +01:00
kai
a11459bc31
"The Great Renaming" continues.
...
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
1a3fc9f97f
Fix break out of non-nothrow range foreach.
...
Fixes DMD testcase 'test9068'.
2013-01-04 16:48:10 +01:00
David Nadlinger
59a4a02e49
Cleanup: Avoid signed/unsigned comparisons.
...
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
2988bc46e0
Removed long obsolete (and broken) LLVM IR annotation code.
...
If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
2012-12-19 01:50:48 +01:00
David Nadlinger
9458911839
Added LLVM-style license headers to all our files.
2012-12-16 17:19:14 +01:00
David Nadlinger
c6abdcf4a4
Don't set TypePointer::isunsigned to true in the frontend.
...
The previous solution was problematic because the change was language-
visble via the isUnsigned trait. Now, pointers are simply explicitly
checked for in the relevant places. (Note that there might be cases in
the diff where a direct isunsigned() call would have been appropriate –
I only checked for instances where the type clearly cannot be a pointer,
but chose to go the safe route in replicating existing behavior
otherwise).
Fixes DMD testcase 'traits'.
2012-09-28 00:28:49 +02:00
kai
2dbee75523
Prefer C++-style casts.
...
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-02 19:55:29 +02:00
Alexey Prokhin
2f60c4dcda
Codegen the try block before the catches and finally
2012-04-21 22:37:32 +04:00
Alexey Prokhin
52c5c03495
Fixed segfault when compiling a non-constant case expression
2012-02-15 13:23:23 +04:00
Alexey Prokhin
b3ed8724b7
Fixed codegen of SwitchErrorStatement
2012-02-15 13:23:23 +04:00
kai
f9201e8352
Merge 1.072
2012-02-02 03:13:27 +01:00
Alexey Prokhin
edc4a5f003
DMD Issue 5416 - null should have a type of its own
2011-12-16 20:15:10 +04:00
David Nadlinger
3916835380
Merge remote-tracking branch 'AlexeyProkhin/master' into merge-3.0
...
Conflicts:
CMakeLists.txt
druntime
runtime/CMakeLists.txt
2011-12-04 18:38:09 +01:00
David Nadlinger
fe19ee84f5
Merge branch 'llvm3.0' into merge-3.0
...
Conflicts:
gen/configfile.cpp
2011-12-04 18:16:36 +01:00
David Nadlinger
d0ea856024
Emit all D inline asm labels as local labels.
...
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:
---
import core.exception;
void main() {
asm {
jmp Lfoo;
Lfoo:
;
}
throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
assert(0);
}
---
2011-12-04 18:13:33 +01: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
kai
a5b3dd29b5
Fixes 2 kinds of warnings.
...
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.
Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00
Alexey Prokhin
629f13929e
WIP: port to llvm 3.0
2011-10-25 15:43:39 +04:00
Alexey Prokhin
9a9999854f
Named Return Value Optimization
2011-09-13 21:01:38 +04:00
Alexey Prokhin
0e754b5acd
Merge dmd v2.055
2011-09-13 21:01:32 +04:00
Alexey Prokhin
0caba6672d
Call postblit on a struct when appending it to an array. Use _d_arraycatnT to concatenate multiple arrays.
...
Before, _d_arraycatT was used to concatenate multiple arrays. That caused an issue when postblit
was called on a struct multiple times. The next code asserted due to the issue:
void main()
{
static struct S
{
int x;
int pad;
this(this)
{
++x;
}
}
auto sarr = new S[1];
auto sarr2 = sarr ~ sarr ~ sarr;
assert(sarr2[0].x == 1);
assert(sarr2[1].x == 1);
assert(sarr2[2].x == 1);
assert(sarr[0].x == 0);
}
2011-09-10 13:22:05 +04:00