IDE: compiler options: added option to show the lines compiled messsage as important

git-svn-id: trunk@49883 -
This commit is contained in:
mattias 2015-09-27 20:09:52 +00:00
parent ff65e8f6c6
commit 1fe2796bd0
6 changed files with 40 additions and 12 deletions

View File

@ -136,7 +136,6 @@ type
procedure SetGenerateDwarf(const AValue: Boolean);
procedure SetGenGProfCode(const AValue: Boolean);
procedure SetHeapSize(const AValue: Integer);
procedure SetStackSize(const AValue: Integer);
procedure SetIncludeAssertionCode(const AValue: Boolean);
procedure SetInitConst(const AValue: Boolean);
procedure SetIOChecks(const AValue: Boolean);
@ -145,6 +144,7 @@ type
procedure SetOverflowChecks(const AValue: Boolean);
procedure SetPassLinkerOpt(const AValue: Boolean);
procedure SetRangeChecks(const AValue: Boolean);
procedure SetRelocatableUnit(const AValue: Boolean);
procedure SetShowAll(const AValue: Boolean);
procedure SetShowCompProc(const AValue: Boolean);
procedure SetShowCond(const AValue: Boolean);
@ -152,6 +152,7 @@ type
procedure SetShowErrors(const AValue: Boolean);
procedure SetShowExecInfo(const AValue: Boolean);
procedure SetShowGenInfo(const AValue: Boolean);
procedure SetShowLinesCompiled(const AValue: Boolean);
procedure SetShowHints(const AValue: Boolean);
procedure SetShowHintsForSenderNotUsed(const AValue: Boolean);
procedure SetShowHintsForUnusedUnitsInMainSrc(const AValue: Boolean);
@ -161,23 +162,23 @@ type
procedure SetShowTriedFiles(const AValue: Boolean);
procedure SetShowUsedFiles(const AValue: Boolean);
procedure SetShowWarn(const AValue: Boolean);
procedure SetSmallerCode(const AValue: boolean);
procedure SetSmartLinkUnit(const AValue: Boolean);
procedure SetRelocatableUnit(const AValue: Boolean);
procedure SetStackChecks(const AValue: Boolean);
procedure SetStackSize(const AValue: Integer);
procedure SetStaticKeyword(const AValue: Boolean);
procedure SetStopAfterErrCount(const AValue: integer);
procedure SetStripSymbols(const AValue: Boolean);
procedure SetSyntaxMode(const AValue: string);
procedure SetTargetFilenameAppplyConventions(const AValue: boolean);
procedure SetTrashVariables(const AValue: Boolean);
procedure SetUncertainOpt(const AValue: Boolean);
procedure SetUseAnsiStr(const AValue: Boolean);
procedure SetUseExternalDbgSyms(const AValue: Boolean);
procedure SetUseHeaptrc(const AValue: Boolean);
procedure SetTrashVariables(const AValue: Boolean);
procedure SetUseLineInfoUnit(const AValue: Boolean);
procedure SetUseValgrind(const AValue: Boolean);
procedure SetUncertainOpt(const AValue: Boolean);
procedure SetVarsInReg(const AValue: Boolean);
procedure SetSmallerCode(const AValue: boolean);
procedure SetVerifyObjMethodCall(const AValue: boolean);
procedure SetWin32GraphicApp(const AValue: boolean);
procedure SetWriteFPCLogo(const AValue: Boolean);
@ -259,6 +260,7 @@ type
fShowCond: Boolean;
fShowExecInfo: Boolean;
fShowSummary: Boolean;
fShowLinesCompiled: Boolean;
fShowHintsForUnusedUnitsInMainSrc: Boolean;
fShowHintsForSenderNotUsed: Boolean;
fWriteFPCLogo: Boolean;
@ -421,6 +423,7 @@ type
property ShowCond: Boolean read fShowCond write SetShowCond; // -vc
property ShowExecInfo: Boolean read fShowExecInfo write SetShowExecInfo; // -vx
property ShowSummary: Boolean read FShowSummary write SetShowSummary; deprecated; // summary is now always shown (in the header)
property ShowLinesCompiled: Boolean read fShowLinesCompiled write SetShowLinesCompiled;
property ShowHintsForUnusedUnitsInMainSrc: Boolean
read fShowHintsForUnusedUnitsInMainSrc write SetShowHintsForUnusedUnitsInMainSrc;
property ShowHintsForSenderNotUsed: Boolean
@ -737,6 +740,13 @@ begin
IncreaseChangeStamp;
end;
procedure TLazCompilerOptions.SetShowLinesCompiled(const AValue: Boolean);
begin
if fShowLinesCompiled=AValue then Exit;
fShowLinesCompiled:=AValue;
IncreaseChangeStamp;
end;
procedure TLazCompilerOptions.SetStackSize(const AValue: Integer);
begin
if fStackSize=AValue then exit;

