Commit graph

63 commits

Author SHA1 Message Date
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
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
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
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
49e16239f6 CoverageParser: Mark constructor as explicit [nfc] 2016-09-02 23:30:40 +01: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
Johan Engelen
c7e0486205 Add IR-to-Objectcode caching with -ir2obj-cache=<cache dir>. 2016-06-23 19:48:59 +02:00
Johan Engelen
e0d9c58443 [PGO] Add PGO to LDC. Supported for LLVM >= 3.7
Add the commandline options -fprofile-instr-generate[=filename] and -profile-instr-use=filename
-fprofile-instr-generate
-- Add instrumentation on branches, switches, and function entry; uses LLVM's InstrProf pass.
-- Link to profile runtime that writes instrumentation counters to a file.
-fprofile-instr-use
-- Read profile data from a file and apply branch weights to branches and switches, and annotate functions with entrycount in LLVM IR.
-- Functions with low or high entrycount are marked with 'cold' or 'inlinehint'.

The only statement type without PGO yet is "try-finally".

A new pragma, `pragma(LDC_profile_instr, [ true | false ])`, is added to selectively disable/enable instrumentation of functions (granularity = whole functions).

The runtime library ldc-profile-rt is a copy of LLVM compiler-rt lib/profile. It has to be exactly in-sync with the LLVM version, and thus we need a copy for each PGO-supported LLVM (>=3.7).
import ldc.profile for a D interface to ldc-profile-rt (for example to reset execution counts after a program startup phase).

The instrumentation data is mainly passed on to LLVM: function-entry counts and branch counts/probabilities. LDC marks functions as hot when "execution count is 30% of the maximum function execution count", and marks functions as cold if their count is 1% of maximum function execution count.

The source of LLVM's llvm-profdata tool is hereby included in LDCs repository (different source for each LLVM version), and the binary is included in the install bin folder.
The executable is named "ldc-profdata" to avoid clashing with llvm-profdata on the same machine. This is needed because profdata executable has to be in-sync with the LLVM version used to build LDC.

Maintenance burden: for trunk LLVM, we have to keep ldc-profile-rt and llvm-profdata in sync. There is no diff with upstream; but because of active development there are the occasional API changes.
2016-06-20 17:28:22 +02:00
Johan Engelen
776e32d801 Add experimental -hash-threshold option to hash very long symbol names. 2016-05-24 11:39:08 +02:00
Kai Nacke
de296b90ec LLVM 3.9: llvm::Reloc::Default was removed.
The value is now optional as there is nothing like a default relocation.
2016-05-20 21:17:20 +02:00
Rainer Schuetze
a2c5f15955 implement -transition=* 2016-04-20 23:03:20 +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
60d676e2a1 Drop support for LLVM < 3.5
This allows to clean up the code a little.
2015-10-30 22:24:05 +01:00
Martin
54c9661b30 Merge branch 'master' into merge-2.068 2015-10-18 13:57:30 +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
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
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
ef6b4809e0 Fix boundcheck command line option.
Merging master introduced a problem which I fixed in the wrong way.
2015-04-26 00:31:50 +02:00
Kai Nacke
1920d40acd Remove deprecated -enable-boundscheck/-disable-boundscheck option.
Instead use -boundscheck=on|off.
2015-04-25 23:40:13 +02:00
Kai Nacke
94a3995426 Merge branch 'master' into merge-2.067
Conflicts:
	driver/cl_options.cpp
2015-04-25 23:38:35 +02:00
kai
4db0123bb7 Implement FlagParser using llvm:🆑:generic_parser_base.
This approach is easier and requires less code. With some template foo
the BoolOrDefaultAdapter is not required.

This solutions applies to previous LLVM versions, too.
2015-04-25 21:47:30 +02:00
kai
a1dfbabdee Fix variable name (again) 2015-04-09 23:55:11 +02:00
kai
eb570a8c60 Add new command line switch -dip25 2015-04-09 23:23:48 +02:00
kai
279c7c5e10 Don't do work twice 2015-04-09 21:21:14 +02:00
kai
e93b057b7c Make variable names unique 2015-04-09 21:01:58 +02:00
kai
77cac3acec Add options -vcolumns and -vgc 2015-04-09 20:59:21 +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
Dan Olson
1c9329deb8 Add new dmd -verrors option 2015-04-05 23:53:20 -07:00
Kai Nacke
a473a2aa2c LLVM 3.7: Do not declare -boundscheck twice 2015-03-21 19:09:31 +01:00
Alexey Prokhin
a81c6c6f48 Add -enable-color/-disable-color switches 2014-09-06 20:30:19 +04:00
Alexey Prokhin
892ecb79c4 Fix description of vcolumns 2014-08-24 21:01:45 +04:00
Alexey Prokhin
097d8ad0b3 Add -vgc and -vcolumns 2014-08-22 16:26:03 +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
a22518a7a6 Create parameter for maximum number of template instantiations.
Currently, the maximum number is hard coded. This PR creates a command line parameter for it.
Requested by bearophile: http://forum.dlang.org/post/tsphogrgyjeqyeadqkds@forum.dlang.org
2014-07-01 20:38:43 +02:00
David Nadlinger
d8a7ae1841 Use --gc-sections on Linux.
This was painful.
2014-06-30 16:18:15 +02:00
Alexey Prokhin
29af1d4664 DMD Issue 11284 - add -allinst compiler switch 2014-06-27 19:40:19 +04:00
David Nadlinger
28cd8b0ad2 Capitalize option decriptions. 2013-10-15 01:50:44 +02:00
David Nadlinger
257da5afe5 Bring back -disable-fp-elim.
It was moved to llvm/CodeGen/CommandLineFlags.h.

GitHub: Fixes #502.
2013-10-13 20:26:19 +02:00
David Nadlinger
422715fc89 Add -float-abi switch and auto-detection for ARM.
This is based on the implementation that was reverted in
fc8e0c4c20.
2013-10-06 07:39:12 +02:00
David Nadlinger
235bb94878 Make -release only disable bounds checking in non-@safe code. 2013-06-17 13:31:21 +02:00
David Nadlinger
46b6fdd531 Implement '-main'. 2013-06-15 23:09:59 +02:00
David Nadlinger
fc8e0c4c20 Revert -float-abi implementation.
The new command line option conflicted with a builtin LLVM 3.0
one. The functionality will be added back in after the 0.11.0
release branch has been created.

This reverts commit 6a1bc70bd7 and
subsequent fixes.
2013-05-12 00:18:44 +02:00
David Nadlinger
6a1bc70bd7 Added -float-abi and auto-detection logic for ARM.
Even though this argument design conflates two separate concepts
(ABI and hardware/software implementation), I chose to go
with it since users are liekly know it from GCC and the
combination of softloat operations with hardfloat ABI makes
no sense.

I didn't implement it for old LLVM versions, as ARM EABI
exception handling requires LLVM 3.3+ anyway, without which
LDC would be useless anyway.
2013-05-11 21:07:54 +02:00
David Nadlinger
32eb24eebf Added '-Hkeep-all-bodies' switch.
The same behavior is triggered by the '-inline' switch for
DMD, but this doesn't quite translate to LDC.
2013-03-16 11:52:19 +01:00