Browse Source

* finished -ix output

git-svn-id: trunk@48936 -
florian 4 years ago
parent
commit
8fa04a0cee
1 changed files with 119 additions and 8 deletions
  1. 119 8
      compiler/options.pas

+ 119 - 8
compiler/options.pas

@@ -283,6 +283,22 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListOSTargetsXML;
+  var
+    target : tsystem;
+  begin
+    WriteLn(xmloutput,'    <ostargets>');
+    for target:=low(tsystem) to high(tsystem) do
+    if assigned(targetinfos[target]) then
+      begin
+        Write(xmloutput,'      <ostarget shortname="',targetinfos[target]^.shortname,'" name="',targetinfos[target]^.name,'"');
+        if tf_under_development in targetinfos[target]^.flags then
+          Write(' experimental="1"');
+        WriteLn('/>');
+      end;
+    WriteLn(xmloutput,'    </ostargets>');
+  end;
+
   procedure ListCPUInstructionSets (OrigString: TCmdStr);
   procedure ListCPUInstructionSets (OrigString: TCmdStr);
   var
   var
     cpu : tcputype;
     cpu : tcputype;
@@ -321,6 +337,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListCPUInstructionSetsXML;
+  var
+    cpu : tcputype;
+  begin
+    WriteLn(xmloutput,'    <cpuinstructionsets>');
+    for cpu:=low(tcputype) to high(tcputype) do
+      if CPUTypeStr [CPU] <> '' then
+        WriteLn(xmloutput,'      <cpuinstructionset name="',CPUTypeStr [CPU], '"/>');
+    WriteLn(xmloutput,'    </cpuinstructionsets>');
+  end;
+
   procedure ListFPUInstructionSets (OrigString: TCmdStr);
   procedure ListFPUInstructionSets (OrigString: TCmdStr);
   var
   var
     fpu : tfputype;
     fpu : tfputype;
@@ -359,6 +386,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListFPUInstructionSetsXML;
+  var
+    fpu : tfputype;
+  begin
+    WriteLn(xmloutput,'    <fpuinstructionsets>');
+    for fpu:=low(tfputype) to high(tfputype) do
+      if FPUTypeStr [fpu] <> '' then
+        WriteLn(xmloutput,'      <cpuinstructionset name="',FPUTypeStr [fpu], '"/>');
+    WriteLn(xmloutput,'    </fpuinstructionsets>');
+  end;
+
   procedure ListABITargets (OrigString: TCmdStr);
   procedure ListABITargets (OrigString: TCmdStr);
   var
   var
     abi : tabi;
     abi : tabi;
@@ -383,6 +421,21 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListABITargetsXML;
+  var
+    abi : tabi;
+  begin
+    WriteLn(xmloutput,'    <abis>');
+    for abi:=low(abi) to high(abi) do
+     begin
+      if not abiinfo[abi].supported then
+        continue;
+      if abiinfo[abi].name<>'' then;
+        WriteLn(xmloutput,'      <abi name="',abiinfo[abi].name, '"/>');
+     end;
+    WriteLn(xmloutput,'    </abis>');
+  end;
+
   procedure ListOptimizations (OrigString: TCmdStr);
   procedure ListOptimizations (OrigString: TCmdStr);
   var
   var
     opt : toptimizerswitch;
     opt : toptimizerswitch;
@@ -412,11 +465,11 @@ const
   var
   var
     opt: toptimizerswitch;
     opt: toptimizerswitch;
   begin
   begin
-    WriteLn(xmloutput,'<optimizations>');
+    WriteLn(xmloutput,'    <optimizations>');
     for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
     for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
       if OptimizerSwitchStr[opt]<>'' then
       if OptimizerSwitchStr[opt]<>'' then
-        WriteLn(xmloutput,'<optimization name="',OptimizerSwitchStr[opt],'"/>');
-    WriteLn(xmloutput,'</optimizations>');
+        WriteLn(xmloutput,'      <optimization name="',OptimizerSwitchStr[opt],'"/>');
+    WriteLn(xmloutput,'    </optimizations>');
   end;
   end;
 
 
   procedure ListWPOptimizations (OrigString: TCmdStr);
   procedure ListWPOptimizations (OrigString: TCmdStr);
@@ -446,6 +499,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListWPOptimizationsXML;
+  var
+    wpopt: twpoptimizerswitch;
+  begin
+    WriteLn(xmloutput,'    <wpoptimizations>');
+    for wpopt:=low(twpoptimizerswitch) to high(twpoptimizerswitch) do
+      if WPOptimizerSwitchStr[wpopt]<>'' then
+        WriteLn(xmloutput,'      <wpoptimization name="',WPOptimizerSwitchStr[wpopt],'"/>');
+    WriteLn(xmloutput,'    </wpoptimizations>');
+  end;
+
   procedure ListAsmModes (OrigString: TCmdStr);
   procedure ListAsmModes (OrigString: TCmdStr);
   var
   var
     asmmode : tasmmode;
     asmmode : tasmmode;