View File

@ -309,6 +309,7 @@ type
private
FHideHintsSenderNotUsed: boolean;
FHideHintsUnitNotUsedInMainSource: boolean;
FShowLinesCompiled: boolean;
protected
FFilesToIgnoreUnitNotUsed: TStrings;
public
@ -321,6 +322,8 @@ type
class function GetFPCMsgValues(Msg: TMessageLine; out Value1, Value2: string): boolean; virtual; abstract;
property FilesToIgnoreUnitNotUsed: TStrings read FFilesToIgnoreUnitNotUsed
write FFilesToIgnoreUnitNotUsed;
property ShowLinesCompiled: boolean read FShowLinesCompiled
write FShowLinesCompiled default false;
property HideHintsSenderNotUsed: boolean read FHideHintsSenderNotUsed
write FHideHintsSenderNotUsed default true;
property HideHintsUnitNotUsedInMainSource: boolean

View File

@ -337,6 +337,7 @@ begin
Tool.CmdLineParams:=CmdLine;
Tool.Process.CurrentDirectory:=WorkingDir;
FPCParser:=TFPCParser(Tool.AddParsers(SubToolFPC));
FPCParser.ShowLinesCompiled:=AProject.CompilerOptions.ShowLinesCompiled;
FPCParser.HideHintsSenderNotUsed:=not AProject.CompilerOptions.ShowHintsForSenderNotUsed;
FPCParser.HideHintsUnitNotUsedInMainSource:=not AProject.CompilerOptions.ShowHintsForUnusedUnitsInMainSrc;
if (not AProject.CompilerOptions.ShowHintsForUnusedUnitsInMainSrc)

View File

@ -1652,6 +1652,7 @@ begin
ShowCond := aXMLConfig.GetValue(p+'Verbosity/ShowCond/Value', false);
ShowExecInfo := aXMLConfig.GetValue(p+'Verbosity/ShowExecInfo/Value', false);
fShowSummary := aXMLConfig.GetValue(p+'Verbosity/ShowSummary/Value', false);
ShowLinesCompiled:=aXMLConfig.GetValue(p+'Verbosity/ShowLinesCompiled/Value', false);
ShowHintsForUnusedUnitsInMainSrc := aXMLConfig.GetValue(p+'Verbosity/ShowHintsForUnusedUnitsInMainSrc/Value', false);
ShowHintsForSenderNotUsed := aXMLConfig.GetValue(p+'Verbosity/ShowHintsForSenderNotUsed/Value', false);
WriteFPCLogo := aXMLConfig.GetValue(p+'WriteFPCLogo/Value', true);
@ -1835,6 +1836,7 @@ begin
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowCond/Value', ShowCond,false);
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowExecInfo/Value', ShowExecInfo,false);
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowSummary/Value', fShowSummary,false);
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowLinesCompiled/Value', ShowLinesCompiled,false);
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowHintsForUnusedUnitsInMainSrc/Value', ShowHintsForUnusedUnitsInMainSrc,false);
aXMLConfig.SetDeleteValue(p+'Verbosity/ShowHintsForSenderNotUsed/Value', ShowHintsForSenderNotUsed,false);
aXMLConfig.SetDeleteValue(p+'WriteFPCLogo/Value', WriteFPCLogo,true);
@ -3262,6 +3264,7 @@ begin
fShowCond := false;
fShowExecInfo := false;
fShowSummary := false;
fShowLinesCompiled := false;
fShowHintsForUnusedUnitsInMainSrc := false;
fShowHintsForSenderNotUsed := false;
fWriteFPCLogo := true;
@ -3374,6 +3377,7 @@ begin
fShowCond := CompOpts.fShowCond;
fShowCond := CompOpts.fShowExecInfo;
fShowSummary := CompOpts.FShowSummary;
fShowLinesCompiled := CompOpts.fShowLinesCompiled;
fShowHintsForUnusedUnitsInMainSrc := CompOpts.fShowHintsForUnusedUnitsInMainSrc;
fShowHintsForSenderNotUsed := CompOpts.fShowHintsForSenderNotUsed;
fWriteFPCLogo := CompOpts.fWriteFPCLogo;
@ -3523,6 +3527,7 @@ begin
if Done(Tool.AddDiff('ShowCond',fShowCond,CompOpts.fShowCond)) then exit;
if Done(Tool.AddDiff('ShowExecInfo',fShowExecInfo,CompOpts.fShowExecInfo)) then exit;
if Done(Tool.AddDiff('ShowSummary',fShowSummary,CompOpts.fShowSummary)) then exit;
if Done(Tool.AddDiff('ShowLinesCompiled',fShowLinesCompiled,CompOpts.fShowLinesCompiled)) then exit;
if Done(Tool.AddDiff('ShowHintsForUnusedUnitsInMainSrc',fShowHintsForUnusedUnitsInMainSrc,CompOpts.fShowHintsForUnusedUnitsInMainSrc)) then exit;
if Done(Tool.AddDiff('ShowHintsForSenderNotUsed',fShowHintsForSenderNotUsed,CompOpts.fShowHintsForSenderNotUsed)) then exit;
if Done(Tool.AddDiff('WriteFPCLogo',fWriteFPCLogo,CompOpts.fWriteFPCLogo)) then exit;

