Commit graph

572 commits

Author SHA1 Message Date
Johan Engelen
9dad1609db Merge pull request #1812 from JohanEngelen/rename-ir2obj
Rename "ir2obj-cache" to "cache"
2016-10-16 16:27:06 +02:00
Rainer Schuetze
f77d3fa6ff Merge pull request #1818 from rainers/fix_llvm40_2
fix build against LLVM master: clEnumValEnd removed
2016-10-13 01:35:09 +02:00
Rainer Schuetze
0b55bd21d2 fix build against LLVM master: clEnumValEnd removed 2016-10-12 23:55:59 +02:00
Johan Engelen
61e99e82d7 Rename "ir2obj-cache" to "cache" (source and filenames) 2016-10-12 18:58:01 +02:00
Johan Engelen
e0c78fa198 Rename -ir2obj-cache-* cmdline flags to -cache-*, because the cache can be used for more things than just ir2obj caching.
Rename "ir2obj" namespace to "cache".
2016-10-12 18:58:01 +02:00
kinke
a90fdfe624 Merge pull request #1815 from kinke/defaultCPU
Let LLVM figure out default CPU for ARM/AArch64
2016-10-11 20:03:45 +02:00
Martin
a8c6293865 Create output directories recursively
Fixes issue #1819.
2016-10-09 23:21:35 +02:00
Martin
4da394d9d0 Let LLVM figure out default CPU for ARM/AArch64 2016-10-09 02:08:08 +02:00
Johan Engelen
d68eb90974 ir2obj: Ignore the compiler executable filepath (first arg) for the hash. 2016-10-06 12:03:44 +02:00
Johan Engelen
88439535d5 ir2obj: also ignore the -lib cmdline flag for hashing 2016-10-06 12:03:44 +02:00
Johan Engelen
f6919e3fb6 ir2obj cache: Add all cmdline args to the hash, unless we are certain they can safely be ignored for ir2obj hashing. 2016-10-06 12:03:44 +02:00
Rainer Schuetze
8f0f29c239 fix building against recent LLVM 4.0 2016-10-03 10:58:21 +02:00
Martin
b9811cef1c Don't append dot to unknown extension for -of filename
I've previously missed this part when moving to the DMD output filenames.
LDC used to enforce the target object file extension for all produced
objects.

