|
@@ -40,8 +40,6 @@ interface
|
|
|
|
|
|
TLLVMMachineCodePlaygroundAssembler=class(TGNUassembler)
|
|
|
protected
|
|
|
- procedure WriteProcDef(pd: tprocdef);
|
|
|
- procedure WriteSymtableProcdefs(st: TSymtable);
|
|
|
procedure WriteImports;
|
|
|
|
|
|
function sectionname(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder):string;override;
|
|
@@ -69,51 +67,6 @@ implementation
|
|
|
{ TLLVMMachineCodePlaygroundAssembler }
|
|
|
|
|
|
|
|
|
- procedure TLLVMMachineCodePlaygroundAssembler.WriteProcDef(pd: tprocdef);
|
|
|
- begin
|
|
|
- if not assigned(tcpuprocdef(pd).exprasmlist) and
|
|
|
- not(po_abstractmethod in pd.procoptions) and
|
|
|
- (pd.proctypeoption in [potype_unitinit,potype_unitfinalize]) then
|
|
|
- exit;
|
|
|
-
|
|
|
- writer.AsmWriteLn(asminfo^.comment+'WriteProcDef('+pd.mangledname+')');
|
|
|
- WriteTree(tcpuprocdef(pd).exprasmlist);
|
|
|
- writer.AsmWriteLn(asminfo^.comment+'WriteProcDef('+pd.mangledname+') done');
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
- procedure TLLVMMachineCodePlaygroundAssembler.WriteSymtableProcdefs(st: TSymtable);
|
|
|
- var
|
|
|
- i : longint;
|
|
|
- def : tdef;
|
|
|
- begin
|
|
|
- if not assigned(st) then
|
|
|
- exit;
|
|
|
- for i:=0 to st.DefList.Count-1 do
|
|
|
- begin
|
|
|
- def:=tdef(st.DefList[i]);
|
|
|
- case def.typ of
|
|
|
- procdef :
|
|
|
- begin
|
|
|
- { methods are also in the static/globalsymtable of the unit
|
|
|
- -> make sure they are only written for the objectdefs that
|
|
|
- own them }
|
|
|
- if (not(st.symtabletype in [staticsymtable,globalsymtable]) or
|
|
|
- (def.owner=st)) and
|
|
|
- not(df_generic in def.defoptions) then
|
|
|
- begin
|
|
|
- WriteProcDef(tprocdef(def));
|
|
|
- if assigned(tprocdef(def).localst) then
|
|
|
- WriteSymtableProcdefs(tprocdef(def).localst);
|
|
|
- end;
|
|
|
- end;
|
|
|
- else
|
|
|
- ;
|
|
|
- end;
|
|
|
- end;
|
|
|
- end;
|
|
|
-
|
|
|
-
|
|
|
procedure TLLVMMachineCodePlaygroundAssembler.WriteImports;
|
|
|
var
|
|
|
i : integer;
|
|
@@ -182,8 +135,6 @@ implementation
|
|
|
begin
|
|
|
inherited;
|
|
|
{ print all global procedures/functions }
|
|
|
- WriteSymtableProcdefs(current_module.globalsymtable);
|
|
|
- WriteSymtableProcdefs(current_module.localsymtable);
|
|
|
writer.AsmWriteLn(#9'.globaltype'#9+STACK_POINTER_SYM+', i32');
|
|
|
WriteImports;
|
|
|
end;
|