Sfoglia il codice sorgente

Move member variable "section" to tprocdef. Type of "section" to agree with symansistr define.

ccrause 3 anni fa
parent
commit
665c1b3966
3 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. 5 0
      compiler/hlcgobj.pas
  2. 4 0
      compiler/pdecsub.pas
  3. 5 1
      compiler/symdef.pas

+ 5 - 0
compiler/hlcgobj.pas

@@ -5497,8 +5497,13 @@ implementation
         alt:=al_pure_assembler;
       { add the procedure to the al_procedures }
       maybe_new_object_file(current_asmdata.asmlists[alt]);
+{$ifdef symansistr}
       if pd.section<>'' then
         new_proc_section(current_asmdata.asmlists[alt],sec_user,lower(pd.section),getprocalign)
+{$else symansistr}
+      if assigned(pd.section) then
+        new_proc_section(current_asmdata.asmlists[alt],sec_user,lower(pd.section^),getprocalign)
+{$endif symansistr}
       else
         new_section(current_asmdata.asmlists[alt],sec_code,lower(pd.mangledname),getprocalign);
       current_asmdata.asmlists[alt].concatlist(code);

+ 4 - 0
compiler/pdecsub.pas

@@ -2422,7 +2422,11 @@ begin
     internalerror(2021032801);
   if not (target_info.system in systems_allow_section) then
     Comment(V_Error,'Directive section not allowed for this target.');
+{$ifdef symansistr}
   tprocdef(pd).section:=get_stringconst;
+{$else symansistr}
+  tprocdef(pd).section:=stringdup(get_stringconst);
+{$endif}
 end;
 
 type

+ 5 - 1
compiler/symdef.pas

@@ -695,7 +695,6 @@ interface
           { number of user visible parameters }
           maxparacount,
           minparacount    : byte;
-          section : ansistring;
           constructor create(dt:tdeftyp;level:byte;doregister:boolean);
           constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
           destructor destroy;override;
@@ -866,6 +865,11 @@ interface
           visibility   : tvisibility;
 {$ifndef DISABLE_FAST_OVERLOAD_PATCH}
           seenmarker : pointer; // used for filtering in tcandidate
+{$endif}
+{$ifdef symansistr}
+         section: ansistring;
+{$else symansistr}
+         section: pshortstring;
 {$endif}
           constructor create(level:byte;doregister:boolean);virtual;
           constructor ppuload(ppufile:tcompilerppufile);