Author: kjs
Date: Sat Dec 27 03:15:42 2008
New Revision: 34419
Modified:
trunk/compilers/pirc/new/bcgen.h
trunk/compilers/pirc/new/pircompunit.h
trunk/compilers/pirc/new/pirsymbol.h
Log:
[pirc] prepare to refactor sub struct.
+ remove __ in some union names. They're ugly.
+ remove some false comment.
Modified: trunk/compilers/pirc/new/bcgen.h
==============================================================================
--- trunk/compilers/pirc/new/bcgen.h (original)
+++ trunk/compilers/pirc/new/bcgen.h Sat Dec 27 03:15:42 2008
@@ -14,6 +14,20 @@
typedef struct bytecode bytecode;
+/* sub info structure, containing all info about a sub that a bytecode
+ * generator needs to know.
+ */
+typedef struct sub_info {
+ char const * const subname;
+ char const * const nsentry;
+ char const * const subid;
+ int vtable_index;
+ unsigned regs_used[4];
+ int startoffset;
+ int endoffset;
+
+} sub_info;
+
bytecode *new_bytecode(Interp *interp, char const * const filename, int bytes,
int codesize);
Modified: trunk/compilers/pirc/new/pircompunit.h
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.h (original)
+++ trunk/compilers/pirc/new/pircompunit.h Sat Dec 27 03:15:42 2008
@@ -13,6 +13,10 @@
#ifndef PARROT_PIR_PIRCOMPUNIT_H_GUARD
#define PARROT_PIR_PIRCOMPUNIT_H_GUARD
+/* needed for sub_info structure definition */
+#include "bcgen.h"
+
+
/* the 4 parrot types; use explicit values that match the values in
* PDD03_calling_conventions.pod.
*/
@@ -162,7 +166,7 @@
* or key nodes, such as ["x";42].
*/
typedef struct expression {
- union __expression_union {
+ union expression_union {
struct target *t;
constant *c;
char const *id;
@@ -263,7 +267,7 @@
/* a hashtable bucket for storing something */
typedef struct bucket {
- union __bucket_union {
+ union bucket_union {
char const *str;
struct symbol *sym;
struct local_label *loc;
@@ -308,6 +312,8 @@
int startoffset; /* start offset in bytecode where this
sub starts */
int endoffset; /* end offset in bytecode where this
sub ends */
+ sub_info info;
+
/* XXX the whole multi stuff must be implemented */
char **multi_types; /* data types of parameters if this is
a multi sub */
Modified: trunk/compilers/pirc/new/pirsymbol.h
==============================================================================
--- trunk/compilers/pirc/new/pirsymbol.h (original)
+++ trunk/compilers/pirc/new/pirsymbol.h Sat Dec 27 03:15:42 2008
@@ -9,8 +9,6 @@
* a pir_reg object represents a PIR symbolic register ($I0, $S1, etc.).
* For each symbol/pir-reg in a sub, there is only one corresponding
* symbol/pir_reg object.
- * References to these symbols are stored as target nodes (during the
- * parse), which will point to these symbol or pir_reg objects.
*/
#ifndef PARROT_PIR_PIRSYMBOL_H_GUARD