* some debugging infrastructure

git-svn-id: trunk@25900 -
This commit is contained in:
florian 2013-11-01 19:01:17 +00:00
parent bfbb0c5b9d
commit d575a435c3

View File

@ -23,6 +23,8 @@ unit popt386;
{$i fpcdefs.inc} {$i fpcdefs.inc}
{ $define DEBUG_AOPTCPU}
interface interface
uses Aasmbase,aasmtai,aasmdata,aasmcpu,verbose; uses Aasmbase,aasmtai,aasmdata,aasmcpu,verbose;
@ -35,7 +37,7 @@ procedure PostPeepHoleOpts(asml: TAsmList; BlockStart, BlockEnd: tai);
implementation implementation
uses uses
globtype,systems, cutils,globtype,systems,
globals,cgbase,procinfo, globals,cgbase,procinfo,
symsym, symsym,
{$ifdef finaldestdebug} {$ifdef finaldestdebug}
@ -502,8 +504,25 @@ function MatchOperand(const oper1: TOper; const oper2: TOper): boolean; inline;
end; end;
{ First pass of peephole optimizations }
procedure PeepHoleOptPass1(Asml: TAsmList; BlockStart, BlockEnd: tai); procedure PeepHoleOptPass1(Asml: TAsmList; BlockStart, BlockEnd: tai);
{First pass of peepholeoptimizations}
{$ifdef DEBUG_AOPTCPU}
procedure DebugMsg(const s: string;p : tai);
begin
asml.insertbefore(tai_comment.Create(strpnew(s)), p);
end;
{$else DEBUG_AOPTCPU}
procedure DebugMsg(const s: string;p : tai);inline;
begin
end;
{$endif DEBUG_AOPTCPU}
function WriteOk : Boolean;
begin
writeln('Ok');
Result:=True;
end;
var var
l : longint; l : longint;