View File

@ -60,6 +60,7 @@ const
FPCMsgIDChecksumChanged = 10028;
FPCMsgIDUnitNotUsed = 5023; // Unit "$1" not used in $2
FPCMsgIDCompilationAborted = 1018;
FPCMsgIDLinesCompiled = 1008;
FPCMsgAttrWorkerDirectory = 'WD';
FPCMsgAttrMissingUnit = 'MissingUnit';
@ -1400,7 +1401,7 @@ var
OldStart: PChar;
MsgLine: TMessageLine;
begin
Result:=fMsgID=1008;
Result:=fMsgID=FPCMsgIDLinesCompiled;
if (not Result) and (fMsgID>0) then exit;
OldStart:=p;
if not Result then begin
@ -1408,12 +1409,15 @@ begin
if not ReadString(p,' lines compiled, ') then exit;
if not ReadNumberWithThousandSep(p) then exit;
end;
Result:=true;
MsgLine:=CreateMsgLine;
MsgLine.SubTool:=SubToolFPC;
MsgLine.Urgency:=mluProgress;
if ShowLinesCompiled then
MsgLine.Urgency:=mluImportant
else
MsgLine.Urgency:=mluVerbose;
MsgLine.Msg:=OldStart;
inherited AddMsgLine(MsgLine);
Result:=true;
end;
function TIDEFPCParser.CheckForExecutableInfo(p: PChar): boolean;
@ -2560,7 +2564,7 @@ var
TranslatedItem: TFPCMsgItem;
MsgLine: TMessageLine;
TranslatedMsg: String;
MsgType: TMessageLineUrgency;
MsgUrgency: TMessageLineUrgency;
Msg: string;
begin
Result:=false;
@ -2571,15 +2575,17 @@ begin
TranslatedItem:=nil;
if (TranslationFile<>nil) then
TranslatedItem:=TranslationFile.GetMsg(fMsgID);
Translate(p,MsgItem,TranslatedItem,TranslatedMsg,MsgType);
Translate(p,MsgItem,TranslatedItem,TranslatedMsg,MsgUrgency);
Msg:=p;
case fMsgID of
FPCMsgIDThereWereErrorsCompiling: // There were $1 errors compiling module, stopping
MsgType:=mluVerbose;
MsgUrgency:=mluVerbose;
FPCMsgIDLinesCompiled: // n lines compiled, m sec
if ShowLinesCompiled then MsgUrgency:=mluImportant;
end;
MsgLine:=CreateMsgLine;
MsgLine.SubTool:=SubToolFPC;
MsgLine.Urgency:=MsgType;
MsgLine.Urgency:=MsgUrgency;
MsgLine.Msg:=Msg;
MsgLine.TranslatedMsg:=TranslatedMsg;
AddMsgLine(MsgLine);

View File

@ -55,6 +55,7 @@ begin
Items.Add(dlgShowCompiledProcedures + ' (-vp)');
Items.Add(dlgShowEverything + ' (-va)');
Items.Add(dlgWriteFPCLogo + ' (-l)');
Items.Add('Show hint "lines compiled"' + ' ' + dlgPOIconDescNone);
Items.Add(dlgHintsUnused + ' ' + dlgPOIconDescNone);
Items.Add(dlgHintsParameterSenderNotUsed + ' ' + dlgPOIconDescNone);
end;
@ -82,6 +83,7 @@ begin
Checked[i] := ShowCompProc; i+=1;
Checked[i] := ShowAll; i+=1;
Checked[i] := WriteFPCLogo; i+=1;
Checked[i] := ShowLinesCompiled; i+=1;
Checked[i] := ShowHintsForUnusedUnitsInMainSrc; i+=1;
Checked[i] := ShowHintsForSenderNotUsed; i+=1;
@ -108,6 +110,7 @@ begin
ShowCompProc := Checked[i]; i+=1;
ShowAll := Checked[i]; i+=1;
WriteFPCLogo := Checked[i]; i+=1;
ShowLinesCompiled := Checked[i]; i+=1;
ShowHintsForUnusedUnitsInMainSrc := Checked[i]; i+=1;
ShowHintsForSenderNotUsed := Checked[i]; i+=1;