From 0770beace3b6f944209417f1b4541fa31d443529 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 30 Aug 2013 06:04:01 +0200 Subject: Statement processing/optimization base work --- odb/statement-processing.cxx | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'odb/statement-processing.cxx') diff --git a/odb/statement-processing.cxx b/odb/statement-processing.cxx index f647966..ed5bad5 100644 --- a/odb/statement-processing.cxx +++ b/odb/statement-processing.cxx @@ -6,14 +6,19 @@ // to minimize statically-linked object code size when processing // is not used. +//#define LIBODB_DEBUG_STATEMENT_PROCESSING 1 +//#define LIBODB_TRACE_STATEMENT_PROCESSING 1 + #include +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING +# include +#endif + #include using namespace std; -// #define LIBODB_DEBUG_STATEMENT_PROCESSING 1 - namespace odb { typedef char_traits traits; @@ -310,6 +315,13 @@ namespace odb r.append (trailer_begin, trailer_size); } +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING + if (r.size () != n) + cerr << endl + << "old: '" << s << "'" << endl << endl + << "new: '" << r << "'" << endl << endl; +#endif + return; } @@ -395,6 +407,13 @@ namespace odb r += ' '; r.append (trailer_begin, trailer_size); } + +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING + if (r.size () != n) + cerr << endl + << "old: '" << s << "'" << endl << endl + << "new: '" << r << "'" << endl << endl; +#endif } void statement:: @@ -484,6 +503,13 @@ namespace odb r.append (trailer_begin, trailer_size); } +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING + if (r.size () != n) + cerr << endl + << "old: '" << s << "'" << endl << endl + << "new: '" << r << "'" << endl << endl; +#endif + return; } @@ -526,6 +552,13 @@ namespace odb r += ' '; r.append (trailer_begin, trailer_size); } + +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING + if (r.size () != n) + cerr << endl + << "old: '" << s << "'" << endl << endl + << "new: '" << r << "'" << endl << endl; +#endif } void statement:: @@ -766,5 +799,12 @@ namespace odb r.erase (join_pos - 1, n + 1); // Extra one for space. } } + +#ifdef LIBODB_TRACE_STATEMENT_PROCESSING + if (r.size () != n) + cerr << endl + << "old: '" << s << "'" << endl << endl + << "new: '" << r << "'" << endl << endl; +#endif } } -- cgit v1.1