Commit graph

130 commits

Author SHA1 Message Date
Alexey Prokhin
28aa0e2bf3 Add missing postblit call 2011-02-25 22:29:28 +03:00
Alexey Prokhin
c5e9784863 Updated to dmdfe 2.051 2011-01-05 18:21:40 +03:00
Alexey Prokhin
89375729cf Work on switch statements. 2011-01-03 16:50:08 +03:00
Alexey Prokhin
a86f414bc1 Fixed calling of _d_array_bounds and _d_switch_error. 2011-01-02 17:43:02 +03:00
Alexey Prokhin
57866a8359 Fixed a crash in WithStatement::toIR. 2010-12-31 13:45:11 +03:00
Alexey Prokhin
20b2b4b7f5 Added missing calls of postBlit 2010-11-04 12:50:19 +03:00
Alexey Prokhin
b1e5993873 Started work on phobos 2010-10-27 18:13:46 +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
Kelly Wilson
dd6a54d442 Strange workaround for returning from within 'void main()'. The new dmdfe sets the ReturnStatement->exp to null. Fixed bug #391. 2010-03-10 19:35:14 -07:00
Christian Kamm
ae32163f34 Fix #398.
Tested by Deewiant.
2010-03-08 17:44:38 +01: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
977fa551ee Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
2009-08-06 01:47:39 +02:00
Benjamin Kramer
4c5457ba61 getNullValue is in Constant again
Requires LLVM >= r77721
2009-07-31 23:01:29 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +02:00
Christian Kamm
987618fcd1 Always emit a stop point for return statements - even for void returns. 2009-07-26 18:32:25 +02:00
Benjamin Kramer
d7049de966 More factory methods moved to LLVMContext 2009-07-15 18:09:41 +02:00
Benjamin Kramer
0ee2f34611 Don't use llvm::getGlobalContext() anymore 2009-07-13 20:16:15 +02:00
Benjamin Kramer
331319dab1 Build fix for the latest LLVMContext changes (LLVM r75445)
This shouldn't break the build with older LLVM revs. We include
LLVMContext.h in gen/llvm.h now to make the transition a little bit
easier.
2009-07-13 12:17:58 +02:00
Christian Kamm
756a2cb2a1 Adjust LDC to work with the LLVMContext LLVM changes.
This means we now require a fairly new LLVM revision. I use 75234.
2009-07-10 21:30:02 +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
52329f071e Fix regression dstress.nocompile.finally_07. The EnclosingTryFinally handler
should not be set when emitting the landing pad's finally code.
2009-05-23 09:02:36 +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
95b94935ee Moved special casing of 'assert(this, "null this");' generated statements from !ThisExp into !AssertExp.
Fixed filenames for array bounds errors and probably others, fixes #271 .
2009-04-27 13:30:48 +02:00
Frits van Bommel
3f49ddb6d5 Fix nested references to 'ref' foreach variables.
These "walk around" the array being iterated over, so they're a bit trickier
than other variables to get right.
2009-04-01 00:01:44 +02:00
Christian Kamm
0ef57dcfbe Reenable error for gotos into or out of finally blocks. 2009-03-28 19:16:53 +01:00
Tomas Lindquist Olsen
367b8da8f4 Moved IRTargetScopeS from IRState into IrFunction, fixes #240 . 2009-03-26 18:46:21 +01:00
Christian Kamm
671c7791e3 Reorganize EnclosingHandlers to require less changes to the frontend and allow us to
implement the synchronized storage class for functions.
2009-03-24 21:18:18 +01:00
Tomas Lindquist Olsen
8b751cce0e - Updated to DMD frontend 1.041.
- Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.
2009-03-12 20:37:27 +01:00
Christian Kamm
ed9591d81f Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
same LDC call.
2009-03-07 14:25:30 +01:00
Frits van Bommel
27d3ab4546 Some calling convention work for x86-64:
- Implement x86-64 extern(C), hopefully correctly.
 - Tried to be a bit smarter about extern(D) while I was there.

Interestingly, this code seems to be generating more efficient code than
gcc and llvm-gcc in some edge cases, like returning a `{ [7 x i8] }` loaded from
a stack slot from an extern(C) function. (gcc generates 7 1-byte loads, while
this code generates a 4-byte, a 2-byte and a 1-byte load)

