Update of /var/lib/cvs/src/d2c/compiler/base
In directory cantor:/tmp/cvs-serv9763/d2c/compiler/base
Modified Files:
Tag: GD_2_5
base-exports.dylan c-rep.dylan
Log Message:
Wicked C-rep hackery to get opaque, assignable composite C types past
call-out and friends.
Index: base-exports.dylan
===================================================================
RCS file: /var/lib/cvs/src/d2c/compiler/base/base-exports.dylan,v
retrieving revision 1.41.2.6
retrieving revision 1.41.2.7
diff -u -d -r1.41.2.6 -r1.41.2.7
--- base-exports.dylan 1 Sep 2003 13:32:15 -0000 1.41.2.6
+++ base-exports.dylan 23 Oct 2003 13:21:42 -0000 1.41.2.7
@@ -790,6 +790,7 @@
<general-representation>,
<heap-representation>,
<immediate-representation>,
+ <magic-representation>,
<c-data-word-representation>,
representation-class,
Index: c-rep.dylan
===================================================================
RCS file: /var/lib/cvs/src/d2c/compiler/base/c-rep.dylan,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- c-rep.dylan 5 Dec 2002 21:12:00 -0000 1.11
+++ c-rep.dylan 23 Oct 2003 13:21:42 -0000 1.11.2.1
@@ -110,6 +110,9 @@
#f;
end method representation-has-bottom-value?;
+define class <magic-representation> (<c-representation>)
+end class <magic-representation>;
+
define class <c-data-word-representation>
(<immediate-representation>, <data-word-representation>)
slot representation-class :: <cclass>, init-keyword: class:;
@@ -368,7 +371,17 @@
#"ptr" => *ptr-rep*;
#"void" => #f;
otherwise =>
- error("unknown c-rep %=", c-type);
+ // XXX Magic C type hack
+ let c-type-string = as(<string>, c-type);
+ make(<magic-representation>, name: c-type,
+ more-general: *ptr-rep*,
+ from-more-general:
+ concatenate("(*((", c-type-string, "*)%s))"),
+ to-more-general:
+ #f,
+ alignment: 0, size: 0,
+ c-type: as(<string>, c-type));
+// error("unknown c-rep %=", c-type);
end;
end method;
_______________________________________________
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
http://www.gwydiondylan.org/mailman/listinfo/gd-chatter
|