mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fix D1 build.
This commit is contained in:
@@ -34,6 +34,12 @@ cl::list<std::string> runargs("run",
|
|||||||
cl::Positional,
|
cl::Positional,
|
||||||
cl::PositionalEatsArgs);
|
cl::PositionalEatsArgs);
|
||||||
|
|
||||||
|
#if DMDV1
|
||||||
|
static cl::opt<bool, true> useDeprecated("d",
|
||||||
|
cl::desc("Allow deprecated language features"),
|
||||||
|
cl::ZeroOrMore,
|
||||||
|
cl::location(global.params.useDeprecated));
|
||||||
|
#else
|
||||||
static cl::opt<ubyte, true> useDeprecated(
|
static cl::opt<ubyte, true> useDeprecated(
|
||||||
cl::desc("Allow deprecated code/language features:"),
|
cl::desc("Allow deprecated code/language features:"),
|
||||||
cl::ZeroOrMore,
|
cl::ZeroOrMore,
|
||||||
@@ -44,6 +50,7 @@ static cl::opt<ubyte, true> useDeprecated(
|
|||||||
clEnumValEnd),
|
clEnumValEnd),
|
||||||
cl::location(global.params.useDeprecated),
|
cl::location(global.params.useDeprecated),
|
||||||
cl::init(2));
|
cl::init(2));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if DMDV2
|
#if DMDV2
|
||||||
cl::opt<bool, true> enforcePropertySyntax("property",
|
cl::opt<bool, true> enforcePropertySyntax("property",
|
||||||
|
|||||||
@@ -2923,6 +2923,8 @@ DValue* StructLiteralExp::toElem(IRState* p)
|
|||||||
Logger::print("StructLiteralExp::toElem: %s @ %s\n", toChars(), type->toChars());
|
Logger::print("StructLiteralExp::toElem: %s @ %s\n", toChars(), type->toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
|
|
||||||
|
#if DMDV2
|
||||||
if (sinit)
|
if (sinit)
|
||||||
{
|
{
|
||||||
// Copied from VarExp::toElem, need to clean this mess up.
|
// Copied from VarExp::toElem, need to clean this mess up.
|
||||||
@@ -2937,6 +2939,7 @@ DValue* StructLiteralExp::toElem(IRState* p)
|
|||||||
initsym = DtoBitCast(initsym, DtoType(ts->pointerTo()));
|
initsym = DtoBitCast(initsym, DtoType(ts->pointerTo()));
|
||||||
return new DVarValue(type, initsym);
|
return new DVarValue(type, initsym);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// make sure the struct is fully resolved
|
// make sure the struct is fully resolved
|
||||||
sd->codegen(Type::sir);
|
sd->codegen(Type::sir);
|
||||||
@@ -3006,8 +3009,10 @@ DValue* StructLiteralExp::toElem(IRState* p)
|
|||||||
// store the initializer there
|
// store the initializer there
|
||||||
DtoAssign(loc, &field, val, TOKconstruct);
|
DtoAssign(loc, &field, val, TOKconstruct);
|
||||||
|
|
||||||
|
#if DMDV2
|
||||||
if (expr)
|
if (expr)
|
||||||
callPostblit(loc, expr, field.getLVal());
|
callPostblit(loc, expr, field.getLVal());
|
||||||
|
#endif
|
||||||
|
|
||||||
// Also zero out padding bytes counted as being part of the type in DMD
|
// Also zero out padding bytes counted as being part of the type in DMD
|
||||||
// but not in LLVM; e.g. real/x86_fp80.
|
// but not in LLVM; e.g. real/x86_fp80.
|
||||||
@@ -3035,6 +3040,7 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p)
|
|||||||
Logger::print("StructLiteralExp::toConstElem: %s @ %s\n", toChars(), type->toChars());
|
Logger::print("StructLiteralExp::toConstElem: %s @ %s\n", toChars(), type->toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
||||||
|
#if DMDV2
|
||||||
if (sinit)
|
if (sinit)
|
||||||
{
|
{
|
||||||
// Copied from VarExp::toConstElem, need to clean this mess up.
|
// Copied from VarExp::toConstElem, need to clean this mess up.
|
||||||
@@ -3046,6 +3052,7 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p)
|
|||||||
|
|
||||||
return ts->sym->ir.irStruct->getDefaultInit();
|
return ts->sym->ir.irStruct->getDefaultInit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// make sure the struct is resolved
|
// make sure the struct is resolved
|
||||||
sd->codegen(Type::sir);
|
sd->codegen(Type::sir);
|
||||||
|
|||||||
Reference in New Issue
Block a user