Commit graph

95 commits

Author SHA1 Message Date
Martin Kinkelin
8fd69da8fb Make all DtoGEP helpers use implicit inbounds
Single functional change: always emit inbounds when computing the base
pointer of a SliceExp.
2019-09-10 22:36:25 +02:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Martin Kinkelin
8c268bf97a
Revise naked asm headers (#3067)
Using clang 8.0.0 as reference. This should silence the warnings in
issue #3066, see https://reviews.llvm.org/rG1cea644114e367c7ed3a4ea3d2da571ec3ed56f7
(from 2015) for some context wrt. that.
2019-05-08 20:51:13 +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
6c2e2c9153 Micro-aid in diagnostics 2018-08-18 00:33:48 +02:00
Martin Kinkelin
e0611c3114 Adapt to now subtyped class AsmStatement 2018-08-18 00:33:48 +02:00
Martin Kinkelin
306bdb7dfa Allow all linkages for implicit ABI returns of naked functions
And revise the Win64 ABI return rules in this function.

Required to make dmd/root/longdouble.d (mostly extern(C++)) compile.
2018-06-21 03:38:02 +02:00
Martin Kinkelin
db7aa1c87a
MSVC: Support exporting naked functions (#2651)
This fixes #2648.
2018-04-13 20:35:49 +02:00
Martin Kinkelin
ecbc36d372
Win32: Add extra underscore for mangled names of D symbols (#2598)
DMD 2.079 introduces this breaking ABI change. Just like on 32-bit OSX,
the mangled names of D symbols now include the platform-specific
underscore prefix.
2018-04-02 02:27:09 +02:00
Martin
27deb2ff8c Get rid of obsolete gen/llvmcompat.h
Not needed anymore since C++11.
2018-01-12 20:20:47 +01:00
Martin
0b28925e9a Win32: Remove extra leading underscore from D symbol mangling
This is compatible with DMD.
2017-10-07 14:06:17 +02:00
Martin
3e554f2bfd Revert "OSX: Make sure T.mangleof matches the final mangle for C++ symbols"
This reverts commit c49464a57e.
2017-09-30 01:04:28 +02:00
Martin
c49464a57e OSX: Make sure T.mangleof matches the final mangle for C++ symbols
By using upstream's Target.prefixName(), which prepends an additional
underscore on OSX/Darwin for C++ symbols.
We then need to prevent LLVM from implicitly prepending a third one.
2017-09-28 20:17:02 +02: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
kinke
151e83dc6b Fix C++ warnings (#2140) 2017-05-26 13:45:15 +02:00
Martin
f5bc81e93b Fix extern(C++) naked functions mangling for Win32 2017-02-07 20:52:37 +01:00
Martin
d14fdf6cac Fix naked functions mangling regression for Win32 2017-02-07 01:25:55 +01:00
Martin
99795b8a57 Quote mangled names of naked functions starting with '?'
Needed for naked extern(C++) functions and MSVC targets, e.g.,
dmd-testsuite's runnable/testinvariant.d (`C13147.test()`).
2017-02-04 22:25:46 +01:00
Johan Engelen
10b85feba4 Merge pull request #1824 from kinke/inplaceIR
Fix in-place construction of structs returned by inline assembly
2016-10-16 12:40:49 +02:00
LemonBoy
399962aa63 Validate the __asm constraints.
Fixes #802.
2016-10-13 15:53:08 +02:00
Martin
7a0bba00d9 Fix in-place construction of structs returned by inline assembly
Fixes #1823.
2016-10-11 22:10:30 +02:00
David Nadlinger
6cc93bc8ba gen/ir: Move function body codegen state into separate class
Previously, the transitory state only needed and valid during
generation of the LLVM IR for the function body was conflated
with the general codegen metadata for the function declaration
in IrFunction.

There is further potential for cleanup regarding the use of
gIR->func() and so on all over the code base, but this is out
of scope of this commit, which is only concerned with those
IrFunction members moved to FuncGenState.

GitHub: Fixes #1661.
2016-08-03 21:07:18 +01:00
Martin
0c0c1ecaf5 Rename DVarValue to DLValue 2016-06-13 22:30:15 +02:00
Martin
963a10b225 Let DValue types handle memory-only types consistently
I.e., disallow memory-only values from being represented as DImValues
and disallow getRVal() for such types instead of returning the address.
2016-06-13 22:30:14 +02:00
Martin
039560bd83 Introduce DtoRVal/DtoLVal convenience functions
No functional changes intended.
2016-06-13 22:30:13 +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
acdcc4a8c1 Merge branch 'master' into merge-2.069 2016-02-13 20:12:17 +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
Rainer Schuetze
1f1295aff8 fix mangling of naked functions for MSVC/x86 2016-01-22 16:05:32 +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
05d45350aa clang-tidy: Add readability-else-after-return 2015-11-02 11:30:40 +02: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
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
0922254dd1 Directly emit IR into same llvm::Module instead of using Linker
GitHub: Fixes #970.
2015-06-14 21:36:35 +02:00
Dmitri Makarov
5ae8ef92cc Fix linking errors of export(cpp) symbols on OSX. 2015-04-05 21:21:29 +02:00
kai
f61327c149 Replace AsmBlockStatement with CompoundAsmStatement. 2015-03-01 16:40:44 +01:00
Johan Engelen
5ff1e64757 Do not add leading underscore to naked asm functionname for MinGW64 2015-02-22 23:47:29 +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
kai
e67e472a26 Fix for issue #791.
The ; at the end creates an ExpStatement in the AST with member exp set to
null. Dereferencing exp causes the crash.
IMHO this is a bug in the fontend AST.
2014-11-15 01:27:55 +01:00
Kai Nacke
382ad184d8 Merge branch 'master' into merge-2.066
Conflicts:
	dmd2/builtin.c
	gen/classes.cpp
	gen/functions.cpp
	gen/llvmhelpers.cpp
	gen/statements.cpp
	gen/toir.cpp
	runtime/druntime
	runtime/phobos
2014-09-13 23:11:54 +02:00
Alexey Prokhin
18f33b1815 Make IrDsymbol to be a typesafe union to reduce memory usage 2014-09-12 14:43:49 +04:00
Alexey Prokhin
d9189acbc4 Move toElem/toConstElem to visitors 2014-08-27 16:22:02 +04: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
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
kai
6aebfbdd0a Fix LLVM 3.6 build 2014-08-11 12:37:54 +02:00
kai
45fca1f3b5 Add line number to error message of -nogc switch.
This was suggested by bearophile in the news group.
It also changes all Loc objects to be passed by reference.
2014-07-04 07:15:05 +02:00