summaryrefslogtreecommitdiff
path: root/compiler/avr/symcpu.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-03-29 22:31:55 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-03-29 22:31:55 +0000
commit0a3d011fc90f8dac768ae4da946ee8e93f7afa3d (patch)
treed29bc38b7a94294d109f886a16aef25ce3037d40 /compiler/avr/symcpu.pas
parentb254e20751a96451551fcb51351e0fabb2d8b19d (diff)
downloadfpc-0a3d011fc90f8dac768ae4da946ee8e93f7afa3d.tar.gz
+ support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym class o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym class from the base classes, and initialises the c*def/c*sym classes with them. This is done so that the llvm target will be able to derive from the tcpu*def/sym classes without umpteen ifdefs, and it also means that the WPO can devirtualise everything because the c* variables are only initialised with one class type o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor calls git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@27361 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/avr/symcpu.pas')
-rw-r--r--compiler/avr/symcpu.pas174
1 files changed, 174 insertions, 0 deletions
diff --git a/compiler/avr/symcpu.pas b/compiler/avr/symcpu.pas
new file mode 100644
index 0000000000..dc9f73c938
--- /dev/null
+++ b/compiler/avr/symcpu.pas
@@ -0,0 +1,174 @@
+{
+ Copyright (c) 2014 by Florian Klaempfl
+
+ Symbol table overrides for AVR
+
+ 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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+ symdef,symsym;
+
+type
+ { defs }
+ tcpufiledef = class(tfiledef)
+ end;
+
+ tcpuvariantdef = class(tvariantdef)
+ end;
+
+ tcpuformaldef = class(tformaldef)
+ end;
+
+ tcpuforwarddef = class(tforwarddef)
+ end;
+
+ tcpuundefineddef = class(tundefineddef)
+ end;
+
+ tcpuerrordef = class(terrordef)
+ end;
+
+ tcpupointerdef = class(tpointerdef)
+ end;
+
+ tcpurecorddef = class(trecorddef)
+ end;
+
+ tcpuimplementedinterface = class(timplementedinterface)
+ end;
+
+ tcpuobjectdef = class(tobjectdef)
+ end;
+
+ tcpuclassrefdef = class(tclassrefdef)
+ end;
+
+ tcpuarraydef = class(tarraydef)
+ end;
+
+ tcpuorddef = class(torddef)
+ end;
+
+ tcpufloatdef = class(tfloatdef)
+ end;
+
+ tcpuprocvardef = class(tprocvardef)
+ end;
+
+ tcpuprocdef = class(tprocdef)
+ end;
+
+ tcpustringdef = class(tstringdef)
+ end;
+
+ tcpuenumdef = class(tenumdef)
+ end;
+
+ tcpusetdef = class(tsetdef)
+ end;
+
+ { syms }
+ tcpulabelsym = class(tlabelsym)
+ end;
+
+ tcpuunitsym = class(tunitsym)
+ end;
+
+ tcpunamespacesym = class(tnamespacesym)
+ end;
+
+ tcpuprocsym = class(tprocsym)
+ end;
+
+ tcpuypesym = class(ttypesym)
+ end;
+
+ tcpufieldvarsym = class(tfieldvarsym)
+ end;
+
+ tcpulocalvarsym = class(tlocalvarsym)
+ end;
+
+ tcpuparavarsym = class(tparavarsym)
+ end;
+
+ tcpustaticvarsym = class(tstaticvarsym)
+ end;
+
+ tcpuabsolutevarsym = class(tabsolutevarsym)
+ end;
+
+ tcpupropertysym = class(tpropertysym)
+ end;
+
+ tcpuconstsym = class(tconstsym)
+ end;
+
+ tcpuenumsym = class(tenumsym)
+ end;
+
+ tcpusyssym = class(tsyssym)
+ end;
+
+
+implementation
+
+begin
+ { used tdef classes }
+ cfiledef:=tcpufiledef;
+ cvariantdef:=tcpuvariantdef;
+ cformaldef:=tcpuformaldef;
+ cforwarddef:=tcpuforwarddef;
+ cundefineddef:=tcpuundefineddef;
+ cerrordef:=tcpuerrordef;
+ cpointerdef:=tcpupointerdef;
+ crecorddef:=tcpurecorddef;
+ cimplementedinterface:=tcpuimplementedinterface;
+ cobjectdef:=tcpuobjectdef;
+ cclassrefdef:=tcpuclassrefdef;
+ carraydef:=tcpuarraydef;
+ corddef:=tcpuorddef;
+ cfloatdef:=tcpufloatdef;
+ cprocvardef:=tcpuprocvardef;
+ cprocdef:=tcpuprocdef;
+ cstringdef:=tcpustringdef;
+ cenumdef:=tcpuenumdef;
+ csetdef:=tcpusetdef;
+
+ { used tsym classes }
+ clabelsym:=tcpulabelsym;
+ cunitsym:=tcpuunitsym;
+ cnamespacesym:=tcpunamespacesym;
+ cprocsym:=tcpuprocsym;
+ ctypesym:=tcpuypesym;
+ cfieldvarsym:=tcpufieldvarsym;
+ clocalvarsym:=tcpulocalvarsym;
+ cparavarsym:=tcpuparavarsym;
+ cstaticvarsym:=tcpustaticvarsym;
+ cabsolutevarsym:=tcpuabsolutevarsym;
+ cpropertysym:=tcpupropertysym;
+ cconstsym:=tcpuconstsym;
+ cenumsym:=tcpuenumsym;
+ csyssym:=tcpusyssym;
+end.
+