|
@@ -230,6 +230,8 @@ type
|
|
|
function emit_shortstring_const(const str: shortstring): tdef;
|
|
|
{ emit a guid constant }
|
|
|
procedure emit_guid_const(const guid: tguid);
|
|
|
+ { emit an ordinal constant }
|
|
|
+ procedure emit_ord_const(value: int64; def: tdef);
|
|
|
|
|
|
{ begin a potential aggregate type. Must be called for any type
|
|
|
that consists of multiple tai constant data entries, or that
|
|
@@ -1051,6 +1053,23 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
+ procedure ttai_typedconstbuilder.emit_ord_const(value: int64; def: tdef);
|
|
|
+ begin
|
|
|
+ case def.size of
|
|
|
+ 1:
|
|
|
+ emit_tai(Tai_const.Create_8bit(byte(value)),def);
|
|
|
+ 2:
|
|
|
+ emit_tai(Tai_const.Create_16bit(word(value)),def);
|
|
|
+ 4:
|
|
|
+ emit_tai(Tai_const.Create_32bit(longint(value)),def);
|
|
|
+ 8:
|
|
|
+ emit_tai(Tai_const.Create_64bit(value),def);
|
|
|
+ else
|
|
|
+ internalerror(2014100501);
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
+
|
|
|
procedure ttai_typedconstbuilder.maybe_begin_aggregate(def: tdef);
|
|
|
begin
|
|
|
begin_aggregate_internal(def,false);
|