* support for flushing a ttai_typedconstbuilder queue with an ordinal

constant at the end (in case of e.g. ordinal -> pointer type
    conversions)

git-svn-id: branches/hlcgllvm@30128 -
This commit is contained in:
Jonas Maebe 2015-03-07 21:43:57 +00:00
parent eba3f534de
commit c1e7c9de02
2 changed files with 18 additions and 0 deletions

View File

@ -281,6 +281,8 @@ type
procedure queue_emit_const(cs: tconstsym); virtual;
{ ... asmsym/asmlabel }
procedure queue_emit_asmsym(sym: tasmsymbol; def: tdef); virtual;
{ ... an ordinal constant }
procedure queue_emit_ordconst(value: int64; def: tdef); virtual;
{ finalize the internal asmlist (if necessary) and return it.
This asmlist will be freed when the builder is destroyed, so add its
@ -1266,6 +1268,12 @@ implementation
fqueue_offset:=low(fqueue_offset);
end;
procedure ttai_typedconstbuilder.queue_emit_ordconst(value: int64; def: tdef);
begin
emit_ord_const(value,def);
fqueue_offset:=low(fqueue_offset);
end;
{****************************************************************************
tai_abstracttypedconst

View File

@ -79,6 +79,7 @@ interface
procedure queue_typeconvn(fromdef, todef: tdef); override;
procedure queue_emit_staticvar(vs: tstaticvarsym); override;
procedure queue_emit_asmsym(sym: tasmsymbol; def: tdef); override;
procedure queue_emit_ordconst(value: int64; def: tdef); override;
class function get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint; override;
end;
@ -487,6 +488,15 @@ implementation
end;
procedure tllvmtai_typedconstbuilder.queue_emit_ordconst(value: int64; def: tdef);
begin
{ no offset into an ordinal constant }
if fqueue_offset<>0 then
internalerror(2015030702);
inherited;
end;
class function tllvmtai_typedconstbuilder.get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint;
begin
{ LLVM does not support labels in the middle of a declaration }