mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:49:23 +02:00
* support for dynamic strings and arrays in update_reference_reg_mul()
git-svn-id: trunk@30784 -
This commit is contained in:
parent
eae68e86a1
commit
8034ef1f31
@ -184,11 +184,19 @@ implementation
|
|||||||
end;
|
end;
|
||||||
hreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,getpointerdef(resultdef));
|
hreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,getpointerdef(resultdef));
|
||||||
location.reference:=thlcgllvm(hlcg).make_simple_ref(current_asmdata.CurrAsmList,location.reference,left.resultdef);
|
location.reference:=thlcgllvm(hlcg).make_simple_ref(current_asmdata.CurrAsmList,location.reference,left.resultdef);
|
||||||
{ get address of indexed array element and convert pointer to array into
|
if not is_dynamicstring(left.resultdef) and
|
||||||
pointer to the elementdef in the process }
|
not is_dynamic_array(left.resultdef) then
|
||||||
current_asmdata.CurrAsmList.Concat(taillvm.getelementptr_reg_size_ref_size_reg(hreg,getpointerdef(left.resultdef),
|
begin
|
||||||
location.reference,ptruinttype,maybe_const_reg,true));
|
{ get address of indexed array element and convert pointer to array into
|
||||||
arraytopointerconverted:=true;
|
pointer to the elementdef in the process }
|
||||||
|
current_asmdata.CurrAsmList.Concat(taillvm.getelementptr_reg_size_ref_size_reg(hreg,getpointerdef(left.resultdef),
|
||||||
|
location.reference,ptruinttype,maybe_const_reg,true));
|
||||||
|
arraytopointerconverted:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
{ the array is already a pointer -> just index }
|
||||||
|
current_asmdata.CurrAsmList.Concat(taillvm.getelementptr_reg_size_ref_size_reg(hreg,left.resultdef,
|
||||||
|
location.reference,ptruinttype,maybe_const_reg,false));
|
||||||
reference_reset_base(location.reference,hreg,0,location.reference.alignment);
|
reference_reset_base(location.reference,hreg,0,location.reference.alignment);
|
||||||
location.reference.alignment:=newalignment(location.reference.alignment,l);
|
location.reference.alignment:=newalignment(location.reference.alignment,l);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user