mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-26 03:02:30 +02:00
* 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:
parent
eba3f534de
commit
c1e7c9de02
@ -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
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user