Commit graph

134 commits

Author SHA1 Message Date
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
kai
0551f613e4 Remove last traces of AsmBlockStatement 2015-03-01 17:33:08 +01:00
kai
f61327c149 Replace AsmBlockStatement with CompoundAsmStatement. 2015-03-01 16:40:44 +01:00
kai
a65f001356 Remove now unused function DtoAggrPairSwap().
The function was only used in the old ABI implementation.
2015-02-25 07:52:06 +01:00
David Nadlinger
e4aa92deb3 Get rid of more superfluous casts with DMD arrays.
There are still a few more left.
2014-11-16 08:00:17 +01:00
Alexey Prokhin
ac2524d129 Remove old unused declarations 2014-10-05 16:55:23 +04:00
Alexey Prokhin
a0b9f95869 There is no real need in FuncDeclaration::labmap 2014-10-05 16:08:35 +04:00
Alexey Prokhin
d9189acbc4 Move toElem/toConstElem to visitors 2014-08-27 16:22:02 +04:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
Alexey Prokhin
e0b9048998 Rename 'enclosingFinally' to the original 'tf' to minimize differences with mainstream 2014-07-11 18:06:58 +02:00
kai
2b6dbb03f4 Add IF_LOG to more logging statements.
Evaluating arguments which call toChars() or toPrettyChars() are much more expensive then checking Logger::enabled().
2014-06-26 06:54:38 +02:00
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
kai
c28c7fb134 Introduce a debug info builder.
Moves all code from todebug into a new class.
Also caches the compilation unit in order to fix a LLVM 3.4 compile error.
2013-07-29 00:04:08 +02:00
David Nadlinger
292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
David Nadlinger
5b5ad8e0f7 Add some no-op virtual destructors to silence GCC warning. 2013-06-12 20:16:05 +02:00
David Nadlinger
5742a0219c Fix inline asm labels in template functions.
This is a giant kludge to avoid a redesign of the inline asm
handling code. I'd be glad if somebody came up with a better
solution.

GitHub: Fixes #340.
2013-05-11 21:01:24 +02:00
David Nadlinger
8b9deecf34 Remove dead code. 2013-05-11 20:12:25 +02:00
David Nadlinger
bc09ceae18 Remove useless log delimiters, we do have log scopes. 2013-03-17 02:00:42 +01:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00