Commit Graph

358 Commits

Author SHA1 Message Date
kai
37ccbf463c Add standard container methods to Array<>.
With these methods the Array<> class can be used like std::vector<>.
Please be aware that Array::reserve() has a slightly different semantic
than std::vector::reserve().
The intention is to make usage of Array<> more natural.
2014-01-10 12:06:01 +01:00
kai
e1522d7bff Fix NaN constants on ARM.
The dmd source assumes x86 longdoubles which are not available on ARM (and possible other systems).
This leads to an assertion error in PortInitializer. The workaround is to check for the size of
longdouble.
2014-01-07 19:58:51 +01:00
kai
9e33ec5433 Add again little and big endian patterns for NaN. 2014-01-04 17:48:36 +01:00
Kai Nacke
59317c58f9 Merge branch 'master' into merge-2.064 2014-01-03 23:07:50 +01:00
Kai Nacke
019d254ea5 Fix for 2nd part of issue #424.
This is a backport from DMD 2.065.
2014-01-03 22:37:48 +01:00
Kai Nacke
13e00a89ca Some class <-> struct changes.
This is partly a backport from DMD 2.065. It fixes nasty warnings with clang.
2014-01-03 16:14:51 +01:00
Kai Nacke
731f2a8fdf Merge branch 'master' into merge-2.064
Conflicts:
	dmd2/root/rmem.c
2014-01-03 15:56:01 +01:00
Kai Nacke
2eae9b6f79 Use __linux__ to identify Linux-based systems.
This is a backport from DMD 2.065. It is needed to compile LDC2 with -std=c++11.
2014-01-03 15:51:38 +01:00
Kai Nacke
58305e8bfc Remove DigitalMars garbage collector.
This code is not used and gone in later DMD versions.
2014-01-03 15:47:07 +01:00
David Nadlinger
3ec084da59 Return undef instead of null on toConstElem failure.
This fixes a segfault with associative array literals of
arrays of associative array literals, which occured because
of arrayLiteralToConst not handling null values properly.
Ensuring that null pointers are handled correctly in all
toConstElem callers is much more error-prone than just
returning an LLVM undef, an error is emitted anyway.

