Commit graph

229 commits

Author SHA1 Message Date
Johan Engelen
febfcad3a2 Add "built with D compiler version" to --version output. 2016-03-21 14:13:30 +01:00
David Nadlinger
dff1e8bfad driver: Call objc_tryMain_init()
Not sure whether this actually does anything for us at this point,
but missing initialization has bitten us severely in the past.
2016-02-06 19:41:48 +01:00
David Nadlinger
71a507ac08 driver: Disable D GC 2016-02-03 20:32:58 +01:00
David Nadlinger
d531614a34 driver: Initialize D druntime 2016-01-29 21:56:49 +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
d072bdf7b6 Do not use global.params.is<OS>
This PR replaces the few uses of global.params.is<OS> with
global.params.targetTriple.isOS<OS>(). This avoids adding a new
boolean for each supported OS.
It also defines all xBSD-type OS as using the dso-registry.
2016-01-12 09:15:05 +01:00
Johan Engelen
4399271762 Fix a few compiler warnings. 2015-12-22 12:36:28 +01:00
David Nadlinger
57546e1723 driver: Add -static option for creating fully static binaries 2015-11-29 20:16:19 +01:00
Johan Engelen
70a6e73188 Cleanup runtime fwd decls and use ABI functiontype rewriting 2015-11-22 01:27:26 +01:00
Dan Olson
49ba2910b0 OS X - default OS to macosx instead of darwin
On OS X, the OS in Triple should be macosx, not darwin.  This is not
comprehensive like clang which has a bunch of darwin to other OS
translation rules, but since only Darwin target currently supported is
OS X, this does the job.
2015-11-12 10:52:05 -08:00
David Nadlinger
cf8b6eec3e driver: Do not disable FP elim by default when -g is given
This brings us in line with what GCC and Clang do, and as soon
as proper libunwind/DWARF-based backtraces are implemented, it
will be obsolete (right now they are broken anyway).
2015-11-02 17:04:26 +02:00
David Nadlinger
51afced357 Also clang-tidy driver/ 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
2d959ea540 Make use of C++11 range-based for
Should be available now that support for LLVM < 3.5 has been dropped.
2015-11-01 14:49:04 +01:00
David Nadlinger
aa0dd1ba05 driver: Hide some more LLVM-internal options
(from LLVM 3.6.1 on OS X)
2015-10-31 20:34:35 +02:00
Martin
60d676e2a1 Drop support for LLVM < 3.5
This allows to clean up the code a little.
2015-10-30 22:24:05 +01:00
Kai Nacke
a73cf5ed22 Merge branch 'master' into merge-2.068 2015-10-27 22:12:19 +01:00
Kai Nacke
cddbe70909 Merge pull request #1164 from rainers/build_llvm38
fix build against llvm master (llvm 3.8)
2015-10-24 19:30:52 +02:00
Martin
54c9661b30 Merge branch 'master' into merge-2.068 2015-10-18 13:57:30 +02:00
kinke
86f151d0f3 Merge pull request #1162 from rainers/fix_lib_error
issue #1161: return status if lib invocation failed
2015-10-18 00:00:36 +02:00
Rainer Schuetze
7413f1a8f5 fix build against llvm master (llvm 3.8) 2015-10-17 16:07:17 +02:00
Rainer Schuetze
8b5cee7a7c issue #1161: return status if lib invocation 2015-10-17 15:27:37 +02:00
Kai Nacke
c06e2ad7ea Handle command line option color.
There is a LLVM 3.7 command line option named color. This option is
only available if ldc is linked against shared LLVM libraries.

Because the LDC color option uses a FlagParser simple renaming does
not work. The solution is now:

- Rename LLVM option `color` to `llvm-color` and hide this option
- Dynamically create the LDC option `color`

This finally enables building with shared LLVM libraries.
2015-10-11 17:24:29 +02:00
David Nadlinger
d85d256776 Fix setting D_NoBoundsChecks for -boundscheck=off builds 2015-10-10 13:03:42 +02:00
Martin
2d597ac1f0 Merge branch 'master' into merge-2.068
And update dmd-testsuite.
2015-10-08 23:01:51 +02:00
Martin
9956d326f0 Implement -conf command-line switch for LDC2 and LDMD2 2015-10-07 02:27:49 +02:00
Martin
8ee0e250c7 Merge branch 'master' into merge-2.068 2015-10-02 15:38:02 +02:00
Martin
1670323ebb Refactor argv[0] management, related path searches etc. 2015-09-27 20:47:14 +02:00
Martin
d45170464e Merge branch 'master' into merge-2.068
Conflicts:
	runtime/druntime
