From 28a65ff689b1ff237c9483fe9841435df1c2028c Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 7 Feb 2013 00:49:52 +0100 Subject: [PATCH] Fix D1 build. --- driver/cl_options.cpp | 7 +++++++ gen/toir.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/driver/cl_options.cpp b/driver/cl_options.cpp index e130768077..c10e34c31e 100644 --- a/driver/cl_options.cpp +++ b/driver/cl_options.cpp @@ -34,6 +34,12 @@ cl::list runargs("run", cl::Positional, cl::PositionalEatsArgs); +#if DMDV1 +static cl::opt useDeprecated("d", + cl::desc("Allow deprecated language features"), + cl::ZeroOrMore, + cl::location(global.params.useDeprecated)); +#else static cl::opt useDeprecated( cl::desc("Allow deprecated code/language features:"), cl::ZeroOrMore, @@ -44,6 +50,7 @@ static cl::opt useDeprecated( clEnumValEnd), cl::location(global.params.useDeprecated), cl::init(2)); +#endif #if DMDV2 cl::opt enforcePropertySyntax("property", diff --git a/gen/toir.cpp b/gen/toir.cpp index 13f8611443..aa8cc72571 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2923,6 +2923,8 @@ DValue* StructLiteralExp::toElem(IRState* p) Logger::print("StructLiteralExp::toElem: %s @ %s\n", toChars(), type->toChars()); LOG_SCOPE; + +#if DMDV2 if (sinit) { // 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())); return new DVarValue(type, initsym); } +#endif // make sure the struct is fully resolved sd->codegen(Type::sir); @@ -3006,8 +3009,10 @@ DValue* StructLiteralExp::toElem(IRState* p) // store the initializer there DtoAssign(loc, &field, val, TOKconstruct); +#if DMDV2 if (expr) callPostblit(loc, expr, field.getLVal()); +#endif // Also zero out padding bytes counted as being part of the type in DMD // 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()); LOG_SCOPE; +#if DMDV2 if (sinit) { // 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(); } +#endif // make sure the struct is resolved sd->codegen(Type::sir);