This enables us to remove the whole ugly config file parsing hack.
Also includes some minor CMake beautifications (nobody should really be at 2.4 anymore, 2.6 is more than three years old now).
This solves the problem of LDC picking up a pre-existing system-wide config when druntime and Phobos are compiled as part of the build process.
This order was intended by Christian in 919f8d6, but then backed out again in eb3cd887 with no comment as to why – I hope this doesn't have any unwanted implications.
Unline older versions, llvm 3.0 provides atomic instructions, not intrinsics.
The patch wraps the instructions into intrinsics, so they will be accessible
from d code.
Before, _d_arraycatT was used to concatenate multiple arrays. That caused an issue when postblit
was called on a struct multiple times. The next code asserted due to the issue:
void main()
{
static struct S
{
int x;
int pad;
this(this)
{
++x;
}
}
auto sarr = new S[1];
auto sarr2 = sarr ~ sarr ~ sarr;
assert(sarr2[0].x == 1);
assert(sarr2[1].x == 1);
assert(sarr2[2].x == 1);
assert(sarr[0].x == 0);
}
In some cases, like the following, DtoDeclareFunction() hasn't already been called when DtoCreateNestedContextType() is invoked. This seems to have been anticipated when the function was originally written, but DtoDeclareFunction() was previously called after the ir func was already accessed in fd->ir.irFunc->nestedContextCreated.
---
void main() {
mixin({
string foo() {
return "";
}
string bar()() {
return foo();
}
return bar();
}());
}
---
When clearing the lvalue cache, the added-then-backed-out-then-added-back-for-D2-only code by Alexey permanently removed all casts from e1 (e1 is a member variable!), instead of only skipping them for the cachedLvalue assignment.
Previously, LDC would crash in the backend due to the fact that the IR is typed in such cases (we recently had such an instance with Tango, where an extern( C ) function was declared once with int and once with size_t).