summaryrefslogtreecommitdiff
path: root/compiler_and_linker/FrontEnd/C/CScope.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-20 11:56:38 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-20 11:56:38 +0000
commit0905072b3ccfcb394b1dca2405a55cff4e2b9271 (patch)
treec7c6f87ecf257c4e7b6a92355e75030165731371 /compiler_and_linker/FrontEnd/C/CScope.c
parent7d986adf37220e1981a707745b784b078de4e3bc (diff)
downloadMWCC-0905072b3ccfcb394b1dca2405a55cff4e2b9271.tar.gz
MWCC-0905072b3ccfcb394b1dca2405a55cff4e2b9271.zip
tons more renaming of stuff
Diffstat (limited to '')
-rw-r--r--compiler_and_linker/FrontEnd/C/CScope.c200
1 files changed, 102 insertions, 98 deletions
diff --git a/compiler_and_linker/FrontEnd/C/CScope.c b/compiler_and_linker/FrontEnd/C/CScope.c
index 6049ad0..a4fdd5c 100644
--- a/compiler_and_linker/FrontEnd/C/CScope.c
+++ b/compiler_and_linker/FrontEnd/C/CScope.c
@@ -96,10 +96,10 @@ void CScope_SetFunctionScope(Object *function, CScopeSave *save) {
cscope_currentclass = NULL;
cscope_is_member_func = 0;
- if (TYPE_FUNC(function->type)->flags & FUNC_FLAGS_METHOD) {
+ if (TYPE_FUNC(function->type)->flags & FUNC_METHOD) {
cscope_currentclass = TYPE_METHOD(function->type)->theclass;
cscope_current = cscope_currentclass->nspace;
- cscope_is_member_func = TYPE_METHOD(function->type)->x26 == 0;
+ cscope_is_member_func = TYPE_METHOD(function->type)->is_static == 0;
} else {
cscope_current = function->nspace;
}
@@ -377,7 +377,7 @@ NameSpaceObjectList *CScope_ArgumentDependentNameLookup(NameSpaceObjectList *lis
continue;
if (!IS_TYPE_FUNC(OBJECT(iscan->object)->type))
continue;
- if (flag && (TYPE_FUNC(OBJECT(iscan->object)->type)->flags & FUNC_FLAGS_METHOD))
+ if (flag && (TYPE_FUNC(OBJECT(iscan->object)->type)->flags & FUNC_METHOD))
continue;
for (iiscan = list; iiscan; iiscan = iiscan->next) {
@@ -480,14 +480,14 @@ void CScope_AddObject(NameSpace *nspace, HashNameNode *name, ObjBase *obj) {
newlist = lalloc(sizeof(NameSpaceObjectList));
if (obj->otype == OT_NAMESPACE || objlist->object->otype == OT_NAMESPACE) {
- CError_Error(CErrorStr322/*, objlist->object*/);
+ CError_Error(CErrorStr322);
return;
}
if (obj->otype == OT_TYPETAG) {
do {
if (objlist->object->otype == OT_TYPETAG) {
- CError_Error(CErrorStr322/*, objlist->object*/);
+ CError_Error(CErrorStr322);
return;
}
@@ -549,7 +549,7 @@ void CScope_AddObject(NameSpace *nspace, HashNameNode *name, ObjBase *obj) {
objlist = objlist->next;
} while (1);
- } else if (nspace->theclass && TYPE_CLASS(nspace->theclass)->flags & CLASS_FLAGS_900) {
+ } else if (nspace->theclass && TYPE_CLASS(nspace->theclass)->flags & CLASS_IS_TEMPL_ANY) {
CScope_AppendName(nspace, name)->object = obj;
} else {
CScope_InsertName(nspace, name)->object = obj;
@@ -744,7 +744,7 @@ restart:
}
}
-static BClassList *CScope_RecFindClassMember(CScopeParseResult *result, TypeClass *tclass, SInt32 offset) {
+static BClassList *CScope_RecFindClassMember(NameResult *result, TypeClass *tclass, SInt32 offset) {
Boolean fail;
NameSpace *nspace;
NameSpaceObjectList *list;
@@ -798,8 +798,8 @@ static BClassList *CScope_RecFindClassMember(CScopeParseResult *result, TypeClas
&& result->nsol_14->object->otype == OT_TYPETAG
&& IS_TYPE_CLASS(OBJ_TYPE_TAG(list->object)->type)
&& IS_TYPE_CLASS(OBJ_TYPE_TAG(result->nsol_14->object)->type)
- && (TYPE_CLASS(OBJ_TYPE_TAG(list->object)->type)->flags & CLASS_FLAGS_800)
- && (TYPE_CLASS(OBJ_TYPE_TAG(result->nsol_14->object)->type)->flags & CLASS_FLAGS_800)
+ && (TYPE_CLASS(OBJ_TYPE_TAG(list->object)->type)->flags & CLASS_IS_TEMPL_INST)
+ && (TYPE_CLASS(OBJ_TYPE_TAG(result->nsol_14->object)->type)->flags & CLASS_IS_TEMPL_INST)
&& TEMPL_CLASS_INST(OBJ_TYPE_TAG(list->object)->type)->templ == TEMPL_CLASS_INST(OBJ_TYPE_TAG(result->nsol_14->object)->type)->templ
) {
cscope_foundtemplate = TEMPL_CLASS_INST(OBJ_TYPE_TAG(result->nsol_14->object)->type)->templ;
@@ -837,7 +837,7 @@ static BClassList *CScope_RecFindClassMember(CScopeParseResult *result, TypeClas
cscope_foundclass = tclass;
cscope_foundclassoffset = offset;
- result->x8 = OBJ_TYPE_TAG(list->object)->type;
+ result->type = OBJ_TYPE_TAG(list->object)->type;
newlist = lalloc(sizeof(BClassList));
newlist->next = NULL;
newlist->type = TYPE(tclass);
@@ -869,7 +869,7 @@ static BClassList *CScope_RecFindClassMember(CScopeParseResult *result, TypeClas
return bestBase;
}
-static Boolean CScope_FindClassMember(CScopeParseResult *result, NameSpace *nspace, HashNameNode *name, ELookupType lookupType) {
+static Boolean CScope_FindClassMember(NameResult *result, NameSpace *nspace, HashNameNode *name, ELookupType lookupType) {
BClassList *bcl;
BClassList *scan;
@@ -1195,22 +1195,22 @@ static NameSpace *CScope_NSIteratorFindNameSpace(CScopeNSIterator *iterator, Has
return NULL;
}
-static Boolean CScope_SetupParseNameResult(CScopeParseResult *result, NameSpaceObjectList *list, HashNameNode *name) {
+static Boolean CScope_SetupParseNameResult(NameResult *result, NameSpaceObjectList *list, HashNameNode *name) {
if (!list->next || list->next->object->otype == OT_TYPETAG) {
switch (list->object->otype) {
case OT_NAMESPACE:
CError_Error(CErrorStr321);
return 0;
case OT_TYPE:
- result->x8 = OBJ_TYPE(list->object)->type;
- result->xC = OBJ_TYPE(list->object)->qual;
+ result->type = OBJ_TYPE(list->object)->type;
+ result->qual = OBJ_TYPE(list->object)->qual;
result->obj_10 = list->object;
result->name_4 = name;
result->x20 = 1;
break;
case OT_TYPETAG:
- result->x8 = OBJ_TYPE_TAG(list->object)->type;
- result->xC = 0;
+ result->type = OBJ_TYPE_TAG(list->object)->type;
+ result->qual = 0;
result->obj_10 = list->object;
result->name_4 = name;
result->x20 = 1;
@@ -1225,10 +1225,10 @@ static Boolean CScope_SetupParseNameResult(CScopeParseResult *result, NameSpaceO
return 1;
}
-Boolean CScope_FindQualifiedClassMember(CScopeParseResult *result, TypeClass *tclass, HashNameNode *name) {
+Boolean CScope_FindQualifiedClassMember(NameResult *result, TypeClass *tclass, HashNameNode *name) {
NameSpaceObjectList *list;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
CDecl_CompleteType(TYPE(tclass));
if (CScope_FindClassMember(result, tclass->nspace, name, Lookup_0)) {
@@ -1236,7 +1236,7 @@ Boolean CScope_FindQualifiedClassMember(CScopeParseResult *result, TypeClass *tc
CError_ASSERT(1780, list);
result->nsol_14 = NULL;
- if (CScope_SetupParseNameResult(result, list, name) && !result->x8)
+ if (CScope_SetupParseNameResult(result, list, name) && !result->type)
return 1;
else
CError_Error(CErrorStr340, name->name);
@@ -1245,7 +1245,7 @@ Boolean CScope_FindQualifiedClassMember(CScopeParseResult *result, TypeClass *tc
return 0;
}
-static NameSpace *CScope_FindQualifiedNameSpace(CScopeParseResult *result, NameSpace *nspace, HashNameNode *name) {
+static NameSpace *CScope_FindQualifiedNameSpace(NameResult *result, NameSpace *nspace, HashNameNode *name) {
NameSpaceObjectList *list;
NameSpace *cand;
NameSpace *found;
@@ -1288,7 +1288,7 @@ static NameSpace *CScope_FindQualifiedNameSpace(CScopeParseResult *result, NameS
return NULL;
}
-static NameSpaceObjectList *CScope_FindQualifiedName(CScopeParseResult *result, NameSpace *nspace, HashNameNode *name, NameSpace **foundnspace) {
+static NameSpaceObjectList *CScope_FindQualifiedName(NameResult *result, NameSpace *nspace, HashNameNode *name, NameSpace **foundnspace) {
NameSpaceObjectList *list;
NameSpaceLookupList *lookup;
@@ -1318,7 +1318,7 @@ static NameSpaceObjectList *CScope_FindQualifiedName(CScopeParseResult *result,
return NULL;
}
-static Boolean CScope_FindQualifiedTag(CScopeParseResult *result, NameSpace *nspace, HashNameNode *name) {
+static Boolean CScope_FindQualifiedTag(NameResult *result, NameSpace *nspace, HashNameNode *name) {
NameSpaceObjectList *list;
NameSpaceLookupList *lookup;
Type *best;
@@ -1333,7 +1333,7 @@ static Boolean CScope_FindQualifiedTag(CScopeParseResult *result, NameSpace *nsp
if ((list = CScope_FindQualName(nspace, name))) {
for (; list; list = list->next) {
if (list->object->otype == OT_TYPETAG) {
- result->x8 = OBJ_TYPE_TAG(list->object)->type;
+ result->type = OBJ_TYPE_TAG(list->object)->type;
return 1;
}
}
@@ -1355,7 +1355,7 @@ static Boolean CScope_FindQualifiedTag(CScopeParseResult *result, NameSpace *nsp
}
if (best) {
- result->x8 = best;
+ result->type = best;
return 1;
}
}
@@ -1364,7 +1364,7 @@ static Boolean CScope_FindQualifiedTag(CScopeParseResult *result, NameSpace *nsp
return 0;
}
-CW_INLINE void CScope_NSIteratorInit(CScopeNSIterator *iterator, NameSpace *nspace, CScopeParseResult *result) {
+CW_INLINE void CScope_NSIteratorInit(CScopeNSIterator *iterator, NameSpace *nspace, NameResult *result) {
// assumed name
if (nspace->usings) {
iterator->nspace = NULL;
@@ -1395,7 +1395,7 @@ CW_INLINE Boolean CScope_NSIteratorNext(CScopeNSIterator *iterator) {
}
Type *CScope_GetType(NameSpace *nspace, HashNameNode *name, UInt32 *qual) {
- CScopeParseResult result;
+ NameResult result;
CScopeNSIterator iterator;
NameSpaceObjectList *list;
Boolean ok;
@@ -1422,7 +1422,7 @@ Type *CScope_GetType(NameSpace *nspace, HashNameNode *name, UInt32 *qual) {
}
Type *CScope_GetTagType(NameSpace *nspace, HashNameNode *name) {
- CScopeParseResult result;
+ NameResult result;
CScopeNSIterator iterator;
NameSpaceObjectList *list;
Boolean ok;
@@ -1440,7 +1440,7 @@ Type *CScope_GetTagType(NameSpace *nspace, HashNameNode *name) {
return NULL;
}
-static Boolean CScope_DependentTemplateMember(CScopeParseResult *result, TypeTemplDep *ttempldep, Boolean flag1, Boolean flag2) {
+static Boolean CScope_DependentTemplateMember(NameResult *result, TypeTemplDep *ttempldep, Boolean flag1, Boolean flag2) {
SInt32 streamstate;
int token;
TypeTemplDep *newtype;
@@ -1461,7 +1461,7 @@ static Boolean CScope_DependentTemplateMember(CScopeParseResult *result, TypeTem
CPrep_TokenStreamSetState(&streamstate);
lex();
tk = lex();
- result->x8 = TYPE(newtype);
+ result->type = TYPE(newtype);
return 1;
}
@@ -1489,7 +1489,7 @@ static Boolean CScope_DependentTemplateMember(CScopeParseResult *result, TypeTem
continue;
} else {
CPrep_TokenStreamSetState(&streamstate);
- result->x8 = TYPE(newtype2);
+ result->type = TYPE(newtype2);
return 1;
}
}
@@ -1523,12 +1523,12 @@ static Boolean CScope_DependentTemplateMember(CScopeParseResult *result, TypeTem
}
CPrep_TokenStreamSetState(&streamstate);
- result->x8 = TYPE(newtype);
+ result->type = TYPE(newtype);
return 1;
}
CPrep_TokenStreamSetState(&streamstate);
- result->x8 = TYPE(ttempldep);
+ result->type = TYPE(ttempldep);
return 1;
}
}
@@ -1547,7 +1547,7 @@ static Boolean CScope_CheckDtorName(TypeClass *tclass, Boolean *flag) {
{
if (!CClass_Destructor(tclass))
*flag = 1;
- if ((tclass->flags & CLASS_FLAGS_800) && (lookahead() == '<')) {
+ if ((tclass->flags & CLASS_IS_TEMPL_INST) && (lookahead() == '<')) {
tk = lex();
if (!CTemplTool_EqualArgs(TEMPL_CLASS_INST(tclass)->inst_args, CTempl_ParseUncheckTemplArgs(NULL, 0)))
CError_Error(CErrorStr374);
@@ -1560,7 +1560,7 @@ static Boolean CScope_CheckDtorName(TypeClass *tclass, Boolean *flag) {
return 0;
}
-static Boolean CScope_ParseQualifiedName(CScopeParseResult *result, NameSpace *nspace) {
+static Boolean CScope_ParseQualifiedName(NameResult *result, NameSpace *nspace) {
NameSpaceObjectList *list;
HashNameNode *saveidentifier;
TypeClass *tclass;
@@ -1602,33 +1602,37 @@ static Boolean CScope_ParseQualifiedName(CScopeParseResult *result, NameSpace *n
return 0;
}
- if (!(list = CScope_FindQualifiedName(result, nspace, saveidentifier, &result->nspace_0)) || !CScope_SetupParseNameResult(result, list, saveidentifier)) {
+ if (
+ !(list = CScope_FindQualifiedName(result, nspace, saveidentifier, &result->nspace_0)) ||
+ !CScope_SetupParseNameResult(result, list, saveidentifier)
+ )
+ {
if (flag) {
result->x1C = 1;
return 1;
}
- if (nspace->theclass && !(nspace->theclass->flags & CLASS_FLAGS_2))
+ if (nspace->theclass && !(nspace->theclass->flags & CLASS_COMPLETED))
CError_Error(CErrorStr136, nspace->theclass, 0);
else
CError_Error(CErrorStr140, saveidentifier->name);
return 0;
}
- if (result->x8 && IS_TYPE_CLASS(result->x8) && (lookahead() == '<')) {
- tclass = TYPE_CLASS(result->x8);
- if (tclass->flags & CLASS_FLAGS_800)
+ if (result->type && IS_TYPE_CLASS(result->type) && (lookahead() == '<')) {
+ tclass = TYPE_CLASS(result->type);
+ if (tclass->flags & CLASS_IS_TEMPL_INST)
tclass = TYPE_CLASS(TEMPL_CLASS_INST(tclass)->templ);
- else if (!(tclass->flags & CLASS_FLAGS_100))
+ else if (!(tclass->flags & CLASS_IS_TEMPL))
return 1;
tk = lex();
- result->x8 = CTempl_ClassGetType(TEMPL_CLASS(tclass));
- if (IS_TYPE_CLASS(result->x8) && (lookahead() == TK_COLON_COLON)) {
+ result->type = CTempl_ClassGetType(TEMPL_CLASS(tclass));
+ if (IS_TYPE_CLASS(result->type) && (lookahead() == TK_COLON_COLON)) {
lex();
tk = lex();
result->x1D = 1;
- nspace = TYPE_CLASS(result->x8)->nspace;
- result->x8 = NULL;
+ nspace = TYPE_CLASS(result->type)->nspace;
+ result->type = NULL;
result->obj_10 = NULL;
continue;
}
@@ -1638,14 +1642,14 @@ static Boolean CScope_ParseQualifiedName(CScopeParseResult *result, NameSpace *n
} while (1);
}
-Boolean CScope_ParseExprName(CScopeParseResult *result) {
+Boolean CScope_ParseExprName(NameResult *result) {
CScopeNSIterator iterator;
HashNameNode *name;
NameSpaceObjectList *list;
Boolean flag;
if (!copts.cplusplus) {
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
if (tk != TK_IDENTIFIER) {
CError_Error(CErrorStr107);
return 0;
@@ -1665,11 +1669,11 @@ Boolean CScope_ParseExprName(CScopeParseResult *result) {
return 1;
} else {
if ((tk == TK_COLON_COLON || tk == TK_IDENTIFIER) && CScope_ParseQualifiedNameSpace(result, 1, 1)) {
- if (result->x8)
+ if (result->type)
return 1;
CError_ASSERT(2313, result->nspace_0);
} else {
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
result->nspace_0 = cscope_current;
}
@@ -1733,7 +1737,7 @@ Boolean CScope_ParseExprName(CScopeParseResult *result) {
}
}
-Boolean CScope_ParseDeclName(CScopeParseResult *result) {
+Boolean CScope_ParseDeclName(NameResult *result) {
CScopeNSIterator iterator;
HashNameNode *name;
NameSpaceObjectList *list;
@@ -1748,7 +1752,7 @@ Boolean CScope_ParseDeclName(CScopeParseResult *result) {
CError_Error(CErrorStr107);
return 0;
}
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
name = tkidentifier;
CScope_NSIteratorInit(&iterator, cscope_current, result);
@@ -1771,7 +1775,7 @@ Boolean CScope_ParseDeclName(CScopeParseResult *result) {
if (!CScope_ParseQualifiedNameSpace(result, 0, 0))
goto non_cpp_mode;
- if (result->x8)
+ if (result->type)
return 1;
nspace = result->nspace_0;
@@ -1835,7 +1839,7 @@ Boolean CScope_ParseDeclName(CScopeParseResult *result) {
}
}
-Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1, Boolean flag2) {
+Boolean CScope_ParseQualifiedNameSpace(NameResult *result, Boolean flag1, Boolean flag2) {
// mostly matches, some registers are awkwardly swapped
HashNameNode *name; // r25
NameSpace *nspace; // r24
@@ -1845,7 +1849,7 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
NameSpaceObjectList *list; // r21
CScopeNSIterator iterator;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
nspace = NULL;
if (tk == TK_COLON_COLON) {
result->nspace_0 = nspace = cscope_root;
@@ -1894,7 +1898,7 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
type = OBJ_TYPE_TAG(list->object)->type;
if (type->type != TYPECLASS) {
if (t == '<') {
- result->x8 = type;
+ result->type = type;
return 1;
} else {
CError_Error(CErrorStr121);
@@ -1903,19 +1907,19 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
}
parse_thing:
if (t == '<') {
- if (TYPE_CLASS(type)->flags & CLASS_FLAGS_800) {
+ if (TYPE_CLASS(type)->flags & CLASS_IS_TEMPL_INST) {
type = TYPE(TEMPL_CLASS_INST(type)->templ);
- } else if (!(TYPE_CLASS(type)->flags & CLASS_FLAGS_100)) {
- result->x8 = type;
+ } else if (!(TYPE_CLASS(type)->flags & CLASS_IS_TEMPL)) {
+ result->type = type;
return 1;
}
}
if ((tk = lex()) == '<') {
- CError_ASSERT(2609, TYPE_CLASS(type)->flags & CLASS_FLAGS_100);
+ CError_ASSERT(2609, TYPE_CLASS(type)->flags & CLASS_IS_TEMPL);
type2 = CTempl_ClassGetType(TEMPL_CLASS(type));
if (IS_TYPE_TEMPLATE(type2)) {
if (lookahead() != TK_COLON_COLON) {
- result->x8 = type2;
+ result->type = type2;
return 1;
}
return CScope_DependentTemplateMember(result, TYPE_TEMPLATE(type2), flag1, flag2);
@@ -1925,14 +1929,14 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
result->nspace_0 = nspace = TYPE_CLASS(type2)->nspace;
if (lookahead() != TK_COLON_COLON) {
- result->x8 = type2;
+ result->type = type2;
return 1;
}
tk = lex();
CDecl_CompleteType(type2);
} else {
CError_ASSERT(2632, tk == TK_COLON_COLON);
- if (!(TYPE_CLASS(type)->flags & CLASS_FLAGS_100) || CParser_CheckTemplateClassUsage(TEMPL_CLASS(type), 1))
+ if (!(TYPE_CLASS(type)->flags & CLASS_IS_TEMPL) || CParser_CheckTemplateClassUsage(TEMPL_CLASS(type), 1))
result->nspace_0 = nspace = TYPE_CLASS(type)->nspace;
CDecl_CompleteType(type);
}
@@ -1948,7 +1952,7 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
if (TYPE_TEMPLATE(type2)->dtype == TEMPLDEP_ARGUMENT && TYPE_TEMPLATE(type2)->u.pid.type == TPT_TEMPLATE) {
type2 = CTempl_ParseTemplTemplParam(TYPE_TEMPLATE(type2));
if ((type2->type != TYPETEMPLATE) || ((t = lookahead()) != TK_COLON_COLON)) {
- result->x8 = type2;
+ result->type = type2;
return 1;
}
}
@@ -1956,19 +1960,19 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
return CScope_DependentTemplateMember(result, TYPE_TEMPLATE(type2), flag1, flag2);
}
if (t == '<') {
- result->x8 = type2;
+ result->type = type2;
return 1;
} else {
CError_Error(CErrorStr121);
return 0;
}
} else {
- if ((t == '<') && (TYPE_CLASS(type2)->flags & CLASS_FLAGS_100)) {
+ if ((t == '<') && (TYPE_CLASS(type2)->flags & CLASS_IS_TEMPL)) {
type = type2;
goto parse_thing;
}
if ((tk = lex()) == '<') {
- result->x8 = type2;
+ result->type = type2;
return 1;
}
CError_ASSERT(2686, tk == TK_COLON_COLON);
@@ -1989,14 +1993,14 @@ Boolean CScope_ParseQualifiedNameSpace(CScopeParseResult *result, Boolean flag1,
return 0;
}
-Boolean CScope_ParseElaborateName(CScopeParseResult *result) {
+Boolean CScope_ParseElaborateName(NameResult *result) {
CScopeNSIterator iterator;
HashNameNode *name;
NameSpaceObjectList *list;
Boolean flag;
if (!copts.cplusplus) {
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
if (tk != TK_IDENTIFIER) {
CError_Error(CErrorStr107);
return 0;
@@ -2029,7 +2033,7 @@ Boolean CScope_ParseElaborateName(CScopeParseResult *result) {
}
name = tkidentifier;
} else {
- if (result->x8)
+ if (result->type)
return 1;
CError_ASSERT(2760, result->nspace_0);
@@ -2062,11 +2066,11 @@ Boolean CScope_ParseElaborateName(CScopeParseResult *result) {
}
}
-Boolean CScope_FindObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name) {
+Boolean CScope_FindObject(NameSpace *nspace, NameResult *result, HashNameNode *name) {
CScopeNSIterator iterator;
NameSpaceObjectList *list;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
CScope_NSIteratorInit(&iterator, nspace, result);
do {
for (list = CScope_NSIteratorFind(&iterator, name); list; list = list->next) {
@@ -2080,11 +2084,11 @@ Boolean CScope_FindObject(NameSpace *nspace, CScopeParseResult *result, HashName
return 0;
}
-Boolean CScope_FindNonClassObject(NameSpace *nspace, CScopeParseResult *result, HashNameNode *name) {
+Boolean CScope_FindNonClassObject(NameSpace *nspace, NameResult *result, HashNameNode *name) {
CScopeNSIterator iterator;
NameSpaceObjectList *list;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
CScope_NSIteratorInit(&iterator, nspace, result);
do {
for (list = CScope_NSIteratorNonClassFind(&iterator, name); list; list = list->next) {
@@ -2098,11 +2102,11 @@ Boolean CScope_FindNonClassObject(NameSpace *nspace, CScopeParseResult *result,
return 0;
}
-NameSpaceObjectList *CScope_FindObjectList(CScopeParseResult *result, HashNameNode *name) {
+NameSpaceObjectList *CScope_FindObjectList(NameResult *result, HashNameNode *name) {
CScopeNSIterator iterator;
NameSpaceObjectList *list;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
CScope_NSIteratorInit(&iterator, cscope_current, result);
do {
for (list = CScope_NSIteratorFind(&iterator, name); list; list = list->next) {
@@ -2117,11 +2121,11 @@ NameSpaceObjectList *CScope_FindObjectList(CScopeParseResult *result, HashNameNo
}
Boolean CScope_PossibleTypeName(HashNameNode *name) {
- CScopeParseResult result;
+ NameResult result;
CScopeNSIterator iterator;
NameSpaceObjectList *list;
- memclrw(&result, sizeof(CScopeParseResult));
+ memclrw(&result, sizeof(NameResult));
CScope_NSIteratorInit(&iterator, cscope_current, &result);
do {
if ((list = CScope_NSIteratorFind(&iterator, name))) {
@@ -2142,10 +2146,10 @@ Boolean CScope_PossibleTypeName(HashNameNode *name) {
return 0;
}
-Boolean CScope_FindClassMemberObject(TypeClass *tclass, CScopeParseResult *result, HashNameNode *name) {
+Boolean CScope_FindClassMemberObject(TypeClass *tclass, NameResult *result, HashNameNode *name) {
NameSpaceObjectList *list;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
if (CScope_FindClassMember(result, tclass->nspace, name, Lookup_0)) {
list = result->nsol_14;
@@ -2228,12 +2232,12 @@ Type *CScope_GetLocalTagType(NameSpace *nspace, HashNameNode *name) {
return NULL;
}
-Boolean CScope_FindTypeName(NameSpace *nspace, HashNameNode *name, CScopeParseResult *result) {
+Boolean CScope_FindTypeName(NameSpace *nspace, HashNameNode *name, NameResult *result) {
CScopeNSIterator iterator;
NameSpaceObjectList *list;
NameSpaceObjectList *scan;
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
CScope_NSIteratorInit(&iterator, nspace, result);
do {
@@ -2342,7 +2346,7 @@ BClassList *CScope_GetClassAccessPath(BClassList *list, TypeClass *tclass) {
return NULL;
}
-static Boolean CScope_FixMemberResult(TypeClass *tclass, CScopeParseResult *result) {
+static Boolean CScope_FixMemberResult(TypeClass *tclass, NameResult *result) {
if (!(result->bcl_18 = CScope_GetClassAccessPath(result->bcl_18, tclass))) {
if (result->name_4)
CError_Error(CErrorStr150, result->name_4->name);
@@ -2354,7 +2358,7 @@ static Boolean CScope_FixMemberResult(TypeClass *tclass, CScopeParseResult *resu
}
}
-Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boolean flag) {
+Boolean CScope_ParseMemberName(TypeClass *tclass, NameResult *result, Boolean flag) {
HashNameNode *name;
NameSpaceObjectList *list;
short t;
@@ -2365,11 +2369,11 @@ Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boo
if (!CScope_ParseExprName(result))
return 0;
- if (result->x8 && IS_TYPE_TEMPLATE(result->x8) && TYPE_TEMPLATE(result->x8)->dtype == TEMPLDEP_QUALNAME) {
+ if (result->type && IS_TYPE_TEMPLATE(result->type) && TYPE_TEMPLATE(result->type)->dtype == TEMPLDEP_QUALNAME) {
if (flag)
return 1;
- CError_Error(CErrorStr340, TYPE_TEMPLATE(result->x8)->u.qual.name->name);
- result->x8 = NULL;
+ CError_Error(CErrorStr340, TYPE_TEMPLATE(result->type)->u.qual.name->name);
+ result->type = NULL;
return 0;
}
@@ -2385,7 +2389,7 @@ Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boo
tkidentifier = name;
switch (t) {
case TK_COLON_COLON:
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
if (!CScope_FindClassMember(result, tclass->nspace, name, Lookup_2))
goto restart;
break;
@@ -2395,7 +2399,7 @@ Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boo
break;
}
} else if (tk == '~') {
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
if (CScope_CheckDtorName(tclass, &dtorflag)) {
if (dtorflag) {
result->x1C = 1;
@@ -2412,7 +2416,7 @@ Boolean CScope_ParseMemberName(TypeClass *tclass, CScopeParseResult *result, Boo
return 0;
}
- memclrw(result, sizeof(CScopeParseResult));
+ memclrw(result, sizeof(NameResult));
return CScope_ParseQualifiedName(result, tclass->nspace);
}
@@ -2508,10 +2512,10 @@ static void CScope_AddUsingObject(BClassList *bcl, NameSpace *nspace, ObjBase *o
}
void CScope_AddClassUsingDeclaration(TypeClass *tclass, TypeClass *tclass2, HashNameNode *name, AccessType access) {
- CScopeParseResult result;
+ NameResult result;
NameSpaceObjectList *scan;
- memclrw(&result, sizeof(CScopeParseResult));
+ memclrw(&result, sizeof(NameResult));
if (!CScope_FindClassMember(&result, tclass2->nspace, name, Lookup_0) || !CScope_FixMemberResult(tclass, &result)) {
CError_Error(CErrorStr340, name->name);
return;
@@ -2540,10 +2544,10 @@ void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean
Boolean isTemplate;
Boolean isTypename;
NameSpaceObjectList *scan;
- CScopeParseResult result;
+ NameResult result;
if (nspace->theclass) {
- isTemplate = (TYPE_CLASS(nspace->theclass)->flags & CLASS_FLAGS_100) != 0;
+ isTemplate = (TYPE_CLASS(nspace->theclass)->flags & CLASS_IS_TEMPL) != 0;
isTypename = 0;
if (tk == TK_TYPENAME) {
if (!isTemplate)
@@ -2557,7 +2561,7 @@ void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean
return;
}
- if (result.x8 && IS_TYPE_TEMPLATE(result.x8) && TYPE_TEMPLATE(result.x8)->dtype == TEMPLDEP_QUALNAME) {
+ if (result.type && IS_TYPE_TEMPLATE(result.type) && TYPE_TEMPLATE(result.type)->dtype == TEMPLDEP_QUALNAME) {
CError_ASSERT(3578, isTemplate);
if (isTypename) {
@@ -2565,12 +2569,12 @@ void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean
memclrw(objtype, sizeof(ObjType));
objtype->otype = OT_TYPE;
objtype->access = access;
- objtype->type = result.x8;
- CScope_AddObject(nspace, TYPE_TEMPLATE(result.x8)->u.qual.name, OBJ_BASE(objtype));
+ objtype->type = result.type;
+ CScope_AddObject(nspace, TYPE_TEMPLATE(result.type)->u.qual.name, OBJ_BASE(objtype));
} else {
CTemplClass_RegisterUsingDecl(
TEMPL_CLASS(nspace->theclass),
- TYPE_TEMPLATE(result.x8),
+ TYPE_TEMPLATE(result.type),
access);
}
@@ -2612,11 +2616,11 @@ void CScope_ParseUsingDeclaration(NameSpace *nspace, AccessType access, Boolean
}
static NameSpace *CScope_ParseQualifiedNamespaceSpecifier(NameSpace *nspace) {
- CScopeParseResult result;
+ NameResult result;
CScopeNSIterator iterator;
NameSpaceObjectList *list;
- memclrw(&result, sizeof(CScopeParseResult));
+ memclrw(&result, sizeof(NameResult));
if (tk == TK_COLON_COLON) {
nspace = cscope_root;
result.x1D = 1;