Explorar el Código

* 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 -

Jonas Maebe hace 10 años
padre
commit
c1e7c9de02
Se han modificado 2 ficheros con 18 adiciones y 0 borrados
  1. 8 0
      compiler/aasmcnst.pas
  2. 10 0
      compiler/llvm/nllvmtcon.pas

+ 8 - 0
compiler/aasmcnst.pas

@@ -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

+ 10 - 0
compiler/llvm/nllvmtcon.pas

@@ -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 }