So in `compilable/ldc_output_filenames.sh`, we tried to produce the object
file `myObj.myExt.` instead of `myObj.myExt`. The tests passed on Windows,
but failed at least on Linux.
2016-09-27 22:12:54 +02:00
Martin
8f2665d7bb Windows: Support .res and .def files in command-line 2016-09-27 01:34:05 +02: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
Rainer Schuetze
5bcfb49b1b Enable gdb tests in dmd-testsuite (#1784)
Introduce a hidden `-dwarf-version=<uint>` switch to support old gdb versions
used by Travis. Older versions only supporting DWARF-2 and/or not supporting
TLS correctly are detected in dmd-testsuite's CMakefile.
2016-09-27 01:26:15 +02:00
Johan Engelen
2649c94be0 ir2obj-cache: fix bugs in relative size pruning. 2016-09-17 20:04:19 +02:00
David Nadlinger
1a70704e3e Merge pull request #1753 from JohanEngelen/prunecache_d
Add ir2obj cache pruning support.
2016-09-14 23:39:35 +01:00
Johan Engelen
b70042a85e LLVMContext::setDiscardValueNames(true) when not compiling to textual IR.
Resolves #1749
2016-09-14 12:34:58 +02:00
Johan Engelen
df4cd3fc20 Add ir2obj cache pruning support. 2016-09-14 10:08:48 +02:00
David Nadlinger
216c1126d1 ldmd: Remove now-unused createOutputDir() 2016-09-10 18:50:33 +01:00
Martin
4a9a7ec4ae LDMD: Don't create output directories, let LDC handle that
LDC created the output directories already before my recent changes.
2016-09-07 10:38:26 +02:00
Martin
bfac582294 Enforce backslashes in most paths on Windows
DMD does too, and the front-end's FileName class expects backslashes in
some places.
Due to the import and lib directories in the ldc2.conf file being
specified with forward slashes, most paths produced by LDC used both
slashes, e.g., `C:/LDC/ldc/runtime/druntime/src\object.d`, which looks
unprofessional, is problematic for the front-end and leads to differences
wrt. DMD when outputting module dependencies etc.
2016-09-07 10:03:33 +02:00
Martin
d85986be3d Infer output names from first object file alone (ignore root module) 2016-09-07 09:53:35 +02:00
Martin
6c03a3d725 Streamline output filenames and -singleObj behavior some more with DMD 2016-09-07 09:53:35 +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
aed881350a Refactor output filename generation/validation 2016-09-07 09:53:35 +02:00
David Nadlinger
fa2080d80e driver: CoverageParser::parse ArgName is unused [nfc] 2016-09-03 00:52:03 +01:00
David Nadlinger
6f98b63996 driver: Remove some elses for ifs with return statements [nfc]
Also some very minor deduplication.
2016-09-03 00:52:03 +01:00
David Nadlinger
11572489d5 clang-format again some files touched in the next commits [nfc] 2016-09-03 00:52:00 +01:00
David Nadlinger
bc3c3f14f2 response: Don't use unrelated pointer type for malloc size [nfc]
clang-tidy warns on this.
2016-09-02 23:31:20 +01:00
David Nadlinger
49e16239f6 CoverageParser: Mark constructor as explicit [nfc] 2016-09-02 23:30:40 +01:00
Martin
41fb7830df Remove LDC-specific global.obj_ext_alt
No functional changes intended.
2016-08-28 21:41:04 +02:00
Martin
16b2c8942f Support parameterless '-deps' command-line option
In both LDC (undocumented) and LDMD. This should fix issue #1626.
2016-08-28 02:43:48 +02:00
Martin
94d8cad554 Slipstream LDC-specific main() mods directly into ddmd/mars.d 2016-08-28 02:43:48 +02:00
Martin
36edf4f200 Inline-initialize LDMD params 2016-08-27 20:49:58 +02:00
Martin
bebcf31740 Fix issue #1625
By not freeing() the global.params.moduleDeps buffer after writing the
module dependency file.
2016-08-27 20:40:27 +02:00
Martin
24cecc268c Streamline main() with DMD's (ddmd/mars.d) 2016-08-27 20:40:26 +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
Johan Engelen
7bc6512c65 Early merge front-end fixes for Module.semantic.
This eliminates the hidden-virtuals warning flood.

See
https://github.com/dlang/dmd/pull/6001
60f622ff1b
and
https://github.com/dlang/dmd/pull/6038
2016-08-08 19:24:04 +02:00
Johan Engelen
e95a8472d0 [PGO] For LLVM >= 3.9, let profile-rt set the default filename. This prevents extra stderr messages when overriding the filename using the "LLVM_PROFILE_FILE" environment variable. 2016-08-04 16:35:44 +02:00
Matthias Klumpp
d949688216 Default to PIC code on Linux
Modern Linux distributions have their toolchain generate PIC code for
additional security features (like ASLR).
Since there is no (sane) way to detect whether the toolchain defaults to
PIC code, we simply default to PIC code on all Linux
distributions to avoid linking issues on these OSes.

The relocation model can be switched back to non-PIC code manually at
any time.
2016-08-02 20:55:54 +02:00
Johan Engelen
ae5ffa4c0d Fix LLVM 4.0 build. 2016-07-29 16:57:12 +02:00
Johan Engelen
be54d79966 Revert 4fede9467f 2016-07-29 15:33:41 +02:00
Johan Engelen
4fede9467f Fix LLVM 4.0 build. 2016-07-29 15:32:28 +02:00
Johan Engelen
c3fe8f3fdd Refactor the call to llvm::sys::fs::getMainExecutable.
Taking the address of `main` is UB in C++. Reading LLVM's source, any function address can be used (that's what clang does too).
2016-07-28 14:00:53 +02:00
kinke
dbc9733a05 Merge pull request #1649 from JohanEngelen/warningfix1
Fix a few clang warnings [NFC]
2016-07-28 00:46:53 +02:00
Johan Engelen
c6ba2dc29b Fix a few clang warnings. [NFC] 2016-07-27 20:21:02 +02:00
Johan Engelen
0fcd50fb0d Do the check that gExePath is not a directory (before deleting it) also in release builds. 2016-07-27 19:47:51 +02:00
Martin
436aba77af Fix issue #1621
LLVM's ParseCommandLineOptions() expands response files automatically, but
always uses the TokenizeGNUCommandLine tokenizer, which apparently eats
backslashes.

The solution is to pre-expand the response files into the arguments vector
on the LDC side, and using TokenizeWindowsCommandLine if LDC is built for
Windows.
2016-07-23 15:31:27 +02:00