* put the code for pure assembler routines in a separate asmlist, so

we can easily use a different assembler writer for them on the
    llvm target

git-svn-id: trunk@31630 -
This commit is contained in:
Jonas Maebe 2015-09-12 23:32:21 +00:00
parent c80fb6a20e
commit 6dd06a1aae
2 changed files with 13 additions and 4 deletions

View File

@ -46,6 +46,8 @@ interface
TAsmListType=(
al_start,
al_stabs,
{ pure assembler routines }
al_pure_assembler,
al_procedures,
al_globals,
al_const,
@ -97,6 +99,7 @@ interface
AsmListTypeStr : array[TAsmListType] of string[24] =(
'al_begin',
'al_stabs',
'al_pure_assembler',
'al_procedures',
'al_globals',
'al_const',

View File

@ -5228,15 +5228,21 @@ implementation
end;
procedure thlcgobj.record_generated_code_for_procdef(pd: tprocdef; code, data: TAsmList);
var
alt: TAsmListType;
begin
if not(po_assembler in pd.procoptions) then
alt:=al_procedures
else
alt:=al_pure_assembler;
{ add the procedure to the al_procedures }
maybe_new_object_file(current_asmdata.asmlists[al_procedures]);
new_section(current_asmdata.asmlists[al_procedures],sec_code,lower(pd.mangledname),getprocalign);
current_asmdata.asmlists[al_procedures].concatlist(code);
maybe_new_object_file(current_asmdata.asmlists[alt]);
new_section(current_asmdata.asmlists[alt],sec_code,lower(pd.mangledname),getprocalign);
current_asmdata.asmlists[alt].concatlist(code);
{ save local data (casetable) also in the same file }
if assigned(data) and
(not data.empty) then
current_asmdata.asmlists[al_procedures].concatlist(data);
current_asmdata.asmlists[alt].concatlist(data);
end;
function thlcgobj.g_call_system_proc(list: TAsmList; const procname: string; const paras: array of pcgpara; forceresdef: tdef): tcgpara;