Commit graph

38 commits

Author SHA1 Message Date
Martin
0b28925e9a Win32: Remove extra leading underscore from D symbol mangling
This is compatible with DMD.
2017-10-07 14:06:17 +02:00
Martin
3e554f2bfd Revert "OSX: Make sure T.mangleof matches the final mangle for C++ symbols"
This reverts commit c49464a57e.
2017-09-30 01:04:28 +02:00
Martin
c49464a57e OSX: Make sure T.mangleof matches the final mangle for C++ symbols
By using upstream's Target.prefixName(), which prepends an additional
underscore on OSX/Darwin for C++ symbols.
We then need to prevent LLVM from implicitly prepending a third one.
2017-09-28 20:17:02 +02:00
Martin
980c5620ec Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
2017-08-04 22:43:16 +02:00
Martin
2616261fd2 Revise all LDC-specific errors/warnings/deprecs and insert backticks
For DMD's new syntax highlighting. I grepped in all .{h,cpp} files only.
2017-08-03 22:53:49 +02:00
Martin
c51c2c0d55 Merge 2.075.0 front-end and stdlibs 2017-07-30 03:03:28 +02:00
Martin
5dd07dcfbe Switch to special quiet NaN as init value for all FP types
As 'processing' a signalling NaN may convert it to a quiet NaN. Apparently
happening on 32-bit x86 using the x87 FPU, but not on x86_64 with SSE.

This fixes potential issues with different constants being used when
mixing natively and cross-compiled objects/libs and failing bitwise `is`
comparisons etc.

See https://forum.dlang.org/post/nsp1ql$ivu$1@digitalmars.com for Martin
Nowak's summarized findings.
2017-07-28 01:13:13 +02:00
Martin
f17ff5efe0 Don't depend on host real_t.init, use LLVM's signalling NaN instead 2017-07-28 01:09:02 +02:00
Martin
03d803419d Fix Target.RealProperties potentially aliasing Target.DoubleProperties
In case the host real_t is double (e.g., for MSVC hosts).
2017-06-10 04:30:43 +02:00
Martin
090031cd43 Upgrade front-end + libs to v2.074.1 2017-06-10 03:09:40 +02:00
Martin
85e004fdec Merge branch 'master' into merge-2.074
Conflicts:
	runtime/druntime