2015-09-26 14:21:43 +02:00
David Nadlinger
bd47ea49e6 Merge branch 'master' into merge-2.068 2015-09-24 17:57:25 +02:00
David Nadlinger
8c428e66a5 driver: Only use slow -debuglib libraries if explicitly asked to
Causing a painfully slow version of the standard library (there are
some contracts in druntime that cause O(1) hash table operations to
become O(N)!) to be linked is definitely not what people expect -g
to do. Having a debug version of teh standard library with all the
assertions available is still valuable, but is used infrequently
enough that hiding it behind an extra command line option is
adequate.

I thought long and hard about approaches that avoid having to add
yet another command line flag, but except for ditching -debuglib
altogether and having people manually override -defaultlib, there
is no way of figuring out the user's intent from the other flags.

GitHub: Closes #417.
2015-09-23 13:43:56 +02:00
Martin
9166f34657 Windows: replace forward slashes in cmdline source files by backslashes
This fixes fail_compilation\diag4479.d on Win64.
2015-09-21 22:48:41 +02:00
Kai Nacke
06cfb9f06d Merge pull request #1095 from redstar/versions
Add missing version identifiers for C runtimes.
2015-09-19 18:11:36 +02:00
Kai Nacke
15137db01d Add missing version identifiers for C runtimes.
Define CRuntime_Glibc for Linux and CRuntime_Bionic for Android.
2015-09-19 15:51:43 +02:00
Kai Nacke
a449635d4c Add predefined version for S390. 2015-09-19 15:36:18 +02:00
David Nadlinger
12aa09ed32 Define CRuntime_{Bionic, Glibc} 2015-08-29 15:23:17 +02:00
David Nadlinger
9fd1e8d2a6 Merge frontend tag v2.068.0
Kept idgen as C++ program for now. We'll tackle build system integration
once we actually switch to DDMD.
2015-08-29 03:09:17 +02:00
Kai Nacke
ec0d7bbcf1 Merge pull request #974 from klickverbot/singleobj-rework
Avoid using llvm::Linker
2015-06-27 23:26:22 +02:00
Kai Nacke
a7de8d07e9 Merge branch 'master' into merge-2.067 2015-06-27 21:23:57 +02:00
Kai Nacke
d7347a5829 Do not imply -singleObj if creating lib.
If a target file name is given (`-of`) and a library is created then
`-singleObj` is implied. This results in behaviour not compatible
with dmd. This commit checks for this situation and does not set
`-singleObj`. This fixes issue #978.
2015-06-26 07:41:16 +02:00
David Nadlinger
0922254dd1 Directly emit IR into same llvm::Module instead of using Linker
GitHub: Fixes #970.
2015-06-14 21:36:35 +02:00
Kai Nacke
4e1e381fec Merge branch 'master' into merge-2.067 2015-05-24 19:21:58 +02:00
Kai Nacke
2331889669 MIPS: Implement ABI handling.
Adds a new command line option -mabi= and uses the value to compute
the ABI to use. Adds the ABI to linker and assembler invocation, too.
Allows consistent invocation of the whole tool chain.
2015-05-24 18:11:24 +02:00
Kai Nacke
1036edc266 Merge branch 'master' into merge-2.067 2015-05-17 13:06:46 +02:00
Kai Nacke
0cadfa055c LLVM 3.7: Use comparison instead of assignment.
Bug spotted by Temtaime.
2015-05-17 13:01:15 +02:00
Kai Nacke
b92e377d49 Fix definition of D_LP64.
LP64 defines a C environment with 64bit pointers and char/short/int/long
are 8/16/32/64bit. char/short/int/long have defined sizes in D. We need
to look only at the pointer size.

There are now 64bit environments with 32bit pointers. Examples are
x32 in Intel and N32 on MIPS64. For these environments D_LP64 should
not defined but the global.param.is64bit is still true. The definition
of size_t is also affected. If only 32bit are addressable then size_t
should also be a 32bit type. (This is not required by C standard but
common practize.)

The net result is that not only the definition of D_LP64 must be changed
but also DtoSize_t().
2015-05-17 12:29:23 +02:00
Kai Nacke
0e93072259 MIPS64: Use DataLayout.getLargestLegalIntTypeSize() to check for N32.
This is more natural: if pointers are not 64bit but the largest
int type is 64bit then the ABI is N32; otherwise it is O32.
2015-05-16 23:27:54 +02:00
Kai Nacke
afe6051ead LLVM 3.7: Fix MIPS ABI definition.
Detection of EABI is still missing.
2015-05-16 18:56:59 +02:00
kai
eb03d40a18 Merge branch 'master' into merge-2.067 2015-05-12 18:14:47 +02:00
Kai Nacke
82a76cf3f8 LLVM 3.7: TargetOptions.UseSoftFloat is gone.
A function attribute use-soft-float with values true or false is used instead.

This commi only ensures that LDC compiles with LLVM 3.7. The possible semantic
change needs to be evaluated.
2015-05-12 18:11:30 +02:00