Commit graph

80 commits

Author SHA1 Message Date
Johan Engelen
aa979e6e90 fix LLVM7.0 build (#2578) 2018-02-19 00:07:01 +03:00
Johan Engelen
9ff79e556a
Small fix to fix compiler warning (gcc bug?) (#2564)
On the ARM scaleway buildbot, I saw this warning:
```
/var/lib/buildbot/slaves/scaleway/armv7_builder/build/driver/toobj.cpp: In constructor ‘{anonymous}::AssemblyAnnotator::AssemblyAnnotator(const llvm::DataLayout&)’:
/var/lib/buildbot/slaves/scaleway/armv7_builder/build/driver/toobj.cpp:152:56: warning: a temporary bound to ‘{anonymous}::AssemblyAnnotator::DL’ only persists until the constructor exits [-Wextra]
   AssemblyAnnotator(const llvm::DataLayout &dl) : DL{dl} {}
```
http://buildbot.ldc-developers.org/builders/armv7_builder/builds/3087/steps/make/logs/stdio

Looks like this gcc bug: https://stackoverflow.com/questions/25561387/spurious-warning-about-binding-temporary-to-reference-member-in-constructor

So let's just use old-style initialization, and we should be good.
2018-02-08 22:30:36 +01:00
Johan Engelen
e2a5fba876
Remove one use of gDataLayout. (#2525) 2018-01-22 21:34:41 +01:00
Martin
27deb2ff8c Get rid of obsolete gen/llvmcompat.h
Not needed anymore since C++11.
2018-01-12 20:20:47 +01:00
Nicholas Wilson
baf3654868
Fix compilation with most recent LLVM (#2428)
Fix LDC compilation with latest LLVM (Mostly renaming and moving headers).
2017-12-03 18:25:43 +08:00
Martin Kinkelin
b67232a886
IR annotations: Let LLVM print debug locations (#2377)
Which also includes the file.
2017-11-28 21:14:19 +01:00
kinke
3b2f6bccdb Don't use -m32/-m64 for external ARM assembler (#2264)
And merge the two out-of-sync copies for adding gcc target flags. The flag
was omitted for gcc as linker already, but not for gcc as external assembler.
2017-08-12 18:17:03 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Nicholas Wilson
40de53d095 Fix LTO for LLVM 5.0 (#2158)
Remove micro-optimization that breaks LTO on LLVM 5.0.
2017-06-06 08:34:35 +02:00
David Nadlinger
747f7a3dfa clang-format files touched in d01a91f7 [nfc]
Some housekeeping on files that recently saw large changes anyway.
2017-05-24 21:35:40 +01:00
Nicholas Wilson
ae6ff33fc1 [dcomptue] codegen (#2126)
* code generation

* simplify logic

* apply clang-format

* Undo completely inane choice by clang-format

* Guard the use of the command line args.
2017-05-24 08:55:32 +08:00
Martin
d01a91f755 Allow multiple occurrences for almost all command-line flags
Except for `-sanitize` and `-cache-prune*`.
2017-05-23 20:53:57 +02:00
Rainer Schuetze
ae7f1a7f2c fix buildinng against LLVM master (#2111) 2017-05-16 20:43:29 +02:00
Martin
95c1d38e2e Integrate module gen/programs into driver/tool 2017-03-13 23:31:32 +01:00
Martin
cab165f3d8 Set up the MSVC environment in a more flexible way
For invoking MS tools such as link.exe and lib.exe, which require
compatible PATH, LIB, LIBPATH etc.

We previously wrapped the invokation of the tool with a batch file taking
care of setting up the environment and then calling the actual tool.

I changed this to first invoke another batch file setting up its
environment and then dumping all environment variables to a file. LDC then
parses this file and updates its own environment variables. Later spawned
child processes then inherit the updated environment, and the tools will
be located by LLVM in updated PATH.

This allows LDC to keep track of the used Visual C++ installation (and
could so set up additional runtime libs required since VS 2015, something
we would have needed some time back when we still supported VS 2013). It's
also required as a prerequisite for integrating LLD as in-process linker
on Windows.

I quickly looked into the option of setting up the environment manually,
but the MS batch files are full of quirks, mixtures of registry and
file-system lookups, checking for existence of misc. headers to filter out
bogus installations etc. With VS 2017, there's nothing in the registry at
all anymore (at least for the Build Tools); MS expose a COM interface for
querying the VS installer... But at least they still provide the batch
files.
2017-03-13 00:36:45 +01:00
Johan Engelen
c1c1fcb027 Add PGO data to the ThinLTO module summary (LLVM >= 4.0). (#1892) 2016-11-23 12:53:55 +01:00
Johan Engelen
de67daff63 Merge pull request #1881 from rainers/fix_llvm40_4
fix build against LLVM master
2016-11-13 15:14:35 +01:00
Rainer Schuetze
99d455226e fix build against LLVM master: llvm/Bitcode/ReaderWriter.h has been split and renamed 2016-11-13 11:05:53 +01:00
Martin
13218366b4 Don't necessarily enforce file extension of .bc, .ll, .s files
Use the output filename (-of or inferred) directly if a single file is
emitted per compiled module.

Fixes issue #1843.
2016-11-09 20:34:22 +01:00
Johan Engelen
bb24fb2816 Add LTO support (full and thin), with -flto=thin|full.
LTO needs linker support: I am only aware of support on OS X and Linux (through the LLVMgold plugin).

Resolves #693
2016-11-09 14:30:13 +01: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
Martin
6c03a3d725 Streamline output filenames and -singleObj behavior some more with DMD 2016-09-07 09:53:35 +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
acdcc4a8c1 Merge branch 'master' into merge-2.069 2016-02-13 20:12:17 +01:00
Martin
241dc9135f Fix error message formatting 2016-02-02 22:31:54 +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
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
David Nadlinger
0647f49aa5 driver: Mention size of allocas, do not repeat obvious types
The latter is particularly helpful for readability of code with
deeply nested templates, i.e. huge type names.
2015-09-15 18:15:49 +02:00
Kai Nacke
bb32dcd6de Add new hidden option -no-integrated-as.
This is useful if the integrated assembler causes problems.

Also adds an architecture to the assembler command line in case
of compiling for MIPS.
2015-05-25 22:54:56 +02:00
Kai Nacke
90f7debeb2 Remove a wrong space in argument. 2015-05-24 19:42:59 +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
6ab801361a LLVM 3.7: Debug info classes changed again.
The solution is to use a typedef to hide the differences in most cases.
2015-04-30 22:43:31 +02:00
Martin
fdd449c4e5 LLVM 3.7: Metadata refactoring continues 2015-04-22 12:17:42 +02:00
Kai Nacke
7a3ef8323b LLVM 3.7: More metadata and output stream changes. 2015-04-16 07:19:28 +02:00
Kai Nacke
76a34f2e35 LLVM 3.7: More metadata changes 2015-04-09 22:14:12 +02:00
kai
f8bddb3e99 Add AssemblyAnnotationWriter.
Outputs debug information as comments in .ll file.

Provided by Trass3r.
2015-04-03 15:53:06 +02:00
Kai Nacke
1b7bca65b2 LLVM 3.7: Include of <llvm/Support/Path.h> is required 2015-03-25 19:05:12 +01:00
kai
6cb787aa6d LLVM 3.7: Fix yet another DataLayoutPass reference. 2015-03-06 21:18:54 +01:00
unknown
e56ef8b86e copy paste error fix 2015-02-16 15:27:19 -08:00
unknown
674b614807 Update of PassManager interface to match the corresponding deprecation in LLVM's trunk for 3.7 2015-02-16 15:11:42 -08:00
kai
4de1414c41 LLVM 3.7: Use new TargetMachine.getTargetIRAnalysis() analysis pass.
This replaces the TargetMachine.addAnalysisPasses() method.
2015-02-04 07:28:50 +01:00
kai
b8aed4538a Another set of changes for AIX.
AIX uses the XCOFF format which is not supported by LLVM.
An external assembler must be used.
2014-11-16 06:11:27 +01:00
kai
bef163f559 Fix latest LLVM 3.6 changes 2014-09-19 06:49:34 +02:00
kai
1609cb4714 Enable integrated assembler on MinGW with LLVM 3.5 or later 2014-09-04 06:36:31 +02:00
kai
d6569c496e LLVM 3.6 fix: stream constructor now takes std::error_code instead of std::string 2014-08-28 07:55:48 +02:00
kai
df0d302d5b Fix MingW build with LLVM 3.5
Starting with LLVM 3.5 it is better/required to use Triple.isWindowsGNUEnvironment().
Reported by Daniel N.
2014-08-26 18:57:12 +02:00