There's a functional change here: previously, the direct calls to
`TypeInfo...Declaration_codegen()` bypassed the check whether the
TypeInfo can be omitted due to the described type being speculative,
which is performed for normal `Declaration_codegen()` calls only.
The latter is used by `DtoTypeInfoOf()`.
Improve robustness for TypeInfos of speculative types by only eliding
their TypeInfo definition, not the declaration of the LL global
altogether.
`DtoTypeInfoOf()` expects the LL global to be created and otherwise
fails with an assertion or segfault (e.g., issue #2357). So now only
linker errors should result in case the TypeInfo definition is missing.
Also normalize the calls to `DtoTypeInfoOf()` and revise the following
pointer bitcasts, as the LL type of forward-declared TypeInfo globals
may be opaque.
Previously, we would always try to splat the given expression across the
whole vector. This hasn't been noticed earlier as DMD mostly generates
ArrayInitializers when initializing vectors to array literals (but
notably not when explicitly assigning VectorType.init).
GitHub: Fixes#2101.
Errors are gagged while trying to create a constant initializer for an
associative array literal. So don't die with an assertion if the cast
source is a NewExp (or something else than a supported ClassReferenceExp),
emit a gaggable error instead.
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.
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
Trying to get the alignment right by using the first non-default one
in the following order of descending priority:
VarDeclaration::alignment [variables only of course]
Type::alignment()
Type::alignsize()
This fixes `align(x) struct S { ... }`.
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.
The new type parameter for `llvm::ConstantExpr::getGetElementPtr()` is
checked for being the pointee of the provided base (or more precisely,
the pointee of the base's scalar type).
So for the 'ugly' GEP, i8* as type for an i8* base was clearly wrong,
and the 'nice' GEP with the fixed i8 type would only work for i8* bases.
This fixes dmd-testsuite issues on Win64, e.g., runnable/test11.d.