mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 08:19:36 +01:00 
			
		
		
		
	* mark each target switch with whether it's global or not, so a compiler
directive can be added that enables changing the local ones git-svn-id: trunk@23562 -
This commit is contained in:
		
							parent
							
								
									185f71762f
								
							
						
					
					
						commit
						4022c29500
					
				@ -511,7 +511,7 @@ interface
 | 
			
		||||
    function UpdateOptimizerStr(s:string;var a:toptimizerswitches):boolean;
 | 
			
		||||
    function UpdateWpoStr(s: string; var a: twpoptimizerswitches): boolean;
 | 
			
		||||
    function UpdateDebugStr(s:string;var a:tdebugswitches):boolean;
 | 
			
		||||
    function UpdateTargetSwitchStr(s: string; var a: ttargetswitches): boolean;
 | 
			
		||||
    function UpdateTargetSwitchStr(s: string; var a: ttargetswitches; global: boolean): boolean;
 | 
			
		||||
    function IncludeFeature(const s : string) : boolean;
 | 
			
		||||
    function SetMinFPConstPrec(const s: string; var a: tfloattype) : boolean;
 | 
			
		||||
 | 
			
		||||
@ -1342,7 +1342,7 @@ implementation
 | 
			
		||||
      end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    function UpdateTargetSwitchStr(s: string; var a: ttargetswitches): boolean;
 | 
			
		||||
    function UpdateTargetSwitchStr(s: string; var a: ttargetswitches; global: boolean): boolean;
 | 
			
		||||
      var
 | 
			
		||||
        tok,
 | 
			
		||||
        value : string;
 | 
			
		||||
@ -1387,7 +1387,10 @@ implementation
 | 
			
		||||
            end;
 | 
			
		||||
          if found then
 | 
			
		||||
            begin
 | 
			
		||||
              if not TargetSwitchStr[opt].hasvalue then
 | 
			
		||||
              if not global and
 | 
			
		||||
                 TargetSwitchStr[opt].isglobal then
 | 
			
		||||
                result:=false
 | 
			
		||||
              else if not TargetSwitchStr[opt].hasvalue then
 | 
			
		||||
                begin
 | 
			
		||||
                  if gotvalue then
 | 
			
		||||
                    result:=false;
 | 
			
		||||
 | 
			
		||||
@ -278,6 +278,7 @@ interface
 | 
			
		||||
       ttargetswitchinfo = record
 | 
			
		||||
          name: string[22];
 | 
			
		||||
          hasvalue: boolean;
 | 
			
		||||
          isglobal: boolean;
 | 
			
		||||
       end;
 | 
			
		||||
 | 
			
		||||
    const
 | 
			
		||||
@ -296,13 +297,13 @@ interface
 | 
			
		||||
         'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
 | 
			
		||||
 | 
			
		||||
       TargetSwitchStr : array[ttargetswitch] of ttargetswitchinfo = (
 | 
			
		||||
         (name: '';                    hasvalue: false),
 | 
			
		||||
         (name: 'SMALLTOC';            hasvalue: false),
 | 
			
		||||
         (name: 'COMPACTINTARRAYINIT'; hasvalue: false),
 | 
			
		||||
         (name:  'ENUMFIELDINIT';      hasvalue: false),
 | 
			
		||||
         (name: 'AUTOGETTERPREFIX';    hasvalue: true ),
 | 
			
		||||
         (name: 'AUTOSETTERPREFIX';    hasvalue: true ),
 | 
			
		||||
         (name: 'THUMBINTERWORKING';   hasvalue: true )
 | 
			
		||||
         (name: '';                    hasvalue: false; isglobal: true ),
 | 
			
		||||
         (name: 'SMALLTOC';            hasvalue: false; isglobal: true ),
 | 
			
		||||
         (name: 'COMPACTINTARRAYINIT'; hasvalue: false; isglobal: true ),
 | 
			
		||||
         (name: 'ENUMFIELDINIT';       hasvalue: false; isglobal: true ),
 | 
			
		||||
         (name: 'AUTOGETTERPREFIX';    hasvalue: true ; isglobal: false),
 | 
			
		||||
         (name: 'AUTOSETTERPREFIX';    hasvalue: true ; isglobal: false),
 | 
			
		||||
         (name: 'THUMBINTERWORKING';   hasvalue: false; isglobal: true )
 | 
			
		||||
       );
 | 
			
		||||
 | 
			
		||||
       { switches being applied to all CPUs at the given level }
 | 
			
		||||
 | 
			
		||||
@ -976,7 +976,7 @@ begin
 | 
			
		||||
                         include(init_settings.moduleswitches,cs_create_smart);
 | 
			
		||||
                    'T' :
 | 
			
		||||
                      begin
 | 
			
		||||
                        if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches) then
 | 
			
		||||
                        if not UpdateTargetSwitchStr(copy(more,j+1,length(more)),init_settings.targetswitches,true) then
 | 
			
		||||
                          IllegalPara(opt);
 | 
			
		||||
                        break;
 | 
			
		||||
                      end;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user