Commit graph

67 commits

Author SHA1 Message Date
Martin Kinkelin
3817ab0595 Upgrade front-end & libs to v2.086.0-beta.1 2019-04-23 22:13:13 +02:00
Martin Kinkelin
39b46d7b69 Replace old-school header guards by #pragma once 2018-10-20 16:19:46 +02:00
Martin Kinkelin
4a23399236 Aim for consistent #includes (order + dir prefix)
I surely missed a few.
2018-10-20 16:19:46 +02:00
Martin Kinkelin
f0aba4559f
Fix cat-assign-element issue if rhs affects the lhs length (#2589)
I.e., this fixes #2588.

To fix the index of the new array element to be assigned to, I went for
decrementing the new length instead of saving the old length directly
before the druntime call (i.e., after evaluating the rhs expression due
to its potential side effects). The IR seems more intuitive to me this
way - load both new length+ptr directly after the druntime call and then
decrement the length by 1.
2018-02-23 18:51:36 +01:00
Martin
f9575686e1 Get rid of obsolete runtime functions
For array comparisons (new) and the _adReverse family.
2018-01-07 05:03:37 +01:00
Johan Engelen
0f2d594ae5 Back off on what we consider as "constant literals": (some) dynamic array literals are not-const because they are expected to be newly allocated. (#1927)
Resolves #1924
2016-12-20 11:26:25 +01:00
LemonBoy
517f9095a4 Check StructLiteralExp elements in isConstLiteral. 2016-10-17 23:37:04 +02:00
David Nadlinger
03429eb60f gen: Fix another array literal crash with vectors 2016-02-06 20:57:07 +01:00
Johan Engelen
29ce4012af dmd2 --> ddmd. Merge (almost all of) our changes to dmd source into the new D source of dmd 2.069.2.
Also adds the CMake infrastructure to compile and link the D source files.

The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals
2016-01-28 19:03:58 +01: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
David Nadlinger
c897015f62 Fix misaligned vector variable initializers
GitHub: Closes #1092.
2015-09-26 19:48:54 +02:00
David Nadlinger
ac792497f2 Properly ignore statically known SliceExp bounds
GitHub: Fixes #1008.
2015-08-29 01:34:25 +02:00
Martin
9d5560601a WIP: fix array construction/assignment wrt. RAII 2015-07-22 01:41:17 +02:00
kai
eadefdc676 The runtime functions for multi-dim arrays have changed.
_d_newarraymT and _d_newarraymiT are now named _d_newarraymTX and
_d_newarraymiTX. There is also a change in the signature: instead
of a variable length argumentlist the functions now require an array
of dimensions.

This should fix test runnable/test28.d
2015-04-12 19:59:18 +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
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
David Nadlinger
60cdf58168 Combine ArrayLiteralExp::toConstElem and initializeArrayLiteral implementations. 2013-10-09 04:07:46 +02:00
David Nadlinger
44f60199ad Factored actual literal building code out of ArrayLiteralExp::toElem. 2013-10-09 01:51:45 +02:00
David Nadlinger
c7c1c25f15 DValue: struct->class.
This is in line with an incoming upstream change making all
polymorphic structs classes, and also matches common coding
conventions.
2013-06-07 03:20:39 +02: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
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
Alexey Prokhin
7431d58702 Rewritten initialization of global variables. 2011-10-25 15:43:49 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
f3c901af9d Use _d_arraycatT to append an element to an array instead of reallocating the array 2011-09-10 13:23:47 +04:00
Alexey Prokhin
1c59eed83a Check for lower slice bound when bounds checking is enabled 2011-01-03 16:50:08 +03:00
Alexey Prokhin
d8115713d2 Fixed initialization of multidimensional static arrays. 2010-12-30 14:04:24 +03:00
Alexey Prokhin
023b55a772 Run postblit constructors for elements of an array. 2010-12-30 14:04:24 +03:00
Alexey Prokhin
e4c3179d43 Different fixes: phobos compiles now 2010-10-28 14:53:01 +04:00
Alexey Prokhin
b1e5993873 Started work on phobos 2010-10-27 18:13:46 +04:00
Alexey Prokhin
4d7a6eda23 Different fixes for d2 2010-10-07 22:35:32 +04:00
Kelly Wilson
b38845e88e Apply patch from klickverbot. This is his 'proper fix' patch for bug #395. 2010-03-08 23:37:40 -07:00
Christian Kamm
9cd32549c4 Improve array append performance.
Actually use the appropriate runtime function, instead of just
growing the array by one!
2010-02-14 10:11:05 +01:00
Tomas Lindquist Olsen
37cf5a5789 Added Doxygen file.
Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
2009-04-15 20:06:25 +02: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
30c9af1945 Add _d_newarrayvT and _d_newarraymvT to create arrays without initialization.
Adjust DtoNewDynArray to use DtoArrayInit for initialization of new arrays.
Make Type::tvoid->defaultInit() not error.
2008-09-14 10:13:50 +02:00
Christian Kamm
8f14ece3af Move DtoArrayBoundsCheck from llvmhelpers to arrays. 2008-07-31 19:14:49 +02:00
Christian Kamm
caa61a5523 Error if static array is cast to an array such that oldarraysize % newelemsize != 0. 2008-07-29 12:32:01 +02:00
Christian Kamm
907a03a3be Give error messages for invalid casts.
This required passing Loc information to certain functions.
Fixes nocompile/b/bug_cgcs_354_A/B.
2008-07-26 17:19:16 +02:00
Tomas Lindquist Olsen
ac3744a59d [svn r329] Cleaned up a bunch of array code for handling special slice cases no
longer relevant.
2008-06-28 05:57:16 +02:00
Tomas Lindquist Olsen
599f879149 [svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
There was problems with most non basic types...
Added an option to premake so we can do: premake --target gnu --no-boehm
to disable the Boehm GC.
2008-06-23 14:48:42 +02:00
Tomas Lindquist Olsen
67dd564222 [svn r307] Fixed: multidimensional new expressions now work. Eg.:
auto ma = new int[][] (3,9);
2008-06-21 04:47:14 +02:00
Tomas Lindquist Olsen
8b83eda2a2 [svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB.
Did a lot of smaller cleans up here and there.
Replaced more llvm::Foo with LLFoo for common stuff.
Split up tollvm.cpp.
2008-06-09 09:37:08 +02:00
Tomas Lindquist Olsen
28382e3567 [svn r250] Fixed the warning about dropping arguments to _Dmain when optimizing.
Did a few cleanups in inline asm code.
2008-06-08 08:03:19 +02:00
Tomas Lindquist Olsen
b4bb3aaec4 [svn r229] Updated the object.d implementation to the latest Tango.
Fixed a bunch of the built-in typeinfos for arrays, they did not inherit TypeInfo_Array.
Applied patch to tango/text/convert/Layout.d by fvbommel, closes #47 .
Cleaned up some type code.
Replaced uses of llvm::Type with LLType (a typedef), same for Value and Constant.
Fixed a few cases where typeinfo for user structs could be emitted multiple times, seems to still be some cases of this :/
2008-05-30 19:32:04 +02:00
Tomas Lindquist Olsen
c380f43929 [svn r219] Fixed: the tango/lib/gc/basic garbage collector now compiles and links into an executable (change in tango/lib/llvmdc-posix.mak), closes #5 .
Changed: removed the crappy realloc based dynamic memory runtime and started moving over to DMD style runtime support, part of moving to real GC.
Fixed: dynamic arrays now use GC runtime for allocating memory.
Fixed: new expression now use GC for allocating memory.
Changed: revamped the dynamic array support routines related to dynamic memory.
Fixed: assertions no longer create exsessive allocas.
Changed: misc. minor cleanups.
2008-05-13 14:42:09 +02:00
Tomas Lindquist Olsen
b15b3484c8 [svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.

Lots of bugfixes...

This build is not suitable for most things.
2008-01-11 17:57:40 +01:00
Tomas Lindquist Olsen
a807cbfc91 [svn r112] Fixed 'case 1,2,3:' style case statements.
Fixed a bunch of bugs with return/break/continue in loops.
Fixed support for the DMDFE hidden implicit return value variable. This can be needed for some foreach statements where the loop body is converted to a nested delegate, but also possibly returns from the function.
Added std.math to phobos.
Added AA runtime support code, done ground work for implementing AAs.
Several other bugfixes.
2007-11-20 05:29:20 +01:00
Tomas Lindquist Olsen
c99938debf [svn r106] Turns out the last commit wasn't enough, now the D->LLVM process is even more split up.
Basically it tries to do the following in order: Resolve types, Declare symbols, Create constant initializers, Apply initializers, Generate functions bodies.
ClassInfo is now has the most useful(biased?) members working.
Probably other stuf...
2007-11-18 06:52:57 +01:00