mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
Pass isCfile parameter for all defaultInit() calls, for some extra importC zero-init
Fixes dmd-testsuite's runnable/test22994.c.
This commit is contained in:
parent
dab538f76e
commit
4b1f5516fd
7 changed files with 22 additions and 18 deletions
|
@ -353,7 +353,7 @@ static void DtoSetArray(DValue *array, LLValue *dim, LLValue *ptr) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLConstant *DtoConstArrayInitializer(ArrayInitializer *arrinit,
|
||||
Type *targetType) {
|
||||
Type *targetType, const bool isCfile) {
|
||||
IF_LOG Logger::println("DtoConstArrayInitializer: %s | %s",
|
||||
arrinit->toChars(), targetType->toChars());
|
||||
LOG_SCOPE;
|
||||
|
@ -416,7 +416,7 @@ LLConstant *DtoConstArrayInitializer(ArrayInitializer *arrinit,
|
|||
static_cast<unsigned long long>(j));
|
||||
}
|
||||
|
||||
LLConstant *c = DtoConstInitializer(val->loc, elemty, val);
|
||||
LLConstant *c = DtoConstInitializer(val->loc, elemty, val, isCfile);
|
||||
assert(c);
|
||||
if (c->getType() != llelemty) {
|
||||
mismatch = true;
|
||||
|
@ -443,7 +443,8 @@ LLConstant *DtoConstArrayInitializer(ArrayInitializer *arrinit,
|
|||
}
|
||||
|
||||
if (!elemDefaultInit) {
|
||||
elemDefaultInit = DtoConstInitializer(arrinit->loc, elemty);
|
||||
elemDefaultInit =
|
||||
DtoConstInitializer(arrinit->loc, elemty, nullptr, isCfile);
|
||||
if (elemDefaultInit->getType() != llelemty) {
|
||||
mismatch = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue