Commit graph

58 commits

Author SHA1 Message Date
Johan Engelen
3b28e79a9f Remove unused variables. 2017-01-20 22:21:39 +01:00
Martin
16d15e01cb Use opaque [N x i8*] for vtables
This fixes the forward-referencing issue #1741.
2016-11-21 21:54:53 +01:00
Martin
e1394fad5f Build vtable type lazily 2016-11-19 15:29:19 +01:00
Martin
ac93f4d0af Run functionSemantic() instead of full semantic3() to infer return type 2016-08-19 22:57:04 +02:00
Rainer Schuetze
1b4d8569b8 fix issue #1473: ICE when implementing extern(C++) interfaces 2016-05-08 22:11:55 +02:00
David Nadlinger
bb784bd7a4 ir: Implement new inheritance object layout
This is as per DMD a54e89d, but has not been tested all too carefully
yet – there still seem to be issues with extern(C++) interfaces (see
test suite).
2016-04-03 15:15:14 +01:00
David Nadlinger
6d2ac89aa3 irtypeclass: Rename addBaseClassData since it handles not just base classes, document better [nfc] 2016-04-03 15:15:14 +01:00
David Nadlinger
6a59286339 irtypeclass: Some constification/modernisation [nfc] 2016-04-03 15:15:14 +01:00
David Nadlinger
9f998a398d Initial merge of upstream v2.071.0-b2
Notably, the glue layer side of the changed multiple interface
inheritance layout (DMD a54e89d) has not been implemented yet.

This corresponds to DMD commit 3f6a763c0589dd03c1c206eafd434b593702564e.
2016-04-03 15:15:14 +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
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
52532985a9 IR source directory: use C++11 inline-initialization in headers 2015-11-01 19:30:04 +01: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
Alexey Prokhin
9314fc1c1c Fix issue 726: Wrong alignment for struct fields on x86_64/amd64 2014-10-11 18:12:11 +04:00
Alexey Prokhin
0b180be099 [cleanup] Merge common code in IrTypeStruct::get() and IrTypeClass::addBaseClassData() 2014-10-11 17:58:18 +04:00
David Nadlinger
bff766b379 Track member field index in IrTypeAggr, not IrField.
This fixes a regression introduced in caa2f15c8a. The IrDsymbol
metadata is obviously reset in between modules, while IrTypes
are not. Thus, we can never set symbol metadata when resolving
types, as the symbol data will be wrong in all modules following
the one where the type was first resolved.

GitHub: Fixes #739.
2014-10-11 03:28:49 +02:00
David Nadlinger
de742a06e2 [cleanup] Remove unused IrTypeAggr::default_fields and accessors. 2014-10-11 03:28:48 +02:00
Alexey Prokhin
66a392a5c2 Rename Type::irtype to ctype for consistency with dmd and gdc 2014-10-05 16:55:12 +04:00
Alexey Prokhin
caa2f15c8a Remove VarDeclaration::aggrIndex 2014-10-05 16:08:52 +04:00
Alexey Prokhin
0676e460ec C++ classes do not have monitors 2014-07-10 15:26:09 +04:00
kai
c6f856c01e Remove last uses of ArrayIter<>. 2014-01-12 18:07:27 +01:00
kai
6287a4d422 Replace ArrayIter<> with Array<>::iterator.
Just use the new iterator instead of the old Java-like class.
Also removes a dead iterator and replaces an iterator with a
pointer in some place.
2014-01-11 14:48:41 +01:00
David Nadlinger
68f8e38f51 Merge branch 'master' into merge-2.064. 2013-12-26 12:37:03 +01:00
David Nadlinger
f85d2a5a0a Respect type alignment when choosing padding fields.
Fixes ABI mismatch when e.g. padding a 28 byte union from a
20 byte member, where previously, an i64 would be emitted,
yielding a 32 byte LLVM struct size on ulong.alignof == 8
platforms.

Test case will follow on the 2.064 branch.
2013-12-26 12:35:19 +01:00
David Nadlinger
cb341586e3 First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
2013-10-29 19:21:15 +01:00
Alexey Prokhin
b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
Alexey Prokhin
90bb32d2d8 extern(C++) interfaces 2013-06-22 17:33:00 +04:00
David Nadlinger
292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
David Nadlinger
848dee32d4 Store bools as i8.
I really hope we can refactor this to use a less leaky
abstraction later – it should at least be possible to merge
voidToI8 and i1ToI8.
2013-06-07 03:20:54 +02:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
a3a511ca55 Refactored IrType construction to use static get() method.
This also allows us to enable the assert in IrType::IrType.

Unfortunately, this is mostly a "peace of mind" commit, there
doesn't seem to have been a bug actually caused by the transitory
duplicate IrTypePointer/IrTypeStruct instances.

The remaining xyz2llvm static methods are not exactly pretty,
they should probably just be folded into get.
2012-12-20 23:52:09 +01:00
David Nadlinger
464c695814 Renamed IrType::get/IrType::getD, treat classes as the special case they are. 2012-12-20 23:52:09 +01:00
David Nadlinger
59a4a02e49 Cleanup: Avoid signed/unsigned comparisons.
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
f68e914da6 Workaround for ICE due to auto return type not being inferred.
GitHub: Fixes #217.
2012-12-19 22:55:18 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
kai
311297b096 Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-03 06:32:23 +02:00
Alexey Prokhin
bca73ec8b9 Merged dmd 2.059beta 2012-04-05 15:30:00 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
0e754b5acd Merge dmd v2.055 2011-09-13 21:01:32 +04:00
Benjamin Kramer
c220dcac05 IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
2009-08-14 00:39:18 +02:00
Benjamin Kramer
977fa551ee Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
2009-08-06 01:47:39 +02:00
Frits van Bommel
4158fb474a Add an llvm::OStream workalike class for use with Logger::cout(), with the
crucial difference being special handling of `llvm::Type`s so they get printed
by name rather than printing their full representation (which can be positively
*huge*).

This allows re-enabling some logger calls that were disabled due to extreme
verbosity.
2009-06-16 19:31:10 +02:00
Frits van Bommel
cf5ad1a5b0 Remove some unnecessary #ifs. The D1 frontend has a Type::nextOf() which just
returns `next`.
2009-06-02 18:41:10 +02:00
Robert Clipsham
c5be82c5ae LDC 2 compiles again. 2009-05-30 17:23:32 +01:00
Tomas Lindquist Olsen
b147ecc66d Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset . 2009-05-14 17:20:17 +02:00
Tomas Lindquist Olsen
54d9955abc Added reference to DMD bug for latest dstress "regressions" compile/m/mixin_29_E.d and compile/m/mixin_29_F.d . 2009-05-10 00:50:35 +02:00
Tomas Lindquist Olsen
ca4f588c08 Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 . 2009-05-07 02:10:29 +02:00