Commit graph

50 commits

Author SHA1 Message Date
Fangrui Song
0a007a55f8
Fix StringRef conversion for LLVM 11 (777180a32b61070a10dd330b4f038bf24e916af1) (#3305) 2020-02-01 02:52:35 +01:00
Martin Kinkelin
26673c174f
Refactoring: Replace Expression::op check followed by static cast to Expression::is<ExpressionType> (#3141)
This may negatively impact performance, as the (final, i.e.,
non-virtual) Expression::is... family is implemented in D and not
available inline in the C++ headers.
2020-01-15 12:54:05 +01:00
Martin Kinkelin
1f5c442519 Revise recent adaptations to frontend refactorings 2020-01-06 17:01:31 +01:00
Martin Kinkelin
4ac7f0554b Adapt to frontend refactorings 2019-12-22 16:29:45 +01:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Martin Kinkelin
cc336d6df1 Support generic ldc.attributes.llvmAttr UDAs for function parameters 2019-03-31 20:59:54 +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
7776c4081b Upgrade frontend & libs to v2.083.0-beta.1 2018-10-20 16:19:46 +02:00
Martin Kinkelin
5c24f60cf9
Raise min LLVM version to 3.9 (#2872) 2018-10-15 22:31:59 +02:00
Martin Kinkelin
7224de5e0c Upgrade LLVM to v7.0.0 2018-09-26 17:21:35 +02:00
Martin Kinkelin
c10cf86403 Add @naked UDA
Adding the LLVM `naked` function attribute and disabling LDC's
prologue/epilogue too.
2018-07-27 22:53:55 +02:00
Martin Kinkelin
f2c718d7a4 Make generic llvmAttr("name") UDA support non-string attributes too
As preparation for a trivial addition to ldc.attributes, probably more
to follow over time:

enum naked = llvmAttr("naked");
2018-07-12 01:46:25 +02:00
Ivan Butygin
cbeb2b45d6
@dynamicCompileEmit attribute (#2747) 2018-06-26 21:59:02 +03:00
Johan Engelen
66ad3791ef
Add the ldc.attributes.assumeUsed attribute corresponding to "attribute((used))” in GNU C. (#2457)
The attribute adds the symbol to `llvm.used`.
2017-12-28 16:29:46 +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
Ivan
33c6cbb807 Renaming 2017-11-09 21:29:32 +03:00
Ivan
eb370e1e6a Rename attributes 2017-11-09 21:05:45 +03:00
Ivan
044dd7bc9d Fix typo 2017-11-02 20:22:52 +03:00
Ivan
a6d788cdb5 Set "target-cpu" and "target-features" function attributes to jit host except when they are set explicitly by user 2017-10-19 19:06:04 +03:00
Ivan
dc78564bf4 Merge remote-tracking branch 'origin/master' into runtime_compile_v5 2017-10-14 12:28:32 +03:00
Ivan
42f283c221 D dynamic compilation support 2017-08-27 17:42:55 +03:00
Martin
2616261fd2 Revise all LDC-specific errors/warnings/deprecs and insert backticks
For DMD's new syntax highlighting. I grepped in all .{h,cpp} files only.
2017-08-03 22:53:49 +02:00
Nicholas Wilson
69ad69e872 [dcomptue] semantic analysis & lit tests (#2143)
* CI & semantic analysis

* semantic and codegen tests
2017-05-29 16:02:17 +08:00
kinke
151e83dc6b Fix C++ warnings (#2140) 2017-05-26 13:45:15 +02: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
Rainer Schuetze
ae7f1a7f2c fix buildinng against LLVM master (#2111) 2017-05-16 20:43:29 +02:00
Nicholas Wilson
9a3cb2b41e Pooled IDs (#2116)
Use pooled identifiers for magic UDAs and dcompute. Fixes #2011
2017-05-16 17:10:41 +08:00
Johan Engelen
bc119d453b Add specific warning for @fmf("contract") when it's not supported by LLVM 2017-04-20 22:55:08 +02:00
Johan Engelen
9e9ff54ad6 Implement @ldc.attributes.llvmFastMathFlag("contract") magic UDA.
Resolves issue #2059
2017-04-20 22:55:08 +02:00
Johan Engelen
9e394e4f99 Fix LLVM 5.0 build. (#2050)
llvm::AttributeSet was renamed to llvm::AttributeList
2017-03-29 22:26:17 +02:00
Martin
03d59b7b96 Merge branch 'master' into merge-2.072
Conflicts:
	runtime/CMakeLists.txt
2017-02-07 20:20:38 +01:00
Johan Engelen
f0754250dc To check magic LDC UDAs parameter types, convert them to their basetype first. (#1994)
With this, you can check enums with Type::tint32, instead of constructing the enum type. For example: `checkStructElems(sle, {Type::tint32})` for this UDA:
```
enum E {a,b,c};
struct exampleUDA
{
   E e;
}
```
2017-02-03 19:51:37 +01:00
Martin
dca21939e1 Merge 2.072.2 front-end
The part needing most attention was ddmd.root.ctfloat, ddmd.target (incl.
gen/target.cpp) and ddmd.builtin. The front-end is now prepared for
elaborate compile-time floating-point types to allow for proper cross-
compilation.

This version still uses the host's `real` type for compile-time reals,
except for MSVC hosts, which still use 64-bit doubles (when compiled with
DMD host compiler too).

Some other changes:

* semantic*() of Statements extracted from statement.d to statementsem.d
* mangle() -> mangleToBuffer()
* Identifier::string -> toChars()
* Token::float80value => floatvalue
* Dsymbol::isAggregateMember() => isMember()
* BoolExp is no more
* ddmd.root.ctfloat: LDC-specific CTFE builtins
2017-01-29 15:48:03 +01:00
Ivan Butygin
a26bfc1223 Refactor code to hide direct IrFunction->func usage and add convenient functions (#1911) 2017-01-17 22:40:32 +01:00
Johan Engelen
a1de24d837 Implement the @allocSize magic UDA. (#1610) 2016-12-19 11:38:16 +01:00
Johan Engelen
fd73375f68 Refactoring of UDA code (from dcompute branch) [NFC] (#1877)
Also see PR #1800 .
2016-11-13 11:41:23 +01:00
David Nadlinger
8a9c7cf463 gen: Remove some redundant elses [nfc] 2016-09-03 14:38:10 +01:00
David Nadlinger
11572489d5 clang-format again some files touched in the next commits [nfc] 2016-09-03 00:52:00 +01:00
Johan Engelen
c6ba2dc29b Fix a few clang warnings. [NFC] 2016-07-27 20:21:02 +02:00
Johan Engelen
3469151500 Implement @optStrategy UDA.
Resolves #1549.
2016-07-24 16:05:24 +02:00
Johan Engelen
108acee6b7 Add @fastmath and @llvmFMF LDC magic attributes to enable aggressive math optimizations. 2016-05-22 20:06:57 +02:00
Johan Engelen
b25b7966cc Pass IrFunction* to applyFuncDeclUDAs instead of irfunc->func (llvm::Function*) such that LDC's UDAs can set function properties that are not part of llvm::Function. 2016-05-22 19:56:56 +02:00
Johan Engelen
4b108025ef Add @ldc.attributes.llvmAttr.
Partly resolves #1438
2016-04-18 13:50:03 +02:00
Johan Engelen
15aebef5be Merge branch 'master' into merge-2.070 2016-03-29 11:48:14 +02:00
Johan Engelen
69825a6fb9 Add the @ldc.attributes.weak linkage attributes for global symbols. 2016-03-27 22:08:23 +02:00
David Nadlinger
90c213b52e Adapt to changed StringExp API
Not tested yet. There is also quite a bit of potential for
further cleanup of the glue layer string manipulation code.
2016-02-14 19:35:40 +01:00
Johan Engelen
f29aec2072 Implement the @ldc.attributes.target UDA. 2016-01-04 02:04:25 +01:00
Johan Engelen
8d078f3bd8 Implement @ldc.attributes.section("...") for functions. 2015-12-31 12:15:40 +01:00
David Nadlinger
65dfd6912c uda: Handle symbols with null ModuleDeclaration 2015-11-04 14:50:49 +02:00
David Nadlinger
4f2f1f87e5 Implement @ldc.attributes.section(...) for variables
This now uses actual struct literals for attributes that can be generated
by arbitrary CTFE expressions. This should allow for quite a bit of
flexibility when targeting multiple compilers.
2015-11-03 21:33:05 +02:00