mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 18:10:23 +02:00
+ initial (and so far experimental) implementation of -ix to output -i in xml format for further automated processing
git-svn-id: trunk@48897 -
This commit is contained in:
parent
9fbaa28df7
commit
b0772ae749
@ -212,6 +212,7 @@ var
|
|||||||
p : pchar;
|
p : pchar;
|
||||||
hs,hs1,hs3,s : TCmdStr;
|
hs,hs1,hs3,s : TCmdStr;
|
||||||
J: longint;
|
J: longint;
|
||||||
|
xmloutput: Text;
|
||||||
const
|
const
|
||||||
NewLineStr = '$\n';
|
NewLineStr = '$\n';
|
||||||
OSTargetsPlaceholder = '$OSTARGETS';
|
OSTargetsPlaceholder = '$OSTARGETS';
|
||||||
@ -407,6 +408,17 @@ const
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure ListOptimizationsXML;
|
||||||
|
var
|
||||||
|
opt: toptimizerswitch;
|
||||||
|
begin
|
||||||
|
WriteLn(xmloutput,'<optimizations>');
|
||||||
|
for opt:=low(toptimizerswitch) to high(toptimizerswitch) do
|
||||||
|
if OptimizerSwitchStr[opt]<>'' then
|
||||||
|
WriteLn(xmloutput,'<optimization name="',OptimizerSwitchStr[opt],'"/>');
|
||||||
|
WriteLn(xmloutput,'</optimizations>');
|
||||||
|
end;
|
||||||
|
|
||||||
procedure ListWPOptimizations (OrigString: TCmdStr);
|
procedure ListWPOptimizations (OrigString: TCmdStr);
|
||||||
var
|
var
|
||||||
wpopt: twpoptimizerswitch;
|
wpopt: twpoptimizerswitch;
|
||||||
@ -502,6 +514,23 @@ const
|
|||||||
{$POP}
|
{$POP}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure ListControllerTypesXML;
|
||||||
|
var
|
||||||
|
controllertype : tcontrollertype;
|
||||||
|
begin
|
||||||
|
{$PUSH}
|
||||||
|
{$WARN 6018 OFF} (* Unreachable code due to compile time evaluation *)
|
||||||
|
if (ControllerSupport) then
|
||||||
|
begin
|
||||||
|
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>');
|
||||||
|
end;
|
||||||
|
{$POP}
|
||||||
|
end;
|
||||||
|
|
||||||
procedure ListFeatures (OrigString: TCmdStr);
|
procedure ListFeatures (OrigString: TCmdStr);
|
||||||
var
|
var
|
||||||
Feature: TFeature;
|
Feature: TFeature;
|
||||||
@ -627,6 +656,19 @@ begin
|
|||||||
Comment(V_Normal,s);
|
Comment(V_Normal,s);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
else if Copy(More,1,1) = 'x' then
|
||||||
|
begin
|
||||||
|
Assign(xmloutput,Copy(More,2,length(More)-1));
|
||||||
|
Rewrite(xmloutput);
|
||||||
|
WriteLn(xmloutput,'<?xml version="1.0" encoding="utf-8"?>');
|
||||||
|
WriteLn(xmloutput,'<fpcoutput>');
|
||||||
|
WriteLn(xmloutput,'<info>');
|
||||||
|
ListOptimizationsXML;
|
||||||
|
ListControllerTypesXML;
|
||||||
|
WriteLn(xmloutput,'</info>');
|
||||||
|
WriteLn(xmloutput,'</fpcoutput>');
|
||||||
|
Close(xmloutput);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
J := 1;
|
J := 1;
|
||||||
@ -1952,7 +1994,7 @@ begin
|
|||||||
'i' :
|
'i' :
|
||||||
begin
|
begin
|
||||||
if (More='') or
|
if (More='') or
|
||||||
(More [1] in ['a', 'b', 'c', 'f', 'i', 'm', 'o', 'r', 't', 'u', 'w']) then
|
(More [1] in ['a', 'b', 'c', 'f', 'i', 'm', 'o', 'r', 't', 'u', 'w', 'x']) then
|
||||||
WriteInfo (More)
|
WriteInfo (More)
|
||||||
else
|
else
|
||||||
QuickInfo:=QuickInfo+More;
|
QuickInfo:=QuickInfo+More;
|
||||||
|
Loading…
Reference in New Issue
Block a user