+ introduced cgbase.topcg2str and topcmp2str for converting TOpCg and TOpCmp to strings (useful for debug logging, etc)

This commit is contained in:
Nikolay Nikolov 2024-04-07 22:10:41 +03:00
parent 139f2dfe84
commit 2e65a5d458

View File

@ -511,6 +511,8 @@ interface
function double_array_cgsize(const a: tcgint): tcgsize;{$ifdef USEINLINE}inline;{$endif}
function tcgsize2str(cgsize: tcgsize):string;
function topcg2str(opcg: topcg):string;
function topcmp2str(opcmp: topcmp):string;
{ return the inverse condition of opcmp }
function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
@ -873,6 +875,18 @@ implementation
end;
function topcg2str(opcg: topcg):string;
begin
Str(opcg, Result);
end;
function topcmp2str(opcmp: topcmp):string;
begin
Str(opcmp, Result);
end;
function inverse_opcmp(opcmp: topcmp): topcmp;{$ifdef USEINLINE}inline;{$endif}
const
list: array[TOpCmp] of TOpCmp =