[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnet/image context.c, 1.15, 1.16 meta_build.c, 1.
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnet/image context.c, 1.15, 1.16 meta_build.c, 1.40, 1.41 |
Date: |
Tue, 25 Nov 2003 03:05:06 +0000 |
Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv5297/image
Modified Files:
context.c meta_build.c
Log Message:
Treat "file" scopes the same as "module" scopes during class lookup;
better error reporting for unresolved exported types.
Index: meta_build.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/meta_build.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** meta_build.c 25 Nov 2003 02:01:37 -0000 1.40
--- meta_build.c 25 Nov 2003 03:05:03 -0000 1.41
***************
*** 216,219 ****
--- 216,220 ----
case IL_META_TOKEN_TYPE_REF:
+ case IL_META_TOKEN_EXPORTED_TYPE:
{
/* The type was nested within another type */
***************
*** 236,239 ****
--- 237,255 ----
}
break;
+
+ case IL_META_TOKEN_FILE:
+ {
+ /* The type was imported from a file scope */
+ ILFileDecl *file = ILFileDecl_FromToken(image, token);
+ if(file)
+ {
+ importName = ILFileDecl_Name(file);
+ fprintf(stderr, "unresolved type: [.file
%s]%s%s%s\n",
+ importName, (namespace ?
namespace : ""),
+ (namespace ? "." : ""), name);
+ return;
+ }
+ }
+ break;
}
***************
*** 3157,3168 ****
{
ILExportedType *type;
/* Create the exported type record */
type = ILExportedTypeCreate(image, token,
values[IL_OFFSET_EXPTYPE_ATTRS],
ILImageGetString
! (image,
values[IL_OFFSET_EXPTYPE_NAME]),
! ILImageGetString
! (image,
values[IL_OFFSET_EXPTYPE_NAMESPACE]),
ILProgramItem_FromToken
(image,
values[IL_OFFSET_EXPTYPE_FILE]));
--- 3173,3188 ----
{
ILExportedType *type;
+ const char *namespace;
/* Create the exported type record */
+ namespace = ILImageGetString(image,
values[IL_OFFSET_EXPTYPE_NAMESPACE]);
+ if(namespace && *namespace == '\0')
+ {
+ namespace = 0;
+ }
type = ILExportedTypeCreate(image, token,
values[IL_OFFSET_EXPTYPE_ATTRS],
ILImageGetString
! (image,
values[IL_OFFSET_EXPTYPE_NAME]), namespace,
ILProgramItem_FromToken
(image,
values[IL_OFFSET_EXPTYPE_FILE]));
***************
*** 3433,3436 ****
--- 3453,3460 ----
Load_TypeDefName, 0));
+ /* Load exported type declarations */
+ EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_EXPORTED_TYPE,
+ Load_ExportedType, 0));
+
/* Load the assemblies that this image depends upon */
if((loadFlags & IL_LOADFLAG_NO_RESOLVE) == 0)
***************
*** 3494,3501 ****
EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_GENERIC_PAR,
Load_GenericPar, 0));
-
- /* Load exported type declarations */
- EXIT_IF_ERROR(LoadTokens(image, IL_META_TOKEN_EXPORTED_TYPE,
- Load_ExportedType, 0));
/* Done */
--- 3518,3521 ----
Index: context.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/context.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** context.c 23 Nov 2003 02:30:07 -0000 1.15
--- context.c 25 Nov 2003 03:05:03 -0000 1.16
***************
*** 115,118 ****
--- 115,129 ----
/* Match the scope */
+ if(key->scopeItem &&
+ (key->scopeItem->token & IL_META_TOKEN_MASK) == IL_META_TOKEN_MODULE)
+ {
+ /* Exported types in a file scope will also match module
requests */
+ if(classInfo->scope &&
+ (classInfo->scope->token & IL_META_TOKEN_MASK) ==
+ IL_META_TOKEN_FILE)
+ {
+ goto moduleScope;
+ }
+ }
if(key->scopeItem && key->scopeItem != classInfo->scope)
{
***************
*** 123,126 ****
--- 134,138 ----
return 0;
}
+ moduleScope:
/* Match the image */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnet/image context.c, 1.15, 1.16 meta_build.c, 1.40, 1.41,
Rhys Weatherley <address@hidden> <=