Commit graph

280 commits

Author SHA1 Message Date
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
kai
1e8fcfd5d9 Fix compiler error introduced with 6661054399. 2014-10-29 22:11:29 +01:00
kai
2a8b92060f Better dumping of predefined version identifiers.
Also count spaces in order to limit line length to 80.
2014-10-29 21:57:21 +01:00
kai
6661054399 Linux/PPC64: Statically define ELFv1 for Big Endian and ELFv2 for Little Endian Systems.
This is in preparation for the missing `--with-abi=` command line switch.
ELFv1 and ELFv2 are reserved version identifiers starting with DMD 2.067.
2014-10-29 21:31:41 +01:00
kai
2f1fd0d902 Fix yet another LLVM 3.6 compile error with the llvm::Linker class.
The value llvm::Linker::DestroySource was removed.
2014-10-29 20:53:14 +01:00
kai
e5745f5bb1 Fix compile error with LLVM 3.6.
The llvm::Linker class now uses diagnostic messages.
2014-10-25 18:11:49 +02:00
kai
332480460c Revert "Fix compile error with LLVM 3.6."
This reverts commit cc829485cc.
2014-10-25 18:02:26 +02:00
kai
cc829485cc Fix compile error with LLVM 3.6.
The llvm::Linker class now uses diagnostic messages.
2014-10-25 17:39:42 +02:00
David Nadlinger
3d1be20470 Remove availableExternally logic and extra inlining semantic passes.
Turns out that since the change to use DMD's symbol emission
logic a few releases back we didn't actually ever emit code
for the extra modules. Thus, all the effort for the extra
semantic passes went to waste.

If we want to implement DMD-style cross-module inlining, we
need to add the extra semantic3s back in, and then iterate
over all the non-root modules with a codegen visitor that
only emits symbols as available_externally.

We probably won't need the availableExternally members if
we start with a clean design in the new symbol emission
framework. Thus, remove everything in the meantime. This
will make some release builds a bit faster, and should not
negatively affect generated code.
2014-10-04 20:02:13 +02:00
David Nadlinger
e1ffd58732 Merge branch 'master' into merge-2.066
Conflicts:
	gen/functions.cpp
2014-09-14 15:29:43 +02:00
David Nadlinger
3ec1a01e8a [cleanup] Fix a couple of typos. 2014-09-14 14:54:17 +02:00
Kai Nacke
382ad184d8 Merge branch 'master' into merge-2.066
Conflicts:
	dmd2/builtin.c
	gen/classes.cpp
	gen/functions.cpp
	gen/llvmhelpers.cpp
	gen/statements.cpp
	gen/toir.cpp
	runtime/druntime
	runtime/phobos
2014-09-13 23:11:54 +02:00
Alexey Prokhin
a81c6c6f48 Add -enable-color/-disable-color switches 2014-09-06 20:30:19 +04:00
kai
fc4821ac7e More name clash fixes 2014-09-04 07:55:03 +02:00
kai
df0d302d5b Fix MingW build with LLVM 3.5
Starting with LLVM 3.5 it is better/required to use Triple.isWindowsGNUEnvironment().
Reported by Daniel N.
2014-08-26 18:57:12 +02:00
kai
aa35307f54 Fix LLVM 3.6 build 2014-08-23 20:02:43 +02:00
Alexey Prokhin
4be264848e Initialize traits string table 2014-08-22 16:26:16 +04:00
Alexey Prokhin
4d39ed89b4 Implement -boundscheck=on|safeonly|off 2014-08-22 16:01:35 +04:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
kai
6aebfbdd0a Fix LLVM 3.6 build 2014-08-11 12:37:54 +02:00
kai
b73e5fb5ef Fix LLVM 3.6 build 2014-08-06 07:18:00 +02:00
Andreas Hollandt
6702954cda llvm API changes 2014-07-31 18:18:06 +02:00
Andreas Hollandt
a1b42f28ae fix for llvm trunk 2014-07-17 00:11:09 +02:00
David Nadlinger
b40099d96b driver: Emit __bss_start/_end as weak symbols to work around linker bug.
A similar problem as in upstream issue 13025 has been
observerd for LDC on Arch Linux (GNU ld 2.24) as well. This
is essentially the same workaround as Martin came up with in
D-Programming-Language/druntime#889. Because the linker
defines the symbols anyway as part of the default linker
script, the weak linkage actually makes no difference.
2014-07-14 02:36:42 +02:00
David Nadlinger
3503206ccc Do not try to verify/emit LLVM module on codegen error. 2014-07-11 18:11:16 +02:00
David Nadlinger
7ac8e17e2d Do not emit ModuleInfo for the implicit __entrypoint module.
This is in line with what DMD does, if of course with a
different implementation.
2014-07-10 01:20:43 +02:00
David Nadlinger
4abdec752e driver: Support code for shared library collision detection. 2014-07-10 00:45:10 +02:00
David Nadlinger
36e9465b7a driver: Factor out entry point module emission code. 2014-07-09 15:35:06 +02:00
David Nadlinger
3563225a5e Paste flags from config file in front of command line arguments.
This way, the user can override any defaults defined in the
config file.
2014-07-04 18:54:28 +02:00
David Nadlinger
d895c7f26d Make -defaultlib/-debuglib override instead of append; deprecate -nodefaultlib.
This is necessary as the only point of having -defaultlib
and -debuglib is to enable the user to customize the defaults
set in the configuration, for example to avoid linking to
Phobos.

GitHub: Fixes #416.
GitHub: Fixes #601.
2014-07-04 18:54:28 +02:00
David Nadlinger
407adffa9e Hide '-disable-debug-info-verifier'. 2014-06-30 18:15:37 +02:00