From 2e65a5d458f7fc677442414dfee4058a39dd9b72 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 7 Apr 2024 22:10:41 +0300 Subject: [PATCH] + introduced cgbase.topcg2str and topcmp2str for converting TOpCg and TOpCmp to strings (useful for debug logging, etc) --- compiler/cgbase.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/compiler/cgbase.pas b/compiler/cgbase.pas index 8a74b3751f..8e264c10f9 100644 --- a/compiler/cgbase.pas +++ b/compiler/cgbase.pas @@ -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 =