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
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