Commit graph

22 commits

Author SHA1 Message Date
Martin Kinkelin
39b46d7b69 Replace old-school header guards by #pragma once 2018-10-20 16:19:46 +02:00
Martin
e337cec78a Slightly refactor RTTIBuilder 2018-04-04 19:59:10 +02:00
Martin
3f38f9715a Get rid of special 'typeid(...)' LL types for TypeInfos
Use the real LL type representing the TypeInfo (sub)class directly and
from the beginning, i.e., already for the declaration, instead of
building an extra LL struct type (firstly opaque, then finalized when
defining the TypeInfo via RTTIBuilder).

To get this to work in all cases, the dummy TypeInfo for opaque structs
is now a complete TypeInfo_Struct, with all 11/13 fields zero-
initialized. Previously, it was a special TypeInfo (no extra
TypeInfo_Struct fields) with TypeInfo_Struct vtable, something which DMD
also emits.

Also refactor the RTTIBuilder finalize() interface - e.g., don't set the
linkage there (had to be reverted for ModuleInfos) and only take the
global variable to be defined. Cast the field initializers if required,
e.g., null pointers to appropriately typed function pointers for
TypeInfo_Struct etc.
2017-10-25 00:38:05 +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
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
63ca3c7eb4 Always zero struct padding as required by TDPL
We already generated the memsets for zeroing the padding,
but because we relied on the native LLVM type allignment
where possible instead of generating explicit padding
values, LLVM did not always copy those bytes around (e.g.
when spilling/reloading registers).
2015-08-10 20:49:30 +02: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
David Nadlinger
f2f3c751b3 Renamed IrStruct to IrAggr, as it is also used for classes.
The class-specific parts should probably be factored out.
2013-06-12 17:16:35 +02:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +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
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger
4ae14449ea Emit new TypeInfo layout.
Includes untested support for RTInfo.
2012-09-07 03:51:32 +02:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
4d7a6eda23 Different fixes for d2 2010-10-07 22:35:32 +04:00
Tomas Lindquist Olsen
3e4ade93ba Updated comment in RTTIBuilder.h 2009-05-17 16:31:23 +02:00
Tomas Lindquist Olsen
b1fa43ce24 Increased RTTIBuilder buffer to 14 constants, to be big enough for !ClassInfo as well as !TypeInfo 2009-05-17 16:29:49 +02:00
Tomas Lindquist Olsen
dc4b7e8118 Update !ClassInfo generation to use !RTTIBuilder, slight update of !RTTIBuilder . 2009-05-17 16:27:01 +02:00
Tomas Lindquist Olsen
b6daf3d545 Renamed !TypeInfoBuilder to !RTTIBuilder. 2009-05-17 15:20:58 +02:00
Tomas Lindquist Olsen
5078019c54 Cleaned up TypeInfo_Tuple generation. 2009-05-17 05:07:51 +02:00
Tomas Lindquist Olsen
d80de9deb3 Cleaned up TypeInfo_Struct.
Fixed problem with DtoConstSize_t taking a size_t argument, this is not enough for cross compiling from 32bit host to a 64bit target. It now takes uint64_t. There's probably a lot of similar case around to code ...
2009-05-17 04:41:10 +02:00
Tomas Lindquist Olsen
f3c7278e88 Cleaned up TypeInfo generation, still need to do TypeInfo_Struct/Tuple. Eventually do ClassInfo and ModuleInfo as well using same interface. 2009-05-17 03:10:55 +02:00