* emit custom Objective-C names in the LLVM assembler writer

git-svn-id: trunk@32912 -
This commit is contained in:
Jonas Maebe 2016-01-10 17:22:06 +00:00
parent 9e4806f21a
commit 5959f45694

View File

@ -85,6 +85,7 @@ implementation
SysUtils, SysUtils,
cutils,cfileutl, cutils,cfileutl,
fmodule,verbose, fmodule,verbose,
objcasm,
aasmcnst,symconst,symdef,symtable, aasmcnst,symconst,symdef,symtable,
llvmbase,aasmllvm,itllvm,llvmdef, llvmbase,aasmllvm,itllvm,llvmdef,
cgbase,cgutils,cpubase,llvminfo; cgbase,cgutils,cpubase,llvminfo;
@ -994,8 +995,6 @@ implementation
writer.AsmWrite('thread_local '); writer.AsmWrite('thread_local ');
if ldf_unnamed_addr in taillvmdecl(hp).flags then if ldf_unnamed_addr in taillvmdecl(hp).flags then
writer.AsmWrite('unnamed_addr '); writer.AsmWrite('unnamed_addr ');
{ todo: handle more different section types (mainly
Objective-C }
if taillvmdecl(hp).sec in [sec_rodata,sec_rodata_norel] then if taillvmdecl(hp).sec in [sec_rodata,sec_rodata_norel] then
writer.AsmWrite('constant ') writer.AsmWrite('constant ')
else else
@ -1023,12 +1022,20 @@ implementation
dec(fdecllevel); dec(fdecllevel);
end; end;
{ custom section name? } { custom section name? }
if taillvmdecl(hp).sec=sec_user then case taillvmdecl(hp).sec of
begin sec_user:
writer.AsmWrite(', section "'); begin
writer.AsmWrite(taillvmdecl(hp).secname); writer.AsmWrite(', section "');
writer.AsmWrite('"'); writer.AsmWrite(taillvmdecl(hp).secname);
end; writer.AsmWrite('"');
end;
low(TObjCAsmSectionType)..high(TObjCAsmSectionType):
begin
writer.AsmWrite(', section "');
writer.AsmWrite(objc_section_name(taillvmdecl(hp).sec));
writer.AsmWrite('"');
end;
end;
{ alignment } { alignment }
writer.AsmWrite(', align '); writer.AsmWrite(', align ');
writer.AsmWriteln(tostr(taillvmdecl(hp).alignment)); writer.AsmWriteln(tostr(taillvmdecl(hp).alignment));