+ GetExternalAssemblerWithAsmInfoWriter() to get a GNU-style external

assembler writer that is compatible with the current architecture,
    for use by the LLVM assembler writer to write inline assembly

git-svn-id: trunk@31631 -
This commit is contained in:
Jonas Maebe 2015-09-12 23:32:24 +00:00
parent 6dd06a1aae
commit 55e84df094

View File

@ -229,6 +229,11 @@ interface
Procedure GenerateAsm(smart:boolean);
{ get an instance of an external GNU-style assembler that is compatible
with the current target, reusing an existing writer. Used by the LLVM
target to write inline assembler }
function GetExternalGnuAssemblerWithAsmInfoWriter(info: pasminfo; wr: TExternalAssemblerOutputFile): TExternalAssembler;
procedure RegisterAssembler(const r:tasminfo;c:TAssemblerClass);
@ -2160,6 +2165,20 @@ Implementation
end;
function GetExternalAssemblerWithAsmInfoWriter(info: pasminfo; wr: TExternalAssemblerOutputFile): TExternalAssembler;
var
asmkind: tasm;
begin
for asmkind in [as_gas,as_ggas,as_darwin] do
if assigned(asminfos[asmkind]) and
(target_info.system in asminfos[asmkind]^.supported_targets) then
begin
result:=TExternalAssemblerClass(CAssembler[asmkind]).CreateWithWriter(asminfos[asmkind],wr,false,false);
exit;
end;
Internalerror(2015090604);
end;
{*****************************************************************************
Init/Done
*****************************************************************************}