Browse Source

* extend tunitsym to be created as registered or not (for now all are created as registered)

git-svn-id: trunk@38911 -
svenbarth 7 years ago
parent
commit
e59e9e2a0a
2 changed files with 8 additions and 8 deletions
  1. 5 5
      compiler/pmodules.pas
  2. 3 3
      compiler/symsym.pas

+ 5 - 5
compiler/pmodules.pas

@@ -188,7 +188,7 @@ implementation
            assigned(hp.globalmacrosymtable) then
            assigned(hp.globalmacrosymtable) then
           macrosymtablestack.push(hp.globalmacrosymtable);
           macrosymtablestack.push(hp.globalmacrosymtable);
         { insert unitsym }
         { insert unitsym }
-        unitsym:=cunitsym.create(s,hp);
+        unitsym:=cunitsym.create(s,hp,true);
         inc(unitsym.refs);
         inc(unitsym.refs);
         tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
         tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
         if addasused then
         if addasused then
@@ -487,7 +487,7 @@ implementation
                 can not use the modulename because that can be different
                 can not use the modulename because that can be different
                 when -Un is used }
                 when -Un is used }
               current_tokenpos:=filepos;
               current_tokenpos:=filepos;
-              unitsym:=cunitsym.create(sorg,nil);
+              unitsym:=cunitsym.create(sorg,nil,true);
               tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
               tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
               { the current module uses the unit hp2 }
               { the current module uses the unit hp2 }
               current_module.addusedunit(hp2,true,unitsym);
               current_module.addusedunit(hp2,true,unitsym);
@@ -895,7 +895,7 @@ type
 
 
          { insert unitsym of this unit to prevent other units having
          { insert unitsym of this unit to prevent other units having
            the same name }
            the same name }
-         tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
+         tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module,true));
 
 
          { load default system unit, it must be loaded before interface is parsed
          { load default system unit, it must be loaded before interface is parsed
            else we cannot use e.g. feature switches before the next real token }
            else we cannot use e.g. feature switches before the next real token }
@@ -1644,7 +1644,7 @@ type
 
 
          {Insert the name of the main program into the symbol table.}
          {Insert the name of the main program into the symbol table.}
          if current_module.realmodulename^<>'' then
          if current_module.realmodulename^<>'' then
-           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
+           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module,true));
 
 
          Message1(parser_u_parsing_implementation,current_module.mainsource);
          Message1(parser_u_parsing_implementation,current_module.mainsource);
 
 
@@ -2073,7 +2073,7 @@ type
 
 
          {Insert the name of the main program into the symbol table.}
          {Insert the name of the main program into the symbol table.}
          if current_module.realmodulename^<>'' then
          if current_module.realmodulename^<>'' then
-           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
+           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module,true));
 
 
          Message1(parser_u_parsing_implementation,current_module.mainsource);
          Message1(parser_u_parsing_implementation,current_module.mainsource);
 
 

+ 3 - 3
compiler/symsym.pas

@@ -80,7 +80,7 @@ interface
 
 
        tunitsym = class(Tstoredsym)
        tunitsym = class(Tstoredsym)
           module : tobject; { tmodule }
           module : tobject; { tmodule }
-          constructor create(const n : string;amodule : tobject);virtual;
+          constructor create(const n : string;amodule : tobject;doregister:boolean);virtual;
           constructor ppuload(ppufile:tcompilerppufile);
           constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
           destructor destroy;override;
           { do not override this routine in platform-specific subclasses,
           { do not override this routine in platform-specific subclasses,
@@ -690,9 +690,9 @@ implementation
                                   TUNITSYM
                                   TUNITSYM
 ****************************************************************************}
 ****************************************************************************}
 
 
-    constructor tunitsym.create(const n : string;amodule : tobject);
+    constructor tunitsym.create(const n : string;amodule : tobject;doregister:boolean);
       begin
       begin
-         inherited create(unitsym,n,true);
+         inherited create(unitsym,n,doregister);
          module:=amodule;
          module:=amodule;
       end;
       end;