Bläddra i källkod

+ extend tundefineddef with the possiblity to create it as unregistered
* for now all undefineddefs are created as registered
Note: an additional parameter instead of an overload is used for tundefineddef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes...

git-svn-id: trunk@31757 -

svenbarth 10 år sedan
förälder
incheckning
040786e5bb
5 ändrade filer med 8 tillägg och 8 borttagningar
  1. 1 1
      compiler/pdecl.pas
  2. 1 1
      compiler/pexpr.pas
  3. 2 2
      compiler/pgenutil.pas
  4. 1 1
      compiler/psystem.pas
  5. 3 3
      compiler/symdef.pas

+ 1 - 1
compiler/pdecl.pas

@@ -592,7 +592,7 @@ implementation
                   sym:=tsym(symtablestack.top.Find(typename));
                   sym:=tsym(symtablestack.top.Find(typename));
                   if not assigned(sym) then
                   if not assigned(sym) then
                     begin
                     begin
-                      sym:=ctypesym.create(orgtypename,cundefineddef.create,true);
+                      sym:=ctypesym.create(orgtypename,cundefineddef.create(true),true);
                       Include(sym.symoptions,sp_generic_dummy);
                       Include(sym.symoptions,sp_generic_dummy);
                       ttypesym(sym).typedef.typesym:=sym;
                       ttypesym(sym).typedef.typesym:=sym;
                       sym.visibility:=symtablestack.top.currentvisibility;
                       sym.visibility:=symtablestack.top.currentvisibility;

+ 1 - 1
compiler/pexpr.pas

@@ -2950,7 +2950,7 @@ implementation
                 undefinedsym :
                 undefinedsym :
                   begin
                   begin
                     p1:=cnothingnode.Create;
                     p1:=cnothingnode.Create;
-                    p1.resultdef:=cundefineddef.create;
+                    p1.resultdef:=cundefineddef.create(true);
                     { clean up previously created dummy symbol }
                     { clean up previously created dummy symbol }
                     srsym.free;
                     srsym.free;
                   end;
                   end;

+ 2 - 2
compiler/pgenutil.pas

@@ -1228,7 +1228,7 @@ uses
                   { two different typeless parameters are considered as incompatible }
                   { two different typeless parameters are considered as incompatible }
                   for i:=firstidx to result.count-1 do
                   for i:=firstidx to result.count-1 do
                     begin
                     begin
-                      ttypesym(result[i]).typedef:=cundefineddef.create;
+                      ttypesym(result[i]).typedef:=cundefineddef.create(true);
                       ttypesym(result[i]).typedef.typesym:=ttypesym(result[i]);
                       ttypesym(result[i]).typedef.typesym:=ttypesym(result[i]);
                     end;
                     end;
                   { a semicolon terminates a type parameter group }
                   { a semicolon terminates a type parameter group }
@@ -1239,7 +1239,7 @@ uses
         { two different typeless parameters are considered as incompatible }
         { two different typeless parameters are considered as incompatible }
         for i:=firstidx to result.count-1 do
         for i:=firstidx to result.count-1 do
           begin
           begin
-            ttypesym(result[i]).typedef:=cundefineddef.create;
+            ttypesym(result[i]).typedef:=cundefineddef.create(true);
             ttypesym(result[i]).typedef.typesym:=ttypesym(result[i]);
             ttypesym(result[i]).typedef.typesym:=ttypesym(result[i]);
           end;
           end;
         block_type:=old_block_type;
         block_type:=old_block_type;

+ 1 - 1
compiler/psystem.pas

@@ -202,7 +202,7 @@ implementation
         hrecst : trecordsymtable;
         hrecst : trecordsymtable;
       begin
       begin
         symtablestack.push(systemunit);
         symtablestack.push(systemunit);
-        cundefinedtype:=cundefineddef.create;
+        cundefinedtype:=cundefineddef.create(true);
         cformaltype:=cformaldef.create(false);
         cformaltype:=cformaldef.create(false);
         ctypedformaltype:=cformaldef.create(true);
         ctypedformaltype:=cformaldef.create(true);
         voidtype:=corddef.create(uvoid,0,0);
         voidtype:=corddef.create(uvoid,0,0);

+ 3 - 3
compiler/symdef.pas

@@ -188,7 +188,7 @@ interface
        tforwarddefclass = class of tforwarddef;
        tforwarddefclass = class of tforwarddef;
 
 
        tundefineddef = class(tstoreddef)
        tundefineddef = class(tstoreddef)
-          constructor create;virtual;
+          constructor create(doregister:boolean);virtual;
           constructor ppuload(ppufile:tcompilerppufile);
           constructor ppuload(ppufile:tcompilerppufile);
           { do not override this routine in platform-specific subclasses,
           { do not override this routine in platform-specific subclasses,
             override ppuwrite_platform instead }
             override ppuwrite_platform instead }
@@ -7360,9 +7360,9 @@ implementation
                                TUNDEFINEDDEF
                                TUNDEFINEDDEF
 ****************************************************************************}
 ****************************************************************************}
 
 
-   constructor tundefineddef.create;
+   constructor tundefineddef.create(doregister:boolean);
      begin
      begin
-        inherited create(undefineddef,true);
+        inherited create(undefineddef,doregister);
      end;
      end;