Browse Source

* override queue_emit_staticvar() and set the offset to 0 there for the same
reason as with queue_emit_asmsym()

git-svn-id: branches/hlcgllvm@28145 -

Jonas Maebe 11 years ago
parent
commit
ab186e8d75
1 changed files with 11 additions and 0 deletions
  1. 11 0
      compiler/llvm/nllvmtcon.pas

+ 11 - 0
compiler/llvm/nllvmtcon.pas

@@ -63,6 +63,7 @@ interface
       procedure queue_vecn(def: tdef; const index: tconstexprint); override;
       procedure queue_subscriptn(def: tabstractrecorddef; vs: tfieldvarsym); override;
       procedure queue_typeconvn(fromdef, todef: tdef); override;
+      procedure queue_emit_staticvar(vs: tstaticvarsym); override;
       procedure queue_emit_asmsym(sym: tasmsymbol; def: tdef); override;
 
       class function get_string_symofs(typ: tstringtype; winlikewidestring: boolean): pint; override;
@@ -339,6 +340,16 @@ implementation
     end;
 
 
+  procedure tllvmtai_typedconstbuilder.queue_emit_staticvar(vs: tstaticvarsym);
+    begin
+      { we've already incorporated the offset via the inserted operations above,
+        make sure it doesn't get emitted again as part of the tai_const for
+        the tasmsymbol }
+      fqueue_offset:=0;
+      inherited;
+    end;
+
+
   procedure tllvmtai_typedconstbuilder.queue_emit_asmsym(sym: tasmsymbol; def: tdef);
     begin
       { we've already incorporated the offset via the inserted operations above,