Commit graph

152 commits

Author SHA1 Message Date
Nicholas Wilson
63f0644b49
Use typed load in asmstmt.cpp (#4102) 2022-09-03 09:27:58 +08:00
Martin Kinkelin
b7b8e59043 Upgrade frontend & libs to v2.100.0-beta.1+ (dlang/dmd@c0cff59c79) 2022-04-26 23:01:13 +02:00
Martin Kinkelin
2b6177fdc9 Fix LLVM 14 complaints about missing element type attributes for indirect asm operands 2022-03-30 15:00:07 +02:00
Martin Kinkelin
7b6810b01b Fix LLVM 13 deprecation messages during build 2022-02-26 19:15:46 +01:00
Martin Kinkelin
4bd8dcd91b Adapt to new TOK and EXP enum classes 2022-02-16 20:52:07 +01:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
369cfd13ce Adapt to TY enum class 2021-09-07 16:51:19 +02:00
Martin Kinkelin
a268b23469
Don't enforce the frame pointer for functions with GCC-style inline asm (#3685)
As GDC doesn't either.
2021-04-04 19:25:55 +02:00
Martin Kinkelin
69269f3bd9 Refactor IRScope handling
Replace the stack of IRScopes, each with its own IRBuilder, by directly
tampering with the state of a single IRBuilder.

This seems like the most feasible way to account for a breaking change
in LLVM 11, disallowing IRBuilder from being copied.
2020-09-26 01:04:50 +02:00
Martin Kinkelin
58df385de7 dmd-testsuite: Adapt a few tests for non-x86 archs
And improve the error message for DMD-style inline asm and non-x86
targets.
2020-05-03 17:39:31 +02:00
Martin Kinkelin
4629f156a7 Extend inline asm diagnostics by D source location 2020-02-25 02:31:58 +01:00
Martin Kinkelin
ebd359273d druntime: Switch from __asm to GCC-style asm syntax 2020-02-25 01:19:25 +01:00
Martin Kinkelin
c55fcfe3f3 Refactor GccAsmStatement_toIR into its own .cpp module 2020-02-15 23:58:14 +01:00
Martin Kinkelin
a25a576bba GCC-style asm: Support indirect output operands 2020-02-15 23:58:14 +01:00
Martin Kinkelin
9583f9bff9 GCC-style asm: Support multiple output operands 2020-02-15 23:58:14 +01:00
Martin Kinkelin
298898a0a7 Add support for GCC/GDC-style inline asm syntax 2020-02-15 23:58:13 +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
08b3ee3895
Refactoring: Modernize some legacy asmstmt code (#3225) 2019-12-20 16:58:19 +01:00
Fangrui Song
637a8af264 Fix -Wunused-variable (#3224) 2019-11-11 20:55:50 +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
fe9b8a124c Streamline LDC front-end diff
Primarily stylistically.
2019-04-13 20:58:05 +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
e0611c3114 Adapt to now subtyped class AsmStatement 2018-08-18 00:33:48 +02:00
Martin Kinkelin
52d8c78efb
Fix inline asm label naming issue in overloaded functions (#2694)
Fixes #2667.
2018-05-10 21:17:34 +02:00
Johan Engelen
f82d6fe953
Clarify that error messages relate only to DMD-style asm. (#2633) 2018-03-30 18:20:15 +02:00
Johan Engelen
92d8062836 Fix a few compiler warnings (#2248)
* Remove default label in switch which covers all enumeration values.

This fixes the warning "default label in switch which covers all enumeration values". We will already get a warning when _not_ all enumeration values are covered.
This is the last warning left on OSX/Clang, so with this change, we can build with -Werror.

* Fix warning: enumeral and non-enumeral type in conditional expression

* Fix warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 5

* "fallthrough" is recognized by the compiler warning system
2017-08-04 12:05:36 +02:00
Martin
383c2d3a59 Range-ify usages of front-end Arrays 2017-06-04 00:29:44 +02: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
Martin
e711deac1b Refactor basic block construction and revise BB order 2016-08-06 22:04:41 +02:00
Martin
039560bd83 Introduce DtoRVal/DtoLVal convenience functions
No functional changes intended.
2016-06-13 22:30:13 +02:00
Kai Nacke
eb394bf221 Merge remote-tracking branch 'origin/ltsmaster' into mastertest 2016-03-08 20:20:24 +01:00
Kai Nacke
56cf6b9d4f Increment counter for output constraints.
This fixes issue #1292.
2016-03-06 00:06:48 +01:00
Kai Nacke
24adf155ff Revert "Revert "Merge branch 'ltsmaster'""
This reverts commit 1653911600.
2016-03-03 21:12:53 +01:00
Kai Nacke
1653911600 Revert "Merge branch 'ltsmaster'"
This reverts commit dcb781004b, reversing
changes made to 3c6f09faf0.
2016-03-03 13:14:39 +01:00
Kai Nacke
dcb781004b Merge branch 'ltsmaster' 2016-03-03 07:50:17 +01:00
Dan Olson
7cba1a45af Fix non-x86 __traits compiles for dmd inline asm
Allow asm statement to be tested in a __traits compiles check without
fataling for those targets that don't support dmd style inline asm.
Without this, a compile could exit(1) without any messages.

Fixes compilable/test12979b.d and runnable/testsafe.d on ARM.
2016-02-25 19:52:23 +00: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
David Nadlinger
9df487edff gen/ir: clang-tidy the world 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
9e194bfe2c Refactor store-to-new-alloca code occurrences. 2015-09-25 17:12:42 +02:00
David Nadlinger
4bcae9731a The big catch/finally rework, part 2
Now with *almost* working EH codegen. Does not compile Phobos yet
because we run into the "instruction does not dominate all uses"
issue when an r-value result of toElemDtor is used and we need to
run cleanups in between. Should easily be fixed by promoting those
values to allocas.

Most of the changes outside of ir/irfunction.{h, cpp} are just
because CreateCallOrInvoke moved locations. I took the
opportunity to also make use of the different arg count
overloads where possible.
2015-08-19 19:56:39 +02:00
David Nadlinger
4236ae9ce5 The big catch/finally rework, part 1
Never generates any landing pads or invoke instructions right now
for simplicity. The code for emitting them will be added back in
the next step.

The "after..." blocks without any precedessors remain for now, as
we need a clean way to suppress any codegen for that block (but
not new blocks, which might resolve labels) before tackling that
one.

Builds druntime/Phobos on OS X x86_64 (albeit without EH, of course).
2015-08-19 19:56:39 +02:00
David Nadlinger
bfc20df4c8 Remove IRScope::end
Specifying the basic block before which to insert the new one
is not mandatory when calling llvm::BasicBlock::Create. This
was the only use of the tracked "end" block. The concept was
phony anyway because there is no single "end" to a scope with
unwinding and so on.

For prettying up the IR, it is possible to change the order
of basic blocks using move{Before, After}().
2015-08-19 19:56:39 +02:00
Kai Nacke
45ec6a0512 Merge branch 'master' into merge-2.067 2015-06-04 19:07:28 +02:00
Kai Nacke
0f86de548c DebugInfo: EmitStopPoint() now has a Loc parameter. 2015-06-04 19:04:23 +02:00
Kai Nacke
1036edc266 Merge branch 'master' into merge-2.067 2015-05-17 13:06:46 +02:00
Kai Nacke
76f543d0a7 Fix another sprintf warning 2015-05-16 18:56:38 +02:00
Kai Nacke
79699c3261 CompoundAsmStatement checks for @safe.
Fixes failure in fail_compilation/deprecate12979.d
2015-04-10 13:16:15 +02:00