The root of the problem is actually in the kludgly
implementation of AssocArrayLiteral::toElem, we should
revisit this at some point.
2013-12-27 18:35:50 +01:00
Alexey Prokhin
5a10a23cef Remove redundant FuncDeclaration::nestedVars.
The change not only makes the code cleaner but also fixes compilation of multiple files at once.
Previously, fd->nestedVars may have been filled twice if fd was a template function instantiated in two modules simultaneously.
2013-12-08 14:37:15 +04:00
Kai Nacke
2fa997e6ad Fix wrong #if 2013-12-06 09:20:22 +01:00
Kai Nacke
133ae1b2c8 Fix a failure in runnable/funclit.d 2013-12-03 12:33:47 +01:00
Kai Nacke
5e6f696b43 Fix logic to decide which new/delete operator to use. 2013-12-02 10:05:50 +01:00
Kai Nacke
1a36f9b394 Replace general error with more accurate error message (does not resolve issue) 2013-11-28 08:04:49 +01:00
Kai Nacke
ba8caa7bb1 Merge branch 'master' into merge-2.064 2013-11-14 06:51:40 +01:00
Kai Nacke
29e646ed9a Fix error message in case object.di is not found. 2013-11-14 06:51:00 +01:00
Kai Nacke
015cf202e1 Fix cast problem with implicit constructors. 2013-11-12 08:23:06 +01:00
kai
b7d80963ee Mark more differences between DMD and LDC. 2013-11-06 02:27:08 +01:00
Kai Nacke
254579df2c Correct issues found by AddressSanitizer. 2013-11-05 11:44:21 +01:00
Kai Nacke
2f8f68fabd Update to DMD@a9eedd1.
Also include latest phobos changes.
2013-11-04 00:02:41 +01:00
kai
bf4c6f8ff2 Fix CR/LF horror which prevents compiling with MSVC 2013-11-02 20:23:31 +01:00
kai
1310337d6e Add more IN_LLVM sections and minimize more differences to DMD. 2013-11-02 19:56:47 +01:00
Kai Nacke
054d78934a Update to b52c07.
Also includes latest druntime changes.
2013-11-01 17:55:34 +01:00
Kai Nacke
d48c72d435 Enable delete again.
Some Travis-CI errors may be caused by out-of-memory.
2013-10-31 12:21:33 +01:00
Kai Nacke
72f34e3d8e Update source to eb1b004.
This brings the source beyond beta4.
2013-10-30 21:52:45 +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
David Nadlinger
01b6d55770 Diff reduction: Remove Scope::ignoreTemplates and friends.
It is unused since my change to the way codegen is
driven. If we want to optimize template codegen again,
we should do it properly, contributing the changes back
to DMD.
2013-10-29 19:21:14 +01:00
David Nadlinger
5ac894c32d Diff reduction: Remove unnecessary forward declarations. 2013-10-29 19:21:14 +01:00
David Nadlinger
0954b2763a [Trivial] Fixed class/struct mismatch. 2013-10-13 21:22:10 +02:00
David Nadlinger
1242be25d0 Remove unused, empty Ir type.
The codegen parameter was changed to IRState instead of
removing it to set the stage for an eventual eradication
of the gIR global.
2013-10-13 19:44:29 +02:00
David Nadlinger
c6cf35a012 Remove unused DMD IRState implementations. 2013-10-13 19:20:37 +02:00
David Nadlinger
787c147986 Use Module::members -> Dsymbol::codegen to define symbols.
This commit fundamentally changes the way symbol emission in
LDC works: Previously, whenever a declaration was used in some
way, the compiler would check whether it actually needs to be
defined in the currently processed module, based only on the
symbol itself. This lack of contextual information proved to
be a major problem in correctly handling emission of templates
(see e.g. #454).

Now, the DtoResolve…() family of functions and similar only
ever declare the symbols, and definition is handled by doing
a single pass over Module::members for the root module. This
is the same strategy that DMD uses as well, which should
also reduce the maintainance burden down the road (which is
important as during the last few releases, there was pretty
much always a symbol emission related problem slowing us
down).

Our old approach might have been a bit better tuned w.r.t.
avoiding emission of unneeded template instances, but 2.064
will bring improvements here (DMD: FuncDeclaration::toObjFile).
Barring such issues, the change shoud also marginally improve
compile times because of declarations no longer being emitted
when they are not needed.

In the future, we should also consider refactoring the code
so that it no longer directly accesses Dsymbol::ir but uses
wrapper functions that ensure that the appropriate
DtoResolve…() function has been called.

GitHub: Fixes #454.
2013-10-13 19:18:24 +02:00
David Nadlinger
e1abb01e55 Remove superfluous Dsymbol::codegen overload. 2013-10-13 01:00:25 +02:00
David Nadlinger
b6a73fbd65 More trivial diff reduction now that #484 is in. 2013-10-05 22:04:54 +02:00
David Nadlinger
ee7fe16e40 Low-hanging DMD diff reduction fruit.
The trailing whitespace isn't pretty, but removes the
files completly from the diff.
2013-10-05 21:19:35 +02:00
Alexey Prokhin
8d54cc539f Clean up mtype 2013-10-05 19:04:18 +04:00
Alexey Prokhin
b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
kai
3dd67a7631 Add more #if's around LDC specific code 2013-08-18 20:05:24 +02:00
kai
f4637b1c3d Minimize differences to DMD source. 2013-08-08 06:51:18 +02:00
Alexey Prokhin
54078eca66 Set global.params.isOS variables so we do not have to modify dmd frontend to use targetTriple 2013-07-29 18:49:09 +04:00
Alexey Prokhin
fb31047dcd Prettify our C functions' signatures patch to have a chance to be included into dmd 2013-07-29 16:52:42 +04:00
Alexey Prokhin
d45931972c Move Target implementation out of dmdfe 2013-07-29 11:18:25 +04:00
Alexey Prokhin
153febd093 Remove minor differences with upstream 2013-07-29 11:18:18 +04:00
Alexey Prokhin
21b07c783a Remove Module::moduleInfoType 2013-07-28 21:59:01 +04:00
Alexey Prokhin
69e7907875 Move implementation of Module::buildTargetFiles and Module::buildFilePath to gem/module.cpp 2013-07-28 21:17:25 +04:00
kai
a2f7246c49 Fix for part 1 of issue 424.
Yet another difference between static arrays and vectors. Initializing a static
array with one element is handled especially. This fix adds the same handling for
vector types.
2013-07-04 08:06:09 +02:00
kai
1a8c3588b5 Fix for issue #420.
The frontend only creates a scalar literal instead of an
array literal in order to initialize a vector field. This
commit adds the missing code.
2013-07-01 00:48:44 +02:00
kai
7faa23f99c Merge of v2.063.2 2013-06-29 19:01:42 +02:00
kai
aa143b560c Include Git revision in version info.
CMakeLists.txt contains now the version numbers for DMD and (next) LDC release.
If a .git folder is found then the LDC version is replaced by the first 6 chars
of the Git revision.

Possible improvements:

- If the build is not done at the master branch then it could be useful to check for a tag and use the tag instead of the revision. (for release builds)
- Maybe it is useful to include the branch name.

This fixes issue #366.
2013-06-21 06:47:32 +02:00