I also added some changes to make sure structs being returned from functions or
passed in as parameters are stored in memory where the rest of the backend seems
to expect them to be. These should be removed when support for first-class
aggregates improves.
2009-03-06 16:00:47 +01:00
Tomas Lindquist Olsen
65ba1d4d88 Updated ABI handling to be more flexible with regard to reusing lvalues and allocating fewer temporaries. 2009-03-04 17:24:25 +01:00
Tomas Lindquist Olsen
5dbe3ee8e2 Abstracted more (most) ABI details out of the normal codegen. 2009-03-03 02:51:21 +01:00
Frits van Bommel
dd41366a99 Use llvm::CallSite instead of custom CallOrInvoke class. 2009-02-28 22:16:52 +01:00
Frits van Bommel
e37c82d1ec Use LLVM OStream wrapper instead of <iostream> in the logger.
llvm::OStream provides all std::ostream functionality (by holding a
std::ostream* internally), but
 * doesn't include <iostream>, avoiding per-file overhead.
 * allows the stream pointer to be null, and the (inlined) operators do nothing
   when that's the case. (This also allows removal of the ofstream("/dev/null")
   hack Logger used when disabled, which presumably wasn't very portable)
2009-02-26 14:51:02 +01:00
Tomas Lindquist Olsen
57a69e8177 - Fixed LLVM style CL args for D2.
- Moved main() into its own file gen/main.cpp
- Fixed basic cross compilation
- removed the option for setting OS
- added support for llc's mattr, mcpu and mtriple switches
- added basic ABI abstraction for return value rewrites, it's not perfect and will probably be completely rewritten once I get to handling parameter rewrites as well.
- x86-64 extern(C) abi for cfloat returns now match (llvm-)gcc.
2009-02-26 14:11:49 +01:00
Frits van Bommel
8ce2c9773e Clean up the code generated when jumping out of inline asm and make label names more expressive. 2009-02-18 22:50:22 +01:00
Christian Kamm
461544fce8 Fix for fix from [974]. 2009-02-17 19:08:38 +01:00
Christian Kamm
f62df176d6 Allow 'return exp;' for void main().
It's unfortunate that for main the llvm type and D type don't match up...
2009-02-17 18:53:15 +01:00
Tomas Lindquist Olsen
fc480b7fd8 SWITCHED TO LLVM 2.5 !
Applied patch from ticket #129 to compile against latest LLVM. Thanks Frits van Bommel.

Fixed implicit return by asm block at the end of a function on x86-32. Other architectures will produce an error at the moment. Adding support for new targets is fairly simple.

Fixed return calling convention for complex numbers, ST and ST(1) were switched around.

Added some testcases.

I've run a dstress test and there are no regressions. However, the runtime does not seem to compile with symbolic debug information. -O3 -release -inline works well and is what I used for the dstress run. Tango does not compile, a small workaround is needed in tango.io.digest.Digest.Digest.hexDigest. See ticket #206 .
2009-02-08 05:26:54 +01:00
Tomas Lindquist Olsen
dc5944df99 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Fixed align N; in asm blocks.

Fixed inreg parameter passing on x86 for ref/out params.

Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P

Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
2009-02-03 08:54:57 +01:00
Tomas Lindquist Olsen
16409a3367 Merged DMD 1.038 2009-01-06 16:33:51 +01:00
Christian Kamm
b83afa9eca Fix with(symbol) statement. 2008-12-07 16:02:43 +01:00
Tomas Lindquist Olsen
f46f865375 Removed KDevelop3 project files, CMake can generate them just fine!
Fixed function literals in static initializers.
Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE.
Changed errors to go to stderr instead of stdout.
Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
2008-11-29 21:25:43 +01:00
Christian Kamm
6efc9a3324 Get rid of DtoBoolean - use DtoCast(... Type::tbool) instead.
Fixed some casts to bool that were using truncation.
2008-11-22 18:35:52 +01:00
Tomas Lindquist Olsen
192edc9995 Fixed problem with continue/break in unrolled loop statements. 2008-11-19 14:40:24 +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
Tomas Lindquist Olsen
173639bdec Added DtoRawVarDeclaration routine to handle special variables in some statements. 2008-11-01 18:25:10 +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
Tomas Lindquist Olsen
f89592b354 Nested access to with statement should work now. fixes #105 2008-10-27 01:40:47 +01:00