From e8fca1c9c0d5a29d749a275b74b9d93dd960f318 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 4 Sep 2015 13:37:06 +0000 Subject: [PATCH] * move tspecializationstate from pgenutil.pas into a new unit named pgentype.pas which contains types related to generics with as few dependencies as possible. git-svn-id: trunk@31507 - --- .gitattributes | 1 + compiler/pgentype.pas | 43 +++++++++++++++++++++++++++++++++++++++++++ compiler/pgenutil.pas | 9 ++------- compiler/psub.pas | 2 +- 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 compiler/pgentype.pas diff --git a/.gitattributes b/.gitattributes index 7c9ee1f63b..5d0dad273f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -524,6 +524,7 @@ compiler/pdecsub.pas svneol=native#text/plain compiler/pdecvar.pas svneol=native#text/plain compiler/pexports.pas svneol=native#text/plain compiler/pexpr.pas svneol=native#text/plain +compiler/pgentype.pas svneol=native#text/pascal compiler/pgenutil.pas svneol=native#text/pascal compiler/pinline.pas svneol=native#text/plain compiler/pmodules.pas svneol=native#text/plain diff --git a/compiler/pgentype.pas b/compiler/pgentype.pas new file mode 100644 index 0000000000..5bcd26f077 --- /dev/null +++ b/compiler/pgentype.pas @@ -0,0 +1,43 @@ +{ + Copyright (c) 2015 by Sven Barth + + Contains different types that are used in the context of parsing generics. + + 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 pgentype; + +{$i fpcdefs.inc} + +interface + +uses + cclasses, + symbase; + +type + tspecializationstate = record + oldsymtablestack : tsymtablestack; + oldextendeddefs : tfphashobjectlist; + oldgenericdummysyms: tfphashobjectlist; + end; + + +implementation + +end. + diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 423caabbd1..772e5acb8f 100644 --- a/compiler/pgenutil.pas +++ b/compiler/pgenutil.pas @@ -31,6 +31,8 @@ uses cclasses, { global } globtype, + { parser } + pgentype, { symtable } symtype,symdef,symbase; @@ -45,13 +47,6 @@ uses function resolve_generic_dummysym(const name:tidstring):tsym; function could_be_generic(const name:tidstring):boolean;inline; - type - tspecializationstate = record - oldsymtablestack : tsymtablestack; - oldextendeddefs : TFPHashObjectList; - oldgenericdummysyms: tfphashobjectlist; - end; - procedure specialization_init(genericdef:tdef;var state:tspecializationstate); procedure specialization_done(var state:tspecializationstate); diff --git a/compiler/psub.pas b/compiler/psub.pas index ef00909983..94102adea1 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -113,7 +113,7 @@ implementation {$endif} { parser } scanner,gendef, - pbase,pstatmnt,pdecl,pdecsub,pexports,pgenutil,pparautl, + pbase,pstatmnt,pdecl,pdecsub,pexports,pgenutil,pparautl,pgentype, { codegen } tgobj,cgbase,cgobj,cgutils,hlcgobj,hlcgcpu,dbgbase, {$ifdef llvm}