[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/include il_dumpasm.h,1.4,1.5 il_meta.h,
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/include il_dumpasm.h,1.4,1.5 il_meta.h,1.8,1.9 il_opcodes.h,1.5,1.6 il_program.h,1.35,1.36 il_types.h,1.15,1.16 |
Date: |
Tue, 18 Feb 2003 00:25:12 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/include
In directory subversions:/tmp/cvs-serv8588/include
Modified Files:
il_dumpasm.h il_meta.h il_opcodes.h il_program.h il_types.h
Log Message:
Add support for Generic IL to "image", "ilasm", and "ildasm"; some
syntax extensions for Generic C#, but no semantic analysis (yet).
Index: il_dumpasm.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/include/il_dumpasm.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** il_dumpasm.h 19 Jul 2002 00:22:15 -0000 1.4
--- il_dumpasm.h 18 Feb 2003 05:25:08 -0000 1.5
***************
*** 34,37 ****
--- 34,38 ----
#define IL_DUMP_QUOTE_NAMES 2
#define IL_DUMP_CLASS_PREFIX 4
+ #define IL_DUMP_GENERIC_PARAMS 8
/*
Index: il_meta.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/include/il_meta.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** il_meta.h 31 Jan 2003 02:00:29 -0000 1.8
--- il_meta.h 18 Feb 2003 05:25:08 -0000 1.9
***************
*** 66,69 ****
--- 66,71 ----
#define IL_META_TOKEN_MANIFEST_RESOURCE 0x28000000
#define IL_META_TOKEN_NESTED_CLASS
0x29000000
+ #define IL_META_TOKEN_GENERIC_PAR
0x2A000000
+ #define IL_META_TOKEN_METHOD_SPEC
0x2B000000
#define IL_META_TOKEN_STRING
0x70000000
#define IL_META_TOKEN_NAME
0x71000000
***************
*** 321,327 ****
#define IL_META_ELEMTYPE_VALUECLASS
IL_META_ELEMTYPE_VALUETYPE
#define IL_META_ELEMTYPE_CLASS 0x12
! #define IL_META_ELEMTYPE_UNUSED1 0x13
/* !! */
#define IL_META_ELEMTYPE_ARRAY 0x14
! #define IL_META_ELEMTYPE_COPYCTOR 0x15
#define IL_META_ELEMTYPE_TYPEDBYREF 0x16
#define IL_META_ELEMTYPE_VALUEARRAY 0x17
--- 323,329 ----
#define IL_META_ELEMTYPE_VALUECLASS
IL_META_ELEMTYPE_VALUETYPE
#define IL_META_ELEMTYPE_CLASS 0x12
! #define IL_META_ELEMTYPE_VAR 0x13
#define IL_META_ELEMTYPE_ARRAY 0x14
! #define IL_META_ELEMTYPE_WITH 0x15
#define IL_META_ELEMTYPE_TYPEDBYREF 0x16
#define IL_META_ELEMTYPE_VALUEARRAY 0x17
***************
*** 332,340 ****
#define IL_META_ELEMTYPE_OBJECT 0x1C
#define IL_META_ELEMTYPE_SZARRAY 0x1D
! #define IL_META_ELEMTYPE_GENERICARRAY 0x1E
#define IL_META_ELEMTYPE_CMOD_REQD 0x1F
#define IL_META_ELEMTYPE_CMOD_OPT 0x20
#define IL_META_ELEMTYPE_INTERNAL 0x21
! #define IL_META_ELEMTYPE_VAR 0x22
#define IL_META_ELEMTYPE_NAME 0x23
#define IL_META_ELEMTYPE_MODIFIER 0x40
--- 334,342 ----
#define IL_META_ELEMTYPE_OBJECT 0x1C
#define IL_META_ELEMTYPE_SZARRAY 0x1D
! #define IL_META_ELEMTYPE_MVAR 0x1E
#define IL_META_ELEMTYPE_CMOD_REQD 0x1F
#define IL_META_ELEMTYPE_CMOD_OPT 0x20
#define IL_META_ELEMTYPE_INTERNAL 0x21
! #define IL_META_ELEMTYPE_VAR_OLD 0x22
#define IL_META_ELEMTYPE_NAME 0x23
#define IL_META_ELEMTYPE_MODIFIER 0x40
***************
*** 379,382 ****
--- 381,386 ----
#define IL_META_CALLCONV_PROPERTY 0x08
#define IL_META_CALLCONV_UNMGD 0x09
+ #define IL_META_CALLCONV_INSTANTIATION 0x0A
+ #define IL_META_CALLCONV_GENERIC 0x10
#define IL_META_CALLCONV_HASTHIS 0x20
#define IL_META_CALLCONV_EXPLICITTHIS 0x40
Index: il_opcodes.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/include/il_opcodes.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** il_opcodes.h 4 Jan 2003 00:44:33 -0000 1.5
--- il_opcodes.h 18 Feb 2003 05:25:08 -0000 1.6
***************
*** 210,217 ****
#define IL_OP_STELEM_REF 0xA2
! #define IL_OP_UNUSED_A3 0xA3
/* !! */
! #define IL_OP_UNUSED_A4 0xA4
! #define IL_OP_UNUSED_A5 0xA5
! #define IL_OP_UNUSED_A6 0xA6
#define IL_OP_UNUSED_A7 0xA7
#define IL_OP_UNUSED_A8 0xA8
--- 210,218 ----
#define IL_OP_STELEM_REF 0xA2
! #define IL_OP_LDELEM 0xA3
! #define IL_OP_STELEM 0xA4
! #define IL_OP_UNBOX_ANY 0xA5
!
! #define IL_OP_UNUSED_A6 0xA6
/* !! */
#define IL_OP_UNUSED_A7 0xA7
#define IL_OP_UNUSED_A8 0xA8
Index: il_program.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/include/il_program.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** il_program.h 15 Feb 2003 01:57:52 -0000 1.35
--- il_program.h 18 Feb 2003 05:25:08 -0000 1.36
***************
*** 62,65 ****
--- 62,67 ----
typedef struct _tagILManifestRes ILManifestRes;
typedef struct _tagILExportedType ILExportedType;
+ typedef struct _tagILGenericPar ILGenericPar;
+ typedef struct _tagILMethodSpec ILMethodSpec;
/*
***************
*** 2211,2214 ****
--- 2213,2322 ----
#define ILExportedType_Namespace(type)
(ILExportedTypeGetNamespace((type)))
#define ILExportedType_Scope(type)
(ILExportedTypeGetScope((type)))
+
+ /*
+ * Create a generic parameter record.
+ */
+ ILGenericPar *ILGenericParCreate(ILImage *image, ILToken token,
+ ILProgramItem
*owner, ILUInt32 number);
+
+ /*
+ * Get the number associated with a generic parameter.
+ */
+ ILUInt32 ILGenericParGetNumber(ILGenericPar *genPar);
+
+ /*
+ * Get the flags associated with a generic parameter.
+ */
+ ILUInt32 ILGenericParGetFlags(ILGenericPar *genPar);
+
+ /*
+ * Set the flags associated with a generic parameter.
+ */
+ void ILGenericParSetFlags(ILGenericPar *genPar, ILUInt32 mask, ILUInt32
value);
+
+ /*
+ * Get the owner associated with a generic parameter.
+ */
+ ILProgramItem *ILGenericParGetOwner(ILGenericPar *genPar);
+
+ /*
+ * Get the name associated with a generic parameter.
+ */
+ const char *ILGenericParGetName(ILGenericPar *genPar);
+
+ /*
+ * Set the name associated with a generic parameter. Returns
+ * zero if out of memory.
+ */
+ int ILGenericParSetName(ILGenericPar *genPar, const char *name);
+
+ /*
+ * Get the kind associated with a generic parameter.
+ */
+ ILProgramItem *ILGenericParGetKind(ILGenericPar *genPar);
+
+ /*
+ * Set the kind associated with a generic parameter.
+ */
+ void ILGenericParSetKind(ILGenericPar *genPar, ILProgramItem *type);
+
+ /*
+ * Get the constraint associated with a generic parameter.
+ */
+ ILProgramItem *ILGenericParGetConstraint(ILGenericPar *genPar);
+
+ /*
+ * Set the constraint associated with a generic parameter.
+ */
+ void ILGenericParSetConstraint(ILGenericPar *genPar, ILProgramItem *type);
+
+ /*
+ * Get a generic parameter record for a particular owner and number.
+ * Returns NULL if the record could not be found.
+ */
+ ILGenericPar *ILGenericParGetFromOwner(ILProgramItem *owner, ILUInt32 number);
+
+ /*
+ * Get the number of generic parameters that are owned by an item.
+ */
+ ILUInt32 ILGenericParGetNumParams(ILProgramItem *owner);
+
+ /*
+ * Helper macros for querying information about generic parameters.
+ */
+ #define ILGenericPar_FromToken(image,token) \
+ ((ILGenericPar *)ILImageTokenInfo((image),
(token)))
+ #define ILGenericPar_Token(genPar)
(ILProgramItem_Token((genPar)))
+ #define ILGenericPar_Number(genPar)
(ILGenericParGetNumber((genPar)))
+ #define ILGenericPar_Flags(genPar)
(ILGenericParGetFlags((genPar)))
+ #define ILGenericPar_Owner(genPar)
(ILGenericParGetOwner((genPar)))
+ #define ILGenericPar_Name(genPar)
(ILGenericParGetName((genPar)))
+ #define ILGenericPar_Kind(genPar)
(ILGenericParGetKind((genPar)))
+ #define ILGenericPar_Constraint(genPar)
(ILGenericParGetConstraint((genPar)))
+
+ /*
+ * Create a method specification record.
+ */
+ ILMethodSpec *ILMethodSpecCreate(ILImage *image, ILToken token,
+ ILMember
*method, ILType *type);
+
+ /*
+ * Get the method associated with a MethodSpec token.
+ */
+ ILMember *ILMethodSpecGetMethod(ILMethodSpec *spec);
+
+ /*
+ * Get the type associated with a MethodSpec token.
+ */
+ ILType *ILMethodSpecGetType(ILMethodSpec *spec);
+
+ /*
+ * Helper macros for querying information about method specifications.
+ */
+ #define ILMethodSpec_FromToken(image,token) \
+ ((ILMethodSpec *)ILImageTokenInfo((image),
(token)))
+ #define ILMethodSpec_Token(spec)
(ILProgramItem_Token((spec)))
+ #define ILMethodSpec_Method(spec)
(ILMethodSpecGetMethod((spec)))
+ #define ILMethodSpec_Type(spec)
(ILMethodSpecGetType((spec)))
/*
Index: il_types.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/include/il_types.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** il_types.h 8 Aug 2002 07:32:13 -0000 1.15
--- il_types.h 18 Feb 2003 05:25:08 -0000 1.16
***************
*** 114,117 ****
--- 114,120 ----
#define IL_TYPE_COMPLEX_PINNED 10
#define IL_TYPE_COMPLEX_LOCALS 11
+ #define IL_TYPE_COMPLEX_WITH 12
+ #define IL_TYPE_COMPLEX_MVAR 13
+ #define IL_TYPE_COMPLEX_VAR
14
#define IL_TYPE_COMPLEX_METHOD 16
#define IL_TYPE_COMPLEX_METHOD_SENTINEL 1
***************
*** 135,138 ****
--- 138,142 ----
ILType *param__[3]; /* Parameters */
ILType *next__; /* Overflow for the rest of the
parameters */
+ ILUInt32 gparams__; /* Number of generic parameters
*/
} method__;
struct {
***************
*** 148,151 ****
--- 152,156 ----
ILType *next__; /* Overflow for the rest of the
locals */
} locals__;
+ int num__; /* Generic variable number */
} un;
};
***************
*** 254,257 ****
--- 259,274 ----
/*
+ * Get the generic variable number from a type.
+ */
+ #define ILType_VarNum(type) ((type)->un.num__)
+
+ /*
+ * Get or set the number of generic parameters for a method signature.
+ */
+ #define ILType_NumGen(type) ((type)->un.method__.gparams__)
+ #define ILType_SetNumGen(type,num) \
+ ((type)->un.method__.gparams__ = (ILUInt32)(num))
+
+ /*
* Create a reference type. Returns NULL if out of memory.
*/
***************
*** 533,536 ****
--- 550,594 ----
*/
int ILTypeIsDelegateSubClass(ILType *type);
+
+ /*
+ * Create generic variable reference. Returns NULL if out of memory.
+ */
+ ILType *ILTypeCreateVarNum(ILContext *context, int kind, int num);
+
+ /*
+ * Create a "with" generic type reference. Returns NULL if out of memory.
+ */
+ ILType *ILTypeCreateWith(ILContext *context, ILType *mainType);
+
+ /*
+ * Add a parameter to a "with" generic type reference. Returns zero
+ * if out of memory.
+ */
+ int ILTypeAddWithParam(ILContext *context, ILType *type, ILType *paramType);
+
+ /*
+ * Get the number of "with" parameters on a generic type reference.
+ */
+ unsigned long ILTypeNumWithParams(ILType *type);
+
+ /*
+ * Get a specific "with" parameter. 1 is the first parameter.
+ */
+ ILType *ILTypeGetWithParam(ILType *type, unsigned long num);
+
+ /*
+ * Get a specific "with" parameter with prefixes.
+ */
+ ILType *ILTypeGetWithParamWithPrefixes(ILType *type, unsigned long num);
+
+ /*
+ * Get the main "with" type for a generic type reference.
+ */
+ ILType *ILTypeGetWithMain(ILType *type);
+
+ /*
+ * Get the main "with" type with prefixes.
+ */
+ ILType *ILTypeGetWithMainWithPrefixes(ILType *type);
#ifdef __cplusplus
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/include il_dumpasm.h,1.4,1.5 il_meta.h,1.8,1.9 il_opcodes.h,1.5,1.6 il_program.h,1.35,1.36 il_types.h,1.15,1.16,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2151,1.2152
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_build.c,1.19,1.20 ilasm_build.h,1.7,1.8 ilasm_grammar.y,1.29,1.30 ilasm_scanner.l,1.10,1.11
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnet ChangeLog,1.2151,1.2152
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet/ilasm ilasm_build.c,1.19,1.20 ilasm_build.h,1.7,1.8 ilasm_grammar.y,1.29,1.30 ilasm_scanner.l,1.10,1.11
- Index(es):