Commit graph

260 commits

Author SHA1 Message Date
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
Kai Nacke
ac7f8c70f8 Merge branch 'master' into merge-2.067
Conflicts:
	dmd2/mars.h
	driver/ldmd.cpp
	gen/module.cpp
2015-04-08 22:23:50 +02:00
Johan Engelen
505f18ca2a Add coverage analysis ("-cov=...") to ldc2 2015-04-07 22:11:02 +02:00
Kai Nacke
ced658da92 Merge branch 'master' into merge-2.067 2015-04-05 03:29:30 +02:00
kai
13fb3f2ace Fix for issue #855.
Linking several modules together seems to trigger assertions with
identified structs. In debug builds, the assertion
!(Pair.first != Ty && Pair.second == Ty) && "mapping to a source type"
is raised. In non-debug builds, you often get a D exception saying
"Enforcement failed".

Reason seems to be the use of the some type object in different
modules. E.g. module A imports from module B the struct S. Then both
modules refer to the same identifed llvm::StructType object. This
causes the errors.

The behaviour may be an LLVM bug. There is no test case for this
situation. This affects all supported LLVM versions. If the target
module is changed (e.g. use of llvmModule[0] instead of an empty
module) then the error occurs in other LLVM versions, too.

This commit uses the following workaround:
- target module is llvmModule[0] (instead of an empty module)
- each other module is first linked into an empty module and then
  into the target module.

This is really ugly but avoids the error.

There is no new test case required because runnable/A16.d already
checks it.
2015-04-05 03:17:53 +02:00
kai
f5a2789659 Set version identifier CRuntime_Microsoft if compiling for MSVC 2015-03-01 17:33:52 +01:00
Kai Nacke
886c2eab06 Merge branch 'master' into merge-2.067
Conflicts:
	runtime/druntime
2015-03-01 15:03:31 +01:00
Dan Olson
ecd6843069 Stray tab cleanup 2015-03-01 00:29:32 -08:00
Dan Olson
3c9da62ea3 Set version ARM_SoftFP
Set versions ARM_SoftFP & D_HardFloat instead of ARM_SoftFloat &
D_SoftFloat for option -mfloat-abi=softfp (function calls use soft float
ABI but using hardware floating point instruction).

(cherry picked from commit 5a19080e04cc775fe94ea2ef74c850b26bb8a469)
2015-02-28 23:53:30 -08:00
kai
9872ab0c17 Add missing lexer initialization 2015-02-24 22:42:26 +01: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
e455b90456 Merge branch 'master' into merge-2.067
Conflicts:
	dmd2/template.c
	runtime/druntime
	runtime/phobos
2015-02-24 07:23:58 +01:00
kai
56a0aa00eb LLVM 3.7: getRegisteredOptions() returns a reference.
The missing & caused some memory corruption.
This finally resolves issue #833.
2015-02-08 00:19:36 +01:00
kai
1275131729 LLVM 3.7: Fix call to getRegisteredOptions().
The map is now the return value, not a parameter.
2015-02-02 08:00:34 +01:00
kai
e3e10a0a86 LLVM 3.7: Add changes for TargetLibraryInfo and DataLayout.
The TargetLibraryInfo class is now a wrapper. The real implementation
is TargetLibraryInfoImpl.

The TargetMachine can be asked for the DataLayout (like in all other
supported versions except 3.6)
2015-01-30 08:08:14 +01:00
David Nadlinger
152e2c7808 driver: Respect -m64.
GitHub: Fixes #824.
2015-01-13 23:42:46 +01:00
kai
024b14cd7f Fix some warnings.
These are easy to solve and reduce the noise in the Travis build.
2014-12-26 15:59:23 +01:00
kai
a4f5213d8b Yet another LLVM 3.6 change.
There are some changes to pass initialization:
- initializeDebugIRPass() is gone
- initializeRewriteSymbolsPass() is new
2014-11-30 15:42:07 +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
David Nadlinger
e794bfa547 Demote some more LLVM-internal flags to -help-hidden.
Based on LLVM 3.5.0 on OS X built for x86 only.
2014-11-14 22:23:12 +01:00