diff --git a/.gitattributes b/.gitattributes index 50d6f19cc8..e0f7ce02a5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -53,6 +53,7 @@ compiler/arm/cpunode.pas svneol=native#text/plain compiler/arm/cpupara.pas svneol=native#text/plain compiler/arm/cpupi.pas svneol=native#text/plain compiler/arm/cputarg.pas svneol=native#text/plain +compiler/arm/hlcgcpu.pas svneol=native#text/plain compiler/arm/itcpugas.pas svneol=native#text/plain compiler/arm/narmadd.pas svneol=native#text/plain compiler/arm/narmcal.pas svneol=native#text/plain @@ -164,6 +165,7 @@ compiler/i386/cpupi.pas svneol=native#text/plain compiler/i386/cputarg.pas svneol=native#text/plain compiler/i386/csopt386.pas svneol=native#text/plain compiler/i386/daopt386.pas svneol=native#text/plain +compiler/i386/hlcgcpu.pas svneol=native#text/plain compiler/i386/i386att.inc svneol=native#text/plain compiler/i386/i386atts.inc svneol=native#text/plain compiler/i386/i386int.inc svneol=native#text/plain @@ -218,6 +220,7 @@ compiler/m68k/cpunode.pas svneol=native#text/plain compiler/m68k/cpupara.pas svneol=native#text/plain compiler/m68k/cpupi.pas svneol=native#text/plain compiler/m68k/cputarg.pas svneol=native#text/plain +compiler/m68k/hlcgcpu.pas svneol=native#text/plain compiler/m68k/itcpugas.pas svneol=native#text/plain compiler/m68k/m68kreg.dat svneol=native#text/plain compiler/m68k/n68kadd.pas svneol=native#text/plain @@ -251,6 +254,7 @@ compiler/mips/cpunode.pas svneol=native#text/plain compiler/mips/cpupara.pas svneol=native#text/plain compiler/mips/cpupi.pas svneol=native#text/plain compiler/mips/cputarg.pas svneol=native#text/pascal +compiler/mips/hlcgcpu.pas svneol=native#text/plain compiler/mips/itcpugas.pas svneol=native#text/plain compiler/mips/mipsreg.dat svneol=native#text/plain compiler/mips/ncpuadd.pas svneol=native#text/plain @@ -378,6 +382,7 @@ compiler/powerpc/cpunode.pas svneol=native#text/plain compiler/powerpc/cpupara.pas svneol=native#text/plain compiler/powerpc/cpupi.pas svneol=native#text/plain compiler/powerpc/cputarg.pas svneol=native#text/plain +compiler/powerpc/hlcgcpu.pas svneol=native#text/plain compiler/powerpc/itcpugas.pas svneol=native#text/plain compiler/powerpc/nppcadd.pas svneol=native#text/plain compiler/powerpc/nppccal.pas svneol=native#text/plain @@ -412,6 +417,7 @@ compiler/powerpc64/cpunode.pas svneol=native#text/plain compiler/powerpc64/cpupara.pas svneol=native#text/plain compiler/powerpc64/cpupi.pas svneol=native#text/plain compiler/powerpc64/cputarg.pas svneol=native#text/plain +compiler/powerpc64/hlcgcpu.pas svneol=native#text/plain compiler/powerpc64/itcpugas.pas svneol=native#text/plain compiler/powerpc64/nppcadd.pas svneol=native#text/plain compiler/powerpc64/nppccal.pas svneol=native#text/plain @@ -487,6 +493,7 @@ compiler/sparc/cpunode.pas svneol=native#text/plain compiler/sparc/cpupara.pas svneol=native#text/plain compiler/sparc/cpupi.pas svneol=native#text/plain compiler/sparc/cputarg.pas svneol=native#text/plain +compiler/sparc/hlcgcpu.pas svneol=native#text/plain compiler/sparc/itcpugas.pas svneol=native#text/plain compiler/sparc/ncpuadd.pas svneol=native#text/plain compiler/sparc/ncpucall.pas svneol=native#text/plain @@ -644,6 +651,7 @@ compiler/x86_64/cpunode.pas svneol=native#text/plain compiler/x86_64/cpupara.pas svneol=native#text/plain compiler/x86_64/cpupi.pas svneol=native#text/plain compiler/x86_64/cputarg.pas svneol=native#text/plain +compiler/x86_64/hlcgcpu.pas svneol=native#text/plain compiler/x86_64/nx64add.pas svneol=native#text/plain compiler/x86_64/nx64cal.pas svneol=native#text/plain compiler/x86_64/nx64cnv.pas svneol=native#text/plain diff --git a/compiler/arm/hlcgcpu.pas b/compiler/arm/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/arm/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/expunix.pas b/compiler/expunix.pas index 9bf7ae3919..ffc4727714 100644 --- a/compiler/expunix.pas +++ b/compiler/expunix.pas @@ -59,7 +59,7 @@ uses aasmdata,aasmtai,aasmcpu, fmodule, cgbase,cgutils,cpubase,cgobj, - cgcpu, + cgcpu,hlcgobj,hlcgcpu, ncgutil, verbose; @@ -136,7 +136,7 @@ var r : treference; {$endif x86} begin - create_codegen; + create_hlcodegen; new_section(current_asmdata.asmlists[al_procedures],sec_code,'',0); hp2:=texported_item(current_module._exports.first); while assigned(hp2) do @@ -182,7 +182,7 @@ begin end; hp2:=texported_item(hp2.next); end; - destroy_codegen; + destroy_hlcodegen; end; diff --git a/compiler/i386/hlcgcpu.pas b/compiler/i386/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/i386/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/m68k/hlcgcpu.pas b/compiler/m68k/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/m68k/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/mips/hlcgcpu.pas b/compiler/mips/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/mips/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 5c17e84399..5aec29768e 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -174,7 +174,7 @@ implementation regvars,dbgbase, pass_1,pass_2, nbas,ncon,nld,nmem,nutils, - tgobj,cgobj,cgcpu + tgobj,cgobj,cgcpu,hlcgobj,hlcgcpu {$ifdef powerpc} , cpupi {$endif} @@ -2482,7 +2482,7 @@ implementation procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string); begin - create_codegen; + create_hlcodegen; { add the procedure to the al_procedures } maybe_new_object_file(list); new_section(list,sec_code,lower(pd.mangledname),current_settings.alignment.procalign); @@ -2493,7 +2493,7 @@ implementation list.concat(Tai_symbol.createname(pd.mangledname,AT_FUNCTION,0)); cg.g_external_wrapper(list,pd,externalname); - destroy_codegen; + destroy_hlcodegen; end; {**************************************************************************** @@ -3030,7 +3030,7 @@ implementation def : tdef; begin if not nested then - create_codegen; + create_hlcodegen; for i:=0 to st.DefList.Count-1 do begin def:=tdef(st.DefList[i]); @@ -3041,7 +3041,7 @@ implementation gen_intf_wrapper(list,tobjectdef(def)); end; if not nested then - destroy_codegen; + destroy_hlcodegen; end; diff --git a/compiler/powerpc/hlcgcpu.pas b/compiler/powerpc/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/powerpc/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/powerpc64/hlcgcpu.pas b/compiler/powerpc64/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/powerpc64/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/psub.pas b/compiler/psub.pas index 165b427337..9ac4d0a505 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -98,7 +98,7 @@ implementation scanner,import,gendef, pbase,pstatmnt,pdecl,pdecsub,pexports, { codegen } - tgobj,cgbase,cgobj,cgcpu,dbgbase, + tgobj,cgbase,cgobj,cgcpu,hlcgobj,hlcgcpu,dbgbase, ncgutil,regvars, optbase, opttail, @@ -945,7 +945,7 @@ implementation { only do secondpass if there are no errors } if (ErrorCount=0) then begin - create_codegen; + create_hlcodegen; { set the start offset to the start of the temp area in the stack } tg:=ttgobj.create; @@ -1259,7 +1259,7 @@ implementation { stop tempgen and ra } tg.free; cg.done_register_allocators; - destroy_codegen; + destroy_hlcodegen; tg:=nil; end; diff --git a/compiler/sparc/hlcgcpu.pas b/compiler/sparc/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/sparc/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end. diff --git a/compiler/x86_64/hlcgcpu.pas b/compiler/x86_64/hlcgcpu.pas new file mode 100644 index 0000000000..ecffd1b79b --- /dev/null +++ b/compiler/x86_64/hlcgcpu.pas @@ -0,0 +1,45 @@ +{ + Copyright (c) 1998-2010 by Florian Klaempfl and Jonas Maebe + Member of the Free Pascal development team + + This unit contains routines to create a pass-through high-level code + generator. This is used by most regular code generators. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + **************************************************************************** +} + +unit hlcgcpu; + +{$i fpcdefs.inc} + +interface + + procedure create_hlcodegen; + +implementation + + uses + hlcgobj, hlcg2ll, + cgcpu; + + procedure create_hlcodegen; + begin + hlcg:=thlcg2ll.create; + create_codegen; + end; + +end.