Commit graph

466 commits

Author SHA1 Message Date
Tomas Lindquist Olsen
36f6ebc77f - Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
- Eliminated the DLRValue DValue.

- Implemented proactive handling of l-value CastExpS.

- Minor tweak in runtime memory.d .
2009-03-28 05:00:43 +01:00
Tomas Lindquist Olsen
be3bfbff5d Fixed problems introduced by previous commits that prevented Tango from compiling. 2009-03-27 23:17:04 +01: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
daef67acc3 Changed use of toObjFile to a new codegen method.
More versioning of DMD specific codegen code.
2009-03-27 17:54:27 +01:00
Tomas Lindquist Olsen
c42c90ea80 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
* Added #if IN_DMD versioning around DMD backend specific code in the D1 frontend, D2 is currently broken.
* All part of a greater cleanup scheme.
2009-03-26 20:45:53 +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
Christian Kamm
eb1deec50d Fix #239. 2009-03-24 14:33:57 +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
Tomas Lindquist Olsen
ae214b18e7 Added ~{memory} clobber when a jump_target is generated in inline asm (branch out of inline asm) 2009-03-03 19:18:47 +01:00
Tomas Lindquist Olsen
8ce5a07fc0 Fixed potential assertion failure in taking address of function as a constant expression. 2009-03-03 17:27:14 +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
Frits van Bommel
f61733cb57 Call llvm_shutdown when shutting down the backend. 2009-02-25 19:30:06 +01:00
Christian Kamm
d6a264e74b Fix #216 by implementing TypeExp::toElem. It just provides the appropriate
error message.
2009-02-17 18:25:34 +01:00
Tomas Lindquist Olsen
7d2a0a84a7 Removed some dead code.
Fixed assertion filenames for imported template instances. Fixes #152 .
2009-02-04 02:10:23 +01:00
Tomas Lindquist Olsen
280be5ef8e Fixed dstress/run/a/array_initialization_17_A.d regression. default initialized static array elements in a constant static array initializer was getting incorrect values.
Fixed minor version problem in mini/naked_asm4.d test case.
2009-02-03 23:48:47 +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
75591b3c16 Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates. 2009-02-02 01:44:51 +01:00
Tomas Lindquist Olsen
98974b02c0 Fix bug #199 2009-02-02 00:26:32 +01:00
Christian Kamm
01f19c466c Fix #198 and #199 by making CTFE on static struct initializers work.
Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
2009-02-01 20:20:56 +01:00
Christian Kamm
9081e55746 Fix #163. 2009-01-17 14:53:32 +01:00
Christian Kamm
12a21b1397 Fix #153. Factor out common code in StructLiteralExp::to(Const)Elem. 2008-12-30 11:42:01 +01:00
Christian Kamm
61a5a08135 Adjust error message for missing toConstExp to include 'is not a const exp'. 2008-12-20 09:13:44 +01:00
Christian Kamm
8f62c080e2 Add more toConstElem stubs to get better error messages. 2008-12-18 07:59:03 +01:00
Christian Kamm
7069073f75 Applied modification of wilsonk's patch for AndAnd and OrOrExp for void rhs funcs. 2008-12-17 21:24:17 +01:00
Christian Kamm
0e1b27db3c Remove some dead code. 2008-12-17 21:03:06 +01:00
Christian Kamm
cb0201960c Apply wilsonk's patch to AddrExp::toConstElem for struct literals. 2008-12-17 20:40:27 +01:00
Tomas Lindquist Olsen
3c400ff21c Removed error on naked, not fully complete, but I'll be doing more work on it during this Christmas, and some things do work.
Fixed taking delegate of final class method. see mini/delegate3.d.
2008-12-09 14:07:30 +01:00
Tomas Lindquist Olsen
417aa57501 This ''should'' fix #139 , I failed to produce a testcase, but I would imagine this to be correct, and it removes '''that''' error when building Hybrid. 2008-12-09 03:01:19 +01:00
Tomas Lindquist Olsen
b6781a8eae Added proper "need 'this' to access member foo" errors instead of "variable foo not resolved" for some cases, added FIXME for the old error!
Added a bit more information to the runtime's cyclic dependency detection exception.
2008-12-09 01:56:39 +01:00
Tomas Lindquist Olsen
2532856f1c Commented some logging that could be '''very''' long, cuts -vv output size of a gtkd gl sample down 1.2GB by 3/4.
Fixed wrong pointer type for multidimension "deep" slicing.
2008-12-04 16:11:09 +01:00
Tomas Lindquist Olsen
3111ff1fc4 Fixed non-static struct initializers. 2008-12-03 01:40:28 +01:00
Tomas Lindquist Olsen
91a2c257b0 Implemented allocating storage for a slice if its address is taken, fixes #115 2008-12-02 01:20:22 +01:00
Tomas Lindquist Olsen
c62b31a357 Fixed taking address of global static array element as constant expression. 2008-12-02 01:07:22 +01:00
Tomas Lindquist Olsen
577237e073 Changed some hardcoded offset/alignment for classes in DMD, broke offsets for 64bits.
Changed ClassInfo generation to no longer access the default initializer of ClassInfo, fixes problems with index mismatch.
2008-11-30 20:22:09 +01:00
Tomas Lindquist Olsen
4da2cf066e Fixed some problems with the addZeros forward declarations having type mismatches. 2008-11-29 20:57:52 +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
Christian Kamm
1228595e7e Cast result of ...AssignExp to type the frontend expects if necessary. Fixes #116. 2008-11-14 16:26:12 +01:00
Tomas Lindquist Olsen
582deb9827 D2 changes!
Removed druntime from the repository again.. Sorry :/
Updated the druntime port a bit, now requires druntime from trunk.
Added info in runtime/README on how to get druntime from trunk.
Added patch to add LDC support to druntime.
Removed some debug logging from D2 builds.
Fixed broken typeinfo for const/invariant in D2.
2008-11-12 07:22:05 +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
f71b7ac284 Added inreg attribute where appropriate on x86 to follow ABI docs.
Removed now unnecessary temporary variable in StringExp.
2008-10-23 00:34:46 +02:00
Tomas Lindquist Olsen
a52f0330d0 Implemented first class delegates. closes #101 2008-10-22 21:50:08 +02:00
Tomas Lindquist Olsen
f7ea1da010 Removed TypeOpaque from DMD.
Changed runtime functions taking opaque[] to void[].
Implemented proper type painting, to avoid "resizing" array casts in runtime calls that previously took opaque[].
Implemented dynamic arrays as first class types, this implements proper ABI for these types on x86.
Added dwarf region end after call to assert function, fixes some problems with llvm not allowing this to be missing.
Reverted change to WithStatement from rev [704] it breaks MiniD, mini/with2.d needs to be fixed some other way...
Fixed tango bug 1339 in runtime, problem with _adReverseChar on invalid UTF-8.
Disabled .bc generation in the compiler runtime part, genobj.d triggers some llvm bug when using debug info. the .o seems to work fine.
2008-10-22 14:55:33 +02:00
Tomas Lindquist Olsen
379bd9c330 Fixed weird struct problem from downs, see mini/compile_structs1.d
Rewrote DtoIndexStruct/Class , the old implementation were way too complex for what we really need now - since the DotVar changes.
2008-10-14 15:35:49 +02:00
Tomas Lindquist Olsen
180487b614 Fixed issue with accessing a WithStatement context from inside a nested function. see mini/with2.d
Renamed some LLVM uses of ::create statics to ::Create , lower case ones will be deprecated soon.
2008-10-14 13:21:14 +02:00
Tomas Lindquist Olsen
202c4f7bc2 Changed premake.lua to work with mingw.
Implemented array operations, not perfect but ok for tonight. closes #89
2008-10-13 23:19:32 +02:00
Tomas Lindquist Olsen
f15b115ee9 Started changing target triple stuff, part of fixing #97 2008-10-13 17:28:39 +02:00
Christian Kamm
40f724234d Remove too strict type check for DotTypeExp. Fixes run/t/typedef_19_B. 2008-10-11 22:44:17 +02:00
Christian Kamm
9499761131 When newing a struct, make sure the initializer is available. 2008-10-08 20:41:43 +02:00
Christian Kamm
b90799a376 Add DotTypeExp 2008-10-07 20:19:19 +02:00