+ support for LLVM nil assembler symbols in instructions (write as "null")

+ support for LLVM nil tai operands (will be used for terminating a daisy
    chain of catch/filter clauses of landingpads): don't try to write it

git-svn-id: trunk@35160 -
This commit is contained in:
Jonas Maebe 2016-12-18 13:57:39 +00:00
parent 746de569d5
commit 28e5636daa
2 changed files with 17 additions and 7 deletions

View File

@ -399,7 +399,10 @@ implementation
if o.ref^.refaddr=addr_full then
begin
getopstr:='';
getopstr:=LlvmAsmSymName(o.ref^.symbol);
if assigned(o.ref^.symbol) then
getopstr:=LlvmAsmSymName(o.ref^.symbol)
else
getopstr:='null';
if o.ref^.offset<>0 then
internalerror(2013060223);
end
@ -437,12 +440,15 @@ implementation
end;
top_tai:
begin
tmpinline:=1;
tmpasmblock:=false;
hp:=o.ai;
owner.writer.AsmWrite(fstr);
fstr:='';
owner.WriteTai(false,false,tmpinline,tmpasmblock,hp);
if assigned(o.ai) then
begin
tmpinline:=1;
tmpasmblock:=false;
hp:=o.ai;
owner.writer.AsmWrite(fstr);
fstr:='';
owner.WriteTai(false,false,tmpinline,tmpasmblock,hp);
end;
result:='';
end;
{$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)}

View File

@ -217,6 +217,8 @@ implementation
var
value: tai_abstracttypedconst;
begin
if not assigned(p) then
exit;
case p.typ of
ait_llvmalias:
begin
@ -388,6 +390,8 @@ implementation
procedure TLLVMTypeInfo.insert_tai_typeconversions(toplevellist: tasmlist; p: tai);
begin
if not assigned(p) then
exit;
case p.typ of
ait_llvmins:
insert_llvmins_typeconversions(toplevellist,taillvm(p));