2017-05-16 21:16:43 +02:00
Nikolay
25144d6a88 NetBSD: fix mutex size (#2109) 2017-05-12 11:17:23 +02:00
Martin
f70a51a18c Merge 2.074.0 front-end 2017-04-22 03:52:58 +02:00
Martin
0e71a760ae Limited support for arbitrary target reals
While parsing of floating-point literals and CTFE still operate with the
host LDC's real type, compile-time reals can in principle be emitted in
arbitrary precision via LLVM software conversion, therefore paving the way
for cross-compilation to all targets.

The representable constants are still limited by the compile-time real_t
precision. E.g., LDC on Windows with its 64-bit reals can't hold and emit
an 80-bit `real.max` when cross-compiling to a non-Windows x86(_64)
target; the compile-time value will silently overflow to infinity and
later be emitted as 80-bit infinity.

LDC on AArch64 with its 128-bit quad-precision reals on the other hand can
hold and emit reals for all targets, making it a universal cross-compiler
with quad-precision compile-time reals in hardware.

We don't use the strange 2x64-bit PPC double-double format (see
`getRealType()` in `ir/irtype.cpp`), but would more or less support it
(the type properties (max, min_normal...) still need to be determined;
LLVM isn't sure about those either...).
2017-02-11 14:24:46 +01:00
Martin
7c1e4a74ce Fix C++ mangling of real: __float128 => long double 2017-02-03 23:13:24 +01:00
Martin
de0708e99b Fix compilation error for LLVM 4.0+ 2017-02-01 20:49:42 +01:00
Martin
dca21939e1 Merge 2.072.2 front-end
The part needing most attention was ddmd.root.ctfloat, ddmd.target (incl.
gen/target.cpp) and ddmd.builtin. The front-end is now prepared for
elaborate compile-time floating-point types to allow for proper cross-
compilation.

This version still uses the host's `real` type for compile-time reals,
except for MSVC hosts, which still use 64-bit doubles (when compiled with
DMD host compiler too).

Some other changes:

* semantic*() of Statements extracted from statement.d to statementsem.d
* mangle() -> mangleToBuffer()
* Identifier::string -> toChars()
* Token::float80value => floatvalue
* Dsymbol::isAggregateMember() => isMember()
* BoolExp is no more
* ddmd.root.ctfloat: LDC-specific CTFE builtins
2017-01-29 15:48:03 +01:00
kinke
bb3e16481c Fix alignment and size of target critical section (#1956)
The missing alignment is a front-end bug; this is a combined backport
of dlang/dmd@b9aa6ed and dlang/dmd@a93fa3c.

For POSIX targets, the critical section size was assumed to be identical
to the host compiler's, which generally isn't true when cross-compiling.

DtoMutexType() wasn't used anywhere, so I removed it.
2017-01-13 21:44:28 +01:00
David Nadlinger
9f998a398d Initial merge of upstream v2.071.0-b2
Notably, the glue layer side of the changed multiple interface
inheritance layout (DMD a54e89d) has not been implemented yet.

This corresponds to DMD commit 3f6a763c0589dd03c1c206eafd434b593702564e.
2016-04-03 15:15:14 +01:00
Rainer Schuetze
4a200b7b88 fix ordering of overloads 2016-03-13 17:27:57 +01:00
Johan Engelen
acdcc4a8c1 Merge branch 'master' into merge-2.069 2016-02-13 20:12:17 +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
Kai Nacke
8df1f7ec1a Add more support for xBSD type OS.
Use the same code for FreeBSD, NetBSD, OpenBSD and DragonFly BSD.
2016-01-22 22:10:33 +01:00
Martin
e7f26a94b0 Prepare generic x86 TargetABI for proper MSVC support
Based on Rainer's work in
3e36652c2c
2015-12-06 19:09:33 +01:00
Martin
fa48cabedc Some more cosmetic fixes 2015-11-02 19:54:18 +01:00
David Nadlinger
05d45350aa clang-tidy: Add readability-else-after-return 2015-11-02 11:30:40 +02: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
Martin
05c10d9107 Introduce DtoAlignment() and overload DtoAlloca() for VarDeclarations
Trying to get the alignment right by using the first non-default one
in the following order of descending priority:

VarDeclaration::alignment [variables only of course]
Type::alignment()
Type::alignsize()

This fixes `align(x) struct S { ... }`.
2015-10-18 14:38:09 +02:00
David Nadlinger
7af77ab141 Fix va_list mangling for System V AMD64 2015-06-07 19:18:58 +02:00
kai
c39c7e9c35 Update to DMD v2.067.0-b2
Includes all tagged with v2.067.0-b2. Does not includes latest druntime changes from ldc (head) branch.

This is known to be broken. I only merged the frontend stuff but did not try to compile something...
2015-02-24 22:16:17 +01:00
kai
a2748cd2fd Merge current development state of 2.067
First merge of current development stream. Asm blocks are known to be broken.

DMD:      0c9f437bc24015707130ba42dc434d9cd58282fb
druntime: 86d49cfb3670904603df0cfdfe44c6fff565c0fc
Phobos:   a8ca4f7964becac680af0eadbde05aa7d10fc338
2014-11-15 18:53:23 +01:00
Alexey Prokhin
7f27938b09 va_list is char* on X86 for c++ compatibility
And we are using X86 convension on all platforms right time.
2014-08-24 21:01:40 +04:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04: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
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
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
Alexey Prokhin
d45931972c Move Target implementation out of dmdfe 2013-07-29 11:18:25 +04:00