瀏覽代碼

+ 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 年之前
父節點
當前提交
040786e5bb
共有 5 個文件被更改,包括 8 次插入8 次删除
  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));
                   if not assigned(sym) then
                     begin
-                      sym:=ctypesym.create(orgtypename,cundefineddef.create,true);
+                      sym:=ctypesym.create(orgtypename,cundefineddef.create(true),true);
                       Include(sym.symoptions,sp_generic_dummy);
                       ttypesym(sym).typedef.typesym:=sym;
                       sym.visibility:=symtablestack.top.currentvisibility;

+ 1 - 1
compiler/pexpr.pas

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

+ 2 - 2
compiler/pgenutil.pas

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

+ 1 - 1
compiler/psystem.pas

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

+ 3 - 3
compiler/symdef.pas

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