Commit graph

101 commits

Author SHA1 Message Date
Nicholas Wilson
a3eae7a815
Fix compilation with LLVM16 (#4176) 2022-09-16 11:09:41 +08:00
Nicholas Wilson
d528554535
Remove getContainedType from driver/toobj.cpp (#4149) 2022-09-13 18:44:14 +08:00
Martin Kinkelin
bdef01e7cc Raise min LLVM version to 9.0 2022-04-25 23:11:48 +02:00
Johan Engelen
c517ce9d12
Improve ftime-trace implementation. (#3797)
* Improve ftime-trace implementation.
- Rewrite ftime-trace to our own implementatation instead of using LLVM's time trace code. The disadvantage is that this removes LLVM's work from the trace (optimization), but has the large benefit of being able to tailor the tracing output to our needs.
- Add memory tracing to ftime-trace (not possible with LLVM's implementation)
- Do not output the sum for each "category"/named string. This causes the LLVM output to be _very_ long, because we put more information in each time segment name. Tooling that processes the time trace output can do this summing itself (i.e. Tracy), and makes the time trace much more pleasant to view in trace viewers.
- Use MonoTime, move timescale calculation to output stage, 'measurement' stage uses ticks as unit
- Fix crash on `ldc2 -ftime-trace` without files passed.
2021-08-14 14:11:22 +02:00
Martin Kinkelin
bfa3cead08 Upgrade frontend & libs to early v2.097.0 (dlang/dmd@cb0457daf3) 2021-05-29 00:19:22 +02:00
Hiroki Noda
a8d98fc054
Use new OpenFlags enumeration (#3710)
[This](https://reviews.llvm.org/D101506) drops old deprecated
OpenFlags support.
OF_{Append,None,Text} has been available since LLVM 9.

- https://reviews.llvm.org/rG1f67a3cba9b09636c56e2109d8a35ae96dc15782
2021-05-01 00:43:45 +00:00
Johan Engelen
29245c8255
Add --ftime-trace functionality. (#3624)
This uses LLVM's TimeProfiler functionality, such that LLVM's work is traced in the same profile (optimization and machine code gen).
Functionality is meant to be identical to Clang and LLD's --ftime-trace.
2020-12-28 17:05:04 +01:00
Hiroki Noda
3268e4668a
[Trivial] refactor doLTO in writeModule (#3506) 2020-07-15 10:36:01 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +02:00
Roberto Rosmaninho
6274217c39
Add -output-mlir and prepare for MLIR emission (#3313) 2020-05-22 12:31:24 +02:00
Martin Kinkelin
2d86e49fba
Finalize support for LLVM 10 (#3323) 2020-02-14 17:53:40 +01:00
Fangrui Song
0a007a55f8
Fix StringRef conversion for LLVM 11 (777180a32b61070a10dd330b4f038bf24e916af1) (#3305) 2020-02-01 02:52:35 +01:00
Nicholas Lindsay Wilson
5b7d706ea6 Fix future versions of LLVM9 2019-12-09 09:49:27 +08:00
Nicholas Lindsay Wilson
f5b81cd731 Fix CGFT 2019-12-09 09:48:55 +08:00
Martin Kinkelin
030123410a Add support for LLVM 9.0.0
Including some of Nicholas' fixes in #3144.
2019-09-25 03:42:18 +02:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Nicholas Wilson
f5ae8311cd
Adapt to using SPIR-V support as an external library (#2935)
Adapt to using SPIR-V support as an external library.
2019-01-18 14:51:48 +08:00
Martin Kinkelin
5c24f60cf9
Raise min LLVM version to 3.9 (#2872) 2018-10-15 22:31:59 +02:00
Ivan Butygin
21972bbc49
Clone module if we are writing both assembly and object (#2847) 2018-09-09 18:47:47 +03:00
Johan Engelen
95b454d2bd Fix compilation with current LLVM trunk. (#2722) 2018-06-03 01:30:27 +02:00
Martin
2faf46962f Emit both object file and LTO bitcode file via -output-o -output-bc -flto=... 2018-04-16 22:13:21 +02:00
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