Skip to content

Commit

Permalink
Remove the -v1 switch and all uses
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed May 15, 2013
1 parent 61bcb35 commit d2c6b6e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 39 deletions.
17 changes: 2 additions & 15 deletions src/lexer.c
Expand Up @@ -1055,12 +1055,7 @@ void Lexer::scan(Token *t)
p++;
if (*p == '=')
{ p++;
if (*p == '=' && global.params.Dversion == 1)
{ p++;
t->value = TOKnotidentity; // !==
}
else
t->value = TOKnotequal; // !=
t->value = TOKnotequal; // !=
}
else if (*p == '<')
{ p++;
Expand Down Expand Up @@ -1097,12 +1092,7 @@ void Lexer::scan(Token *t)
p++;
if (*p == '=')
{ p++;
if (*p == '=' && global.params.Dversion == 1)
{ p++;
t->value = TOKidentity; // ===
}
else
t->value = TOKequal; // ==
t->value = TOKequal; // ==
}
#if DMDV2
else if (*p == '>')
Expand Down Expand Up @@ -2956,9 +2946,6 @@ void Lexer::initKeywords()

stringtable._init(6151);

if (global.params.Dversion == 1)
nkeywords -= 2;

cmtable_init();

for (size_t u = 0; u < nkeywords; u++)
Expand Down
10 changes: 0 additions & 10 deletions src/mars.c
Expand Up @@ -446,7 +446,6 @@ int tryMain(size_t argc, char *argv[])
global.params.useSwitchError = 1;
global.params.useInline = 0;
global.params.obj = 1;
global.params.Dversion = 2;
global.params.quiet = 1;
global.params.useDeprecated = 2;

Expand Down Expand Up @@ -612,15 +611,6 @@ int tryMain(size_t argc, char *argv[])
else if (strcmp(p + 1, "vtls") == 0)
global.params.vtls = 1;
#endif
else if (strcmp(p + 1, "v1") == 0)
{
#if DMDV1
global.params.Dversion = 1;
#else
error(Loc(), "use DMD 1.0 series compilers for -v1 switch");
break;
#endif
}
else if (strcmp(p + 1, "w") == 0)
global.params.warnings = 1;
else if (strcmp(p + 1, "wi") == 0)
Expand Down
1 change: 0 additions & 1 deletion src/mars.h
Expand Up @@ -175,7 +175,6 @@ struct Param
bool cov; // generate code coverage data
unsigned char covPercent; // 0..100 code coverage percentage required
bool nofloat; // code should not pull in floating point support
char Dversion; // D version number
char ignoreUnsupportedPragmas; // rather than error on them
char enforcePropertySyntax;
char betterC; // be a "better C" compiler; no dependency on D runtime
Expand Down
10 changes: 1 addition & 9 deletions src/mtype.c
Expand Up @@ -8764,13 +8764,6 @@ MATCH TypeClass::implicitConvTo(Type *to)
}
}

if (global.params.Dversion == 1)
{
// Allow conversion to (void *)
if (to->ty == Tpointer && ((TypePointer *)to)->next->ty == Tvoid)
return MATCHconvert;
}

m = MATCHnomatch;
if (sym->aliasthis && !(att & RECtracing))
{
Expand Down Expand Up @@ -9324,8 +9317,7 @@ void Parameter::argsToCBuffer(OutBuffer *buf, HdrGenState *hgs, Parameters *argu
if (arg->storageClass & STCout)
buf->writestring("out ");
else if (arg->storageClass & STCref)
buf->writestring((global.params.Dversion == 1)
? "inout " : "ref ");
buf->writestring("ref ");
else if (arg->storageClass & STCin)
buf->writestring("in ");
else if (arg->storageClass & STClazy)
Expand Down
3 changes: 1 addition & 2 deletions src/scope.c
Expand Up @@ -280,8 +280,7 @@ Dsymbol *Scope::search(Loc loc, Identifier *ident, Dsymbol **pscopesym)
s = sc->scopesym->search(loc, ident, 0);
if (s)
{
if (global.params.Dversion > 1 &&
ident == Id::length &&
if (ident == Id::length &&
sc->scopesym->isArrayScopeSymbol() &&
sc->enclosing &&
sc->enclosing->search(loc, ident, NULL))
Expand Down
3 changes: 1 addition & 2 deletions src/statement.c
Expand Up @@ -2267,8 +2267,7 @@ void ForeachStatement::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
if (i)
buf->writestring(", ");
if (a->storageClass & STCref)
buf->writestring((global.params.Dversion == 1)
? (char*)"inout " : (char*)"ref ");
buf->writestring((char*)"ref ");
if (a->type)
a->type->toCBuffer(buf, a->ident, hgs);
else
Expand Down

0 comments on commit d2c6b6e

Please sign in to comment.