Commit graph

121 commits

Author SHA1 Message Date
Johan Engelen
c6ba2dc29b Fix a few clang warnings. [NFC] 2016-07-27 20:21:02 +02:00
Rainer Schuetze
f9995b1883 fix build against LLVM trunk svn rev 273030 2016-06-18 10:54:23 +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
Johan Engelen
776e32d801 Add experimental -hash-threshold option to hash very long symbol names. 2016-05-24 11:39:08 +02:00
Rainer Schuetze
1b4d8569b8 fix issue #1473: ICE when implementing extern(C++) interfaces 2016-05-08 22:11:55 +02:00
Rainer Schuetze
bc1a1b1f9e fix runnable/cppa.d for Windows: C++ interface functions are implemented without thunks, the this pointer is adjusted in the function itself 2016-04-28 23:43:50 +02:00
Rainer Schuetze
1f5d689526 fix vtbl generation for interfaces (bad caching caused wrong thunks to be used)
fix interface casting
2016-04-18 08:22:31 +02:00
David Nadlinger
1160b81b5a Clean up some (clang-)formatting [nfc] 2016-04-10 15:43:21 +01:00
Kai Nacke
88f3de8bea Merge branch 'ltsmaster' 2016-03-22 19:05:07 +01:00
Martin
88dcb4349a Refactor setting linkage type and COMDAT 2016-03-20 16:37:44 +01:00
Rainer Schuetze
1131e6fc24 fix function name mangling for debug info 2016-03-13 17:31:22 +01:00
Rainer Schuetze
6f3adaea46 add debug info to thunks as a workaround for https://llvm.org/bugs/show_bug.cgi?id=26833 2016-03-13 17:29:44 +01:00
Rainer Schuetze
c970d5da3f thunks don't need a personality 2016-03-13 17:27:50 +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
956061c3c7 Revise DtoGEP() helpers and mark most GEPs inbounds 2015-12-14 00:18:15 +01:00
Martin
71912511a5 Adaptations for recent LLVM 3.8 master changes 2015-11-08 14:06:16 +01:00
David Nadlinger
db3b3f157f Remove unused get_default_initializer argument 2015-11-06 00:24:03 +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
Martin
54c9661b30 Merge branch 'master' into merge-2.068 2015-10-18 13:57:30 +02:00
Martin
5c68fb25a4 Win64 ABI: pass 'this' before 'sret' for extern (C++) 2015-10-12 22:15:49 +02:00
David Nadlinger
bd47ea49e6 Merge branch 'master' into merge-2.068 2015-09-24 17:57:25 +02:00
Kai Nacke
ab2e8e3646 Refactor new COMDAT code.
Linkage and the COMDAT flag is now returned as std::pair<>.
Also adds more COMDATs.
2015-09-17 21:04:40 +02:00
Kai Nacke
0e6c614060 Fix more of issue #988.
Initializers and thunk code were still missing in COMDAT section.
2015-09-16 23:43:28 +02:00
David Nadlinger
f4f55abf27 Use thunks instead of calling _d_toObject for D interfaces
This allows us avoid the problems stemming from the 64 kiB
size limit hack in _d_toObject.

GitHub: Fix #1065.
2015-09-13 20:27:00 +02:00
David Nadlinger
ac0afd10b8 Using hidden base class functions is now an error 2015-08-29 03:09:18 +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
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
Martin
4b71db1d16 Merge branch 'master' into merge-2.067
And update submodules.

Conflicts:
	runtime/druntime
2015-08-08 17:50:54 +02:00
Kai Nacke
4f942f4764 Add some debug code to vtable generation. 2015-08-07 11:55:48 +02:00
Kai Nacke
d1e764cec1 Backport of "Avoid using llvm::Linker" to master.
See pull request #974 for the original code.
2015-06-27 22:08:44 +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
Kai Nacke
ced658da92 Merge branch 'master' into merge-2.067 2015-04-05 03:29:30 +02:00
Kai Nacke
a4924c50e1 LLVM 3.7: llvm::ConstantExpr::getElementPtr() wants element type.
This is the same change like the one on the GEP instruction.
2015-04-04 01:37:14 +02:00
kai
c39c7e9c35 Update to DMD v2.067.0-b2
Includes all tagged with v2.067.0-b2. Does not includes latest druntime changes from ldc (head) branch.

This is known to be broken. I only merged the frontend stuff but did not try to compile something...
2015-02-24 22:16:17 +01:00
kai
e455b90456 Merge branch 'master' into merge-2.067
Conflicts:
	dmd2/template.c
	runtime/druntime
	runtime/phobos
2015-02-24 07:23:58 +01:00
kai
441c98532c Add changes related to the llvm::Metadata refactoring in LLVM 3.6.
In LLVM 3.6, the llvm::Metadata hierarchy is distinct from the llvm::Value hierarchy.
This refactoring causes several changes.
2014-12-25 19:02:15 +01:00
kai
a2748cd2fd Merge current development state of 2.067
First merge of current development stream. Asm blocks are known to be broken.

DMD:      0c9f437bc24015707130ba42dc434d9cd58282fb
druntime: 86d49cfb3670904603df0cfdfe44c6fff565c0fc
Phobos:   a8ca4f7964becac680af0eadbde05aa7d10fc338
2014-11-15 18:53:23 +01:00
David Nadlinger
84f7e106fc Merge pull request #742 from klickverbot/vtbl-initializer
Fix issue with multiple initializers for classes that implement interfaces.
2014-10-11 19:46:00 +02:00
Alexey Prokhin
9314fc1c1c Fix issue 726: Wrong alignment for struct fields on x86_64/amd64 2014-10-11 18:12:11 +04:00
David Nadlinger
c60fa3cc0d [cleanup] Indentation fix. 2014-10-11 15:56:46 +02:00
David Nadlinger
bb1ad7e324 Clean up linkage handling.
Since the change to the symbol emission strategy, a lot of the
previous attempts to derive the linkage for a symbol from its
AST node has been superfluous. This cleans up all the related
code, as it is really not doing much anymore.

The code to opportunistically internalize symbols is now gone
entirely. It was commented out anyway due to problems with
making it work reliably in the face of the not-so-stable
structure of the AST we get from the frontend (regarding the
modules certain symbols end up in). But in any case internal
linkage woudl also be troublesome for cross-module inlining,
so I gave up on making this work for the time being.

The only (minor) change in the emitted code should be in
.offTi generation, which is untested and disabled by default
anyway (GENERATE_OFFTI).
2014-10-08 20:55:19 +02:00
Alexey Prokhin
4e2d45a409 Move irFty fields to backend ir classes 2014-10-05 16:55:22 +04:00
Alexey Prokhin
66a392a5c2 Rename Type::irtype to ctype for consistency with dmd and gdc 2014-10-05 16:55:12 +04:00
David Nadlinger
3d1be20470 Remove availableExternally logic and extra inlining semantic passes.
Turns out that since the change to use DMD's symbol emission
logic a few releases back we didn't actually ever emit code
for the extra modules. Thus, all the effort for the extra
semantic passes went to waste.

If we want to implement DMD-style cross-module inlining, we
need to add the extra semantic3s back in, and then iterate
over all the non-root modules with a codegen visitor that
only emits symbols as available_externally.

We probably won't need the availableExternally members if
we start with a clean design in the new symbol emission
framework. Thus, remove everything in the meantime. This
will make some release builds a bit faster, and should not
negatively affect generated code.
2014-10-04 20:02:13 +02: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
f25d31332b Trivial error message improvements 2014-08-22 16:26:16 +04:00