Commit graph

23 commits

Author SHA1 Message Date
Martin Kinkelin
8016608a55 Enable opt-in GC for front-end via explicit -lowmem switch
This is a port of dlang/dmd#9048.
2019-03-02 21:16:18 +01:00
Martin Kinkelin
39b46d7b69 Replace old-school header guards by #pragma once 2018-10-20 16:19:46 +02:00
Martin Kinkelin
4a23399236 Aim for consistent #includes (order + dir prefix)
I surely missed a few.
2018-10-20 16:19:46 +02:00
Martin Kinkelin
ac070a386d Config file: Add lib-dirs array
And replace the default `-L-L<path>` LDC switches in the default config
accordingly.

The first advantage is for cross-compilation, where additional sections
should now mostly get away with overriding `lib-dirs` (and `rpath` if
need be) only; not just to specify the directory containing cross-
compiled druntime and Phobos, but also further dirs containing the C
libs. No need to override a whole `[post-]switches` array anymore just
to tweak the lib dirs.

The second advantage is that we can search these dirs for compiler-rt
libs instead of being limited to `<bin dir>/../lib<LIB_SUFFIX specified
in CMake command line>` or trying to guess distro-specific paths
=> easy-peasy for distros and users.
This isn't implemented yet.
2018-07-24 21:27:43 +02:00
Martin Kinkelin
ddbd77c009
Config file: Treat section names as target triple regexps (#2718) 2018-06-01 20:42:01 +02:00
Martin
6812e0bcd4 Merge branch 'master' into merge-2.079
Conflicts:
	driver/cl_options.h
	driver/configfile.h
	ldc2.conf.in
	ldc2_phobos.conf.in
2018-04-22 14:31:31 +02:00
Martin
891234bbe4 Only set rpath when linking against shared default libs 2018-04-21 18:23:59 +02:00
Martin
a248b7537e Fix ConfigFile::path() for good
Only LLVM 4.0+ seems to support null pointers for llvm::StringRef
construction, so just check it manually.
2018-03-31 03:24:14 +02:00
Martin
32b7637528 Include config file path in JSON output
Required for dmd-testsuite's compilable/json2.d.

Also fixes a bug regarding ConfigFile::path() with a null config file
path (e.g., when disabled explicitly via `-conf=`) - the
std::string(const char *) ctor segfaults for a null pointer arg,
whereas llvm::StringRef handles null pointers gracefully.
2018-03-30 23:56:42 +02:00
Martin
d63efba2e7 Add post-switches to config file sections
For switches to be appended after the user switches (or right before the
first `-run` switch).

The sections inherit it (as well as `switches`) from the `default` section
if it isn't overridden explicitly.

Fixes issue #2186.
2017-08-20 14:25:05 +02:00
Martin
5111bbd4d2 Slightly refactor ConfigFile interface 2017-08-20 14:10:47 +02:00
Martin
94e76273c4 Misc. config tweaks (aesthetic ones + less C strings) 2017-02-25 16:01:17 +01:00
Remi THEBAULT
2c501301d9 adapt config file to use adhoc parser 2017-02-24 23:18:35 +01:00
Rainer Schuetze
e92bb482a2 select configuration group by target triple extracted from the command line 2016-04-30 12:28:02 +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
9956d326f0 Implement -conf command-line switch for LDC2 and LDMD2 2015-10-07 02:27:49 +02:00
Martin
1670323ebb Refactor argv[0] management, related path searches etc. 2015-09-27 20:47:14 +02:00
kai
2e7a6d43ac Use C version of libconfig.
libconfig++ is only a thin wrapper around libconfig. Because of the
use of exception handling this wrapper requires more memory than needed.
As we have our own wrapper (ConfigFile) just drop the C++ stuff.
2014-10-12 21:59:24 +02:00
kai
8fb0b12e9e Replace llvm::sys::Path with llvm::SmallString in configfile.cpp.
Also adds some required functions for LLVM 3.4.
2013-06-29 15:10:30 +02:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
Eldar Insafutdinov
a8398d64e8 Moved configfile to the driver 2012-04-03 21:18:16 +01:00
Renamed from gen/configfile.h (Browse further)