Commit graph

25 commits

Author SHA1 Message Date
Johan Engelen
e8b28ebae9 Fix LLVM trunk build. 2017-07-02 21:11:07 +02:00
Johan Engelen
fdd66e5ea7 Fix LLVM 5.0 build (#2173)
* Fix LLVM 5.0 compilation.

* Fix adding linker option metadata to LLVM module.

See https://reviews.llvm.org/D31349

* Version the SPIRV cache dir on travis.
2017-07-02 11:35:40 +02:00
Johan Engelen
3fd99eb207 Add -fsave-optimization-record option.
Resolves issue #2089
2017-05-04 11:07:16 +02:00
Martin
badea5a78d Don't immediately delete generated doc file
Just before writing the object file. Module::deleteObjFile() deletes the
doc file too, and generating the docs happens in a prior pass before
codegen.
deleteObjFile() is already called in mars.d, after reading the source
file, before the generate-doc pass.

Fixes dmd-testsuite's runnable/test_switches.sh.
2017-02-06 21:10:28 +01:00
Johan Engelen
7deae74d89 Only emit llvm.used _once_ when compiling multiple D modules into one LLVM module. 2016-10-26 21:59:18 +09:00
Martin
b1a6315ee4 Don't reverse order of object file names
Make sure the overall order corresponds to the user's command-line order
of object and source files. The only exception being singleObj builds,
for which the single object file for all source files is always the first
entry in the object files list (which is forwarded to the linker in that
order). This is done so that we can easily get hold of the name when
emitting the single object file later in the `ldc::CodeGenerator` dtor.
It should also clearly define the linking order (affecting comdat
selections etc.) for special singleObj builds.

Also reuse some more code (wrt. output filenames) from DMD's main().
2016-09-27 01:34:05 +02:00
Johan Engelen
b70042a85e LLVMContext::setDiscardValueNames(true) when not compiling to textual IR.
Resolves #1749
2016-09-14 12:34:58 +02:00
Martin
c748eb9ed0 Replace global.params.singleObj by global.params.oneobj
singleObj was LDC-specific.
2016-09-07 09:53:35 +02:00
Martin
41fb7830df Remove LDC-specific global.obj_ext_alt
No functional changes intended.
2016-08-28 21:41:04 +02:00
David Nadlinger
d47bdb234a gen: Use single ldc.register_dso function for both module ctor/dtor
This reduces the size of a statically linked Phobos-based
Hello World by 11 kB on Linux x86_64.

Also creates a header file for gen/module.cpp, which has been
renamed to "modules" such as not to conflict with the frontend
header file.
2016-08-18 16:28:41 +02:00
David Nadlinger
6de981af75 codegen, runtime: Go back to old executable .bss range detection
We had switched to a somewhat simplified implementation Martin
came up with for DMD based on our old one. Unfortunately, that
turned out not to work for certain ld.bfd versions on Linux
(e.g. 2.26.0.20160501), where the .bss section from other shared
objects would be picked up instead.

This reverts commit 08ad4fddb5.

GitHub: Fixes #1534.
2016-06-21 11:25:36 +01:00
Johan Engelen
404d483c2a Bitcode cmd arguments: fix compilation for LLVM < 3.8, and disable for LLVM 3.5. 2016-06-10 12:43:31 +02:00
Johan Engelen
d9b267a4be Accept LLVM bitcode files (*.bc) on the commandline and add the code to the first source file on the cmdline (the first emitted module). 2016-06-05 16:07:14 +02:00
Joakim
bf2cb831f3 Add back Android TLS support that was supposedly merged in ee8a832c4 but isn't there for some reason. 2016-05-15 16:44:11 +05:30
David Nadlinger
610edb9659 codegenerator: Remove unused code, add some doc comments [nfc] 2016-02-04 17:11:16 +01:00
David Nadlinger
08ad4fddb5 codegen, runtime: Use upstream _bss_{start, end} access solution 2016-02-03 20:29:43 +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
Martin
2dfa5e8569 Some more cosmetic fixes
Found by searching for lines > 80 chars.
2015-11-05 19:12:32 +01: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
60d676e2a1 Drop support for LLVM < 3.5
This allows to clean up the code a little.
2015-10-30 22:24:05 +01:00
Rainer Schuetze
7413f1a8f5 fix build against llvm master (llvm 3.8) 2015-10-17 16:07:17 +02:00
Martin
5645901dbc Windows: don't overwrite object file extension to .o
In case of a singleobj build and a provided output file (.exe or .obj).
The dmd-testsuite tests used to produce lots of .o files while expecting
.obj ones as specified in the command line.
2015-08-08 23:02:07 +02:00
Kai Nacke
d1e764cec1 Backport of "Avoid using llvm::Linker" to master.
See pull request #974 for the original code.
2015-06-27 22:08:44 +02:00