From 4eaccca6623d10df10ff11162d870abf215479f8 Mon Sep 17 00:00:00 2001 From: Walter Bright Date: Tue, 21 Feb 2012 21:14:28 -0800 Subject: [PATCH] move errors to Dsymbol --- src/dsymbol.c | 2 ++ src/dsymbol.h | 1 + src/template.c | 2 -- src/template.h | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dsymbol.c b/src/dsymbol.c index bdcf31ab2b53..bd1536ce589a 100644 --- a/src/dsymbol.c +++ b/src/dsymbol.c @@ -45,6 +45,7 @@ Dsymbol::Dsymbol() this->loc = 0; this->comment = NULL; this->scope = NULL; + this->errors = false; } Dsymbol::Dsymbol(Identifier *ident) @@ -58,6 +59,7 @@ Dsymbol::Dsymbol(Identifier *ident) this->loc = 0; this->comment = NULL; this->scope = NULL; + this->errors = false; } int Dsymbol::equals(Object *o) diff --git a/src/dsymbol.h b/src/dsymbol.h index 567191b56b87..140f7e795e80 100644 --- a/src/dsymbol.h +++ b/src/dsymbol.h @@ -117,6 +117,7 @@ struct Dsymbol : Object unsigned char *comment; // documentation comment for this Dsymbol Loc loc; // where defined Scope *scope; // !=NULL means context to use for semantic() + bool errors; // this symbol failed to pass semantic() Dsymbol(); Dsymbol(Identifier *); diff --git a/src/template.c b/src/template.c index fded4617bf95..2d2465786636 100644 --- a/src/template.c +++ b/src/template.c @@ -3346,7 +3346,6 @@ TemplateInstance::TemplateInstance(Loc loc, Identifier *ident) this->nest = 0; this->havetempdecl = 0; this->isnested = NULL; - this->errors = 0; this->speculative = 0; } @@ -3375,7 +3374,6 @@ TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration *td, Objects *ti this->nest = 0; this->havetempdecl = 1; this->isnested = NULL; - this->errors = 0; this->speculative = 0; assert((size_t)tempdecl->scope > 0x10000); diff --git a/src/template.h b/src/template.h index 1485abd072aa..43df4ceffd62 100644 --- a/src/template.h +++ b/src/template.h @@ -1,6 +1,6 @@ // Compiler implementation of the D programming language -// Copyright (c) 1999-2011 by Digital Mars +// Copyright (c) 1999-2012 by Digital Mars // All Rights Reserved // written by Walter Bright // http://www.digitalmars.com @@ -284,7 +284,6 @@ struct TemplateInstance : ScopeDsymbol int nest; // for recursion detection int havetempdecl; // 1 if used second constructor Dsymbol *isnested; // if referencing local symbols, this is the context - int errors; // 1 if compiled with errors int speculative; // 1 if only instantiated with errors gagged #ifdef IN_GCC /* On some targets, it is necessary to know whether a symbol