Commit graph

89 commits

Author SHA1 Message Date
Martin
cecb040ff0 Add command-line option -transition=safe
Also fix `ldmd2 -transition=?` regression and don't display an error
message when invoking LDMD without command-line args.
2017-02-12 18:47:53 +01:00
Martin
84e74e3932 Rework LDMD command-line translation and add -verrors-spec
Simplify LDMD quite a bit by translating the few different command-line
options directly in-place. This puts some more stress onto LDC's
command-line parsing, especially due to multiple occurrences of a single
Boolean option (e.g., '-o-') or mixtures of `-m64` and `-m32` etc. for
dmd-testsuite.

Also add new command-line option `-verrors-spec` showing gagged errors
(DMD's equivalent is `-verrors=<spec|limit>`) and sync the usage text with
DMD. LDMD now also recognizes `-h` (and `/?` on Windows).
2017-02-06 01:17:09 +01:00
Martin
29d52f0362 Sync command-line options and descriptions with DMD 2016-12-20 22:08:23 +01:00
LemonBoy
62a2252028 Implement the betterC switch like DMD does.
Namely, don't emit the ModuleInfo.
2016-11-25 17:40:35 +01:00
Martin
44e7511e46 LDMD: Prevent object file collisions when creating static libs
Approximate DMD behavior by naming the temporary object files uniquely
and, if successful, removing all generated object files.

Executables and shared libs imply -singleobj => no collisions.
2016-10-15 23:54:22 +02:00
Martin
8276269ab1 Create static libs in -od directory for LDMD only
Let LDC treat relative output paths as relative to the current working
directory again (as it always used to until a few weeks ago). It's more
intuitive and avoids breaking build systems/scripts using LDC directly.

Only LDMD continues to prepend the -od directory to the relative output
path, for DMD compatibility.

Fixes issue #1819.
2016-10-14 21:47:27 +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
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
36edf4f200 Inline-initialize LDMD params 2016-08-27 20:49:58 +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
Rainer Schuetze
a2c5f15955 implement -transition=* 2016-04-20 23:03:20 +02:00
Johan Engelen
72b5ab7642 Instead of using the C++-linker, use the D compiler to link LDC2 and LDMD.
This removes the need for the CMake logic to figure out what linker flags to pass the C++linker to link D code (50 lines of flaky cmake script).
2016-03-25 12:31:01 +01:00
Johan Engelen
4c95b43286 Fix #1344. Add --version to ldmd2. 2016-03-07 17:48:09 +01:00
Johan Engelen
21a2be19fb Mark -property switch as deprecated. Add deprecation message for -noboundscheck.
The deprecation message for -property is handled by the DDMD frontend.
2016-02-10 10:30:18 +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
2d959ea540 Make use of C++11 range-based for
Should be available now that support for LLVM < 3.5 has been dropped.
2015-11-01 14:49:04 +01: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
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
eb570a8c60 Add new command line switch -dip25 2015-04-09 23:23:48 +02:00
kai
e0b79e015d More ldmd changes
- remove -nofloat (was removed from dmd, too)
- add help text for -dw and -de
- add options -vcolumns and -vgc
2015-04-09 20:59:37 +02:00
Kai Nacke
9ca929802b Implement -allinst, -d, -de and -dw in ldmd. 2015-04-09 20:20:47 +02:00
Kai Nacke
8e7637c59e Fix merge error in ldmd 2015-04-08 22:45:42 +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
fe6397f336 Add dummy -conf option to ldmd 2015-03-24 19:51:09 +01:00
David Nadlinger
8000ae3c7d ldmd: Correctly emit -m32.
GitHub: #824.
2015-01-13 23:42:37 +01:00
kai
6e72ecbc4f LLVM 3.6: Name and signature of FindProrammByName changed. 2014-11-06 07:54:45 +01:00
kai
42905bc462 Implement missing -boundscheck switch in ldmd.
This was reported in the newsgroup by Daniel N.
2014-10-25 19:05:15 +02:00
Alexey Prokhin
a81c6c6f48 Add -enable-color/-disable-color switches 2014-09-06 20:30:19 +04:00
Andreas Hollandt
7524bff42b fix LLVM 3.5 regression introduced by 0d168ed 2014-07-21 18:29:31 +02:00
kai
0d168ed570 Fix LLVM 3.5 build.
llvm::errc::success was removed during transition to std::errc.
2014-06-06 12:14:50 +02:00
kai
86ecc4160a Fix semantic changes in LLVM 3.5. 2014-05-07 06:59:15 +02:00
kai
36ad7e8e2c ldmd should not pass -singleobj to ldc2 if a static lib is build.
dmd has the same behaviour. This fixes issue #579.
2014-02-05 06:52:07 +01:00
Kai Nacke
1f204ba9c5 Fix a c++11 issue 2014-01-03 15:01:39 +01:00
David Nadlinger
883fd768d3 LDMD: Properly initialize Params::targetModel. 2013-10-21 13:55:49 +02:00
David Nadlinger
a2a3e400c9 LDMD: Avoid unitialized data.
Found using Valgrind.
2013-10-09 19:50:28 +02:00
David Nadlinger
7b8a85a8df Fix prependMainExecutablePath for LLVM 3.4. 2013-10-08 17:56:10 +02:00
David Nadlinger
ca82589e25 Merge pull request #482 from klickverbot/ldmd-create-directory
LDMD: Create output directories if they do not exist.
2013-10-03 19:21:23 -07:00
David Nadlinger
7f20de16cf LDMD: Create output directories if they do not exist.
There might be other cases using the LLVM output code as well
that I haven't handled here, but the changes are sufficient to
make LDC work with rdmd on Linux.

GitHub: Fixes #480.
2013-10-02 18:09:47 +02:00
David Nadlinger
c58c833be9 Trivial indentation fix. 2013-10-02 18:02:41 +02:00
David Nadlinger
cf18366c46 LDMD: Ignore -quiet, it is the default.
GitHub: Fixes #472.
2013-09-21 18:31:14 +02:00
David Nadlinger
b3d8c497e1 Remove leftover D1-only comment. 2013-09-07 22:14:07 +02:00
kai
399a0396d2 Fix for issue #467 and partial fir for issue #455 2013-09-06 22:46:06 +02:00
kai
ecf40bef59 Reverting last commit as it breaks a test 2013-09-06 22:30:02 +02:00
kai
1ce6e18a6e Fix for issue #467 2013-09-06 21:58:50 +02:00