Преглед на файлове

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

git-svn-id: trunk@38911 -
svenbarth преди 7 години
родител
ревизия
e59e9e2a0a
променени са 2 файла, в които са добавени 8 реда и са изтрити 8 реда
  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
           macrosymtablestack.push(hp.globalmacrosymtable);
         { insert unitsym }
-        unitsym:=cunitsym.create(s,hp);
+        unitsym:=cunitsym.create(s,hp,true);
         inc(unitsym.refs);
         tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
         if addasused then
@@ -487,7 +487,7 @@ implementation
                 can not use the modulename because that can be different
                 when -Un is used }
               current_tokenpos:=filepos;
-              unitsym:=cunitsym.create(sorg,nil);
+              unitsym:=cunitsym.create(sorg,nil,true);
               tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
               { the current module uses the unit hp2 }
               current_module.addusedunit(hp2,true,unitsym);
@@ -895,7 +895,7 @@ type
 
          { insert unitsym of this unit to prevent other units having
            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
            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.}
          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);
 
@@ -2073,7 +2073,7 @@ type
 
          {Insert the name of the main program into the symbol table.}
          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);
 

+ 3 - 3
compiler/symsym.pas

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