@@ -469,6 +533,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListAsmModesXML;
+  var
+    asmmode : tasmmode;
+  begin
+    WriteLn(xmloutput,'    <asmmodes>');
+    for asmmode:=low(tasmmode) to high(tasmmode) do
+      if assigned(asmmodeinfos[asmmode]) then
+        WriteLn(xmloutput,'        <asmmode name="',asmmodeinfos[asmmode]^.idtxt,'"/>');
+    WriteLn(xmloutput,'    </asmmodes>');
+  end;
+
   procedure ListControllerTypes (OrigString: TCmdStr);
   procedure ListControllerTypes (OrigString: TCmdStr);
   var
   var
     controllertype : tcontrollertype;
     controllertype : tcontrollertype;
@@ -522,11 +597,11 @@ const
  {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
  {$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
     if (ControllerSupport) then
     if (ControllerSupport) then
      begin
      begin
-      WriteLn(xmloutput,'<controllertypes>');
+      WriteLn(xmloutput,'    <controllertypes>');
       for controllertype:=low(tcontrollertype) to high(tcontrollertype) do
       for controllertype:=low(tcontrollertype) to high(tcontrollertype) do
         if embedded_controllers[controllertype].ControllerTypeStr<>'' then
         if embedded_controllers[controllertype].ControllerTypeStr<>'' then
-          WriteLn(xmloutput,'<controllertype name="',embedded_controllers[controllertype].ControllerTypeStr,'"/>');
-      WriteLn(xmloutput,'</controllertypes>');
+          WriteLn(xmloutput,'      <controllertype name="',embedded_controllers[controllertype].ControllerTypeStr,'"/>');
+      WriteLn(xmloutput,'    </controllertypes>');
      end;
      end;
 {$POP}
 {$POP}
   end;
   end;
@@ -569,6 +644,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListFeaturesXML;
+  var
+    Feature: TFeature;
+  begin
+    WriteLn(xmloutput,'    <features>');
+    for Feature := Low (TFeature) to High (TFeature) do
+      if FeatureStr [Feature] <> '' then
+         WriteLn(xmloutput,'      <feature name="',FeatureStr [Feature],'"/>');
+    WriteLn(xmloutput,'    </features>');
+  end;
+
   procedure ListModeswitches (OrigString: TCmdStr);
   procedure ListModeswitches (OrigString: TCmdStr);
   var
   var
     Modeswitch: TModeswitch;
     Modeswitch: TModeswitch;
@@ -607,6 +693,17 @@ const
      end;
      end;
   end;
   end;
 
 
+  procedure ListModeswitchesXML;
+  var
+    Modeswitch: TModeswitch;
+  begin
+    WriteLn(xmloutput,'    <modeswitches>');
+    for Modeswitch:=Low(TModeswitch) to High(TModeswitch) do
+      if ModeswitchStr [Modeswitch]<>'' then
+        WriteLn(xmloutput,'      <modeswitch name="',ModeswitchStr [Modeswitch],'"/>');
+    WriteLn(xmloutput,'    </modeswitches>');
+  end;
+
   procedure ListCodeGenerationBackend (OrigString: TCmdStr);
   procedure ListCodeGenerationBackend (OrigString: TCmdStr);
     begin
     begin
       SplitLine (OrigString, CodeGenerationBackendPlaceholder, HS3);
       SplitLine (OrigString, CodeGenerationBackendPlaceholder, HS3);
@@ -621,6 +718,11 @@ const
         end;
         end;
     end;
     end;
 
 
+  procedure ListCodeGenerationBackendXML;
+    begin
+      WriteLn(xmloutput,'    <codegeneratorbackend>',cgbackend2str[cgbackend],'</codegeneratorbackend>');
+    end;
+
 begin
 begin
   if More = '' then
   if More = '' then
    begin
    begin
@@ -662,10 +764,19 @@ begin
       Rewrite(xmloutput);
       Rewrite(xmloutput);
       WriteLn(xmloutput,'<?xml version="1.0" encoding="utf-8"?>');
       WriteLn(xmloutput,'<?xml version="1.0" encoding="utf-8"?>');
       WriteLn(xmloutput,'<fpcoutput>');
       WriteLn(xmloutput,'<fpcoutput>');
-      WriteLn(xmloutput,'<info>');
+      WriteLn(xmloutput,'  <info>');
+      ListOSTargetsXML;
+      ListCPUInstructionSetsXML;
+      ListFPUInstructionSetsXML;
+      ListABITargetsXML;
       ListOptimizationsXML;
       ListOptimizationsXML;
+      ListWPOptimizationsXML;
+      ListModeswitchesXML;
+      ListAsmModesXML;
       ListControllerTypesXML;
       ListControllerTypesXML;
-      WriteLn(xmloutput,'</info>');
+      ListFeaturesXML;
+      ListCodeGenerationBackendXML;
+      WriteLn(xmloutput,'  </info>');
       WriteLn(xmloutput,'</fpcoutput>');
       WriteLn(xmloutput,'</fpcoutput>');
       Close(xmloutput);
       Close(xmloutput);
    end
    end