* emit the current offset when flushing tasmsymbols in the

ttai_lowleveltypedconstbuilder
   o set the offset to 0 in the llvm constbuilder before calling
     the lowlevel one, because it incorporates this offset already
     via getelementptr instructions

git-svn-id: branches/hlcgllvm@28136 -
This commit is contained in:
Jonas Maebe 2014-07-02 17:25:02 +00:00
parent e0c1c4d3bf
commit a284902813
2 changed files with 12 additions and 1 deletions

View File

@ -562,7 +562,7 @@ implementation
{ getpointerdef, because "sym" represents the address of whatever the
data is }
def:=getpointerdef(def);
emit_tai(Tai_const.Create_sym(sym),def);
emit_tai(Tai_const.Create_sym_offset(sym,fqueue_offset),def);
fqueue_offset:=low(fqueue_offset);
end;

View File

@ -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_asmsym(sym: tasmsymbol; def: tdef); override;
end;
implementation
@ -336,6 +337,16 @@ implementation
end;
procedure tllvmtai_typedconstbuilder.queue_emit_asmsym(sym: tasmsymbol; def: tdef);
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;
begin
ctai_typedconstbuilder:=tllvmtai_typedconstbuilder;
end.