summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-10 20:33:49 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-10 20:33:49 +0000
commita8deedbaaba064a38434474e0d6e2ee8e19a586f (patch)
treeed4b8c83c75110c970790ed39fde3da8474ea71d
parent459b254d6c8bbefe98afdbddd81787c85ff79e22 (diff)
downloadfpc-a8deedbaaba064a38434474e0d6e2ee8e19a586f.tar.gz
* finished -ix output
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48936 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/options.pas127
1 files changed, 119 insertions, 8 deletions
diff --git a/compiler/options.pas b/compiler/options.pas
index 93dc60fc8d..0dab63c9f1 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -283,6 +283,22 @@ const
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);
var
cpu : tcputype;
@@ -321,6 +337,17 @@ const
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);
var
fpu : tfputype;
@@ -359,6 +386,17 @@ const
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);
var
abi : tabi;
@@ -383,6 +421,21 @@ const
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);
var
opt : toptimizerswitch;
@@ -412,11 +465,11 @@ const
var
opt: toptimizerswitch;
begin
- WriteLn(xmloutput,'<optimizations>');
+ WriteLn(xmloutput,' <optimizations>');
for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
if OptimizerSwitchStr[opt]<>'' then
- WriteLn(xmloutput,'<optimization name="',OptimizerSwitchStr[opt],'"/>');
- WriteLn(xmloutput,'</optimizations>');
+ WriteLn(xmloutput,' <optimization name="',OptimizerSwitchStr[opt],'"/>');
+ WriteLn(xmloutput,' </optimizations>');
end;
procedure ListWPOptimizations (OrigString: TCmdStr);
@@ -446,6 +499,17 @@ const
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);
var
asmmode : tasmmode;
@@ -469,6 +533,17 @@ const
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);
var
controllertype : tcontrollertype;
@@ -522,11 +597,11 @@ const
{$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
if (ControllerSupport) then
begin
- WriteLn(xmloutput,'<controllertypes>');
+ WriteLn(xmloutput,' <controllertypes>');
for controllertype:=low(tcontrollertype) to high(tcontrollertype) do
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;
{$POP}
end;
@@ -569,6 +644,17 @@ const
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);
var
Modeswitch: TModeswitch;
@@ -607,6 +693,17 @@ const
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);
begin
SplitLine (OrigString, CodeGenerationBackendPlaceholder, HS3);
@@ -621,6 +718,11 @@ const
end;
end;
+ procedure ListCodeGenerationBackendXML;
+ begin
+ WriteLn(xmloutput,' <codegeneratorbackend>',cgbackend2str[cgbackend],'</codegeneratorbackend>');
+ end;
+
begin
if More = '' then
begin
@@ -662,10 +764,19 @@ begin
Rewrite(xmloutput);
WriteLn(xmloutput,'<?xml version="1.0" encoding="utf-8"?>');
WriteLn(xmloutput,'<fpcoutput>');
- WriteLn(xmloutput,'<info>');
+ WriteLn(xmloutput,' <info>');
+ ListOSTargetsXML;
+ ListCPUInstructionSetsXML;
+ ListFPUInstructionSetsXML;
+ ListABITargetsXML;
ListOptimizationsXML;
+ ListWPOptimizationsXML;
+ ListModeswitchesXML;
+ ListAsmModesXML;
ListControllerTypesXML;
- WriteLn(xmloutput,'</info>');
+ ListFeaturesXML;
+ ListCodeGenerationBackendXML;
+ WriteLn(xmloutput,' </info>');
WriteLn(xmloutput,'</fpcoutput>');
Close(xmloutput);
end