LLVM: factor out writing operands in agllvm

This commit is contained in:
Jonas Maebe 2022-04-09 15:01:22 +02:00
parent 411fa298ae
commit 4293d4455c

View File

@ -99,6 +99,7 @@ interface
function getopcodestr(hp: taillvm): TSymStr;
function getopstr(const o:toper; refwithalign: boolean) : TSymStr;
procedure writetaioper(ai: tai);
procedure writeparas(const paras: tfplist);
procedure WriteAsmRegisterAllocationClobbers(list: tasmlist);
end;
@ -437,8 +438,6 @@ implementation
function TLLVMInstrWriter.getopstr(const o:toper; refwithalign: boolean) : TSymStr;
var
hp: tai;
tmpinline: cardinal;
tmpasmblock: boolean;
begin
case o.typ of
top_reg:
@ -493,12 +492,7 @@ implementation
begin
if assigned(o.ai) then
begin
tmpinline:=1;
tmpasmblock:=false;
hp:=o.ai;
owner.writer.AsmWrite(fstr);
fstr:='';
owner.WriteTai(false,false,false,tmpinline,tmpasmblock,hp);
writetaioper(o.ai);
end;
result:='';
end;
@ -517,6 +511,16 @@ implementation
end;
end;
procedure TLLVMInstrWriter.writetaioper(ai: tai);
var
tmpinline: cardinal;
tmpasmblock: boolean;
begin
tmpinline:=1;
tmpasmblock:=false;
owner.WriteTai(false,false,false,tmpinline,tmpasmblock,ai);
end;
procedure TLLVMInstrWriter.WriteAsmRegisterAllocationClobbers(list: tasmlist);
var