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