From 8fc4fda0ce88fccbe40c36be3925237a4bca36d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 19 Sep 2011 16:42:28 +0200 Subject: Split validator into 2 passes, before and after processing This is necessary because we sometimes need information during validation (e.g., object pointer and container status) that is determined by the processor. --- odb/plugin.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'odb/plugin.cxx') diff --git a/odb/plugin.cxx b/odb/plugin.cxx index aba5e78..7f01478 100644 --- a/odb/plugin.cxx +++ b/odb/plugin.cxx @@ -110,11 +110,11 @@ gate_callback (void*, void*) parser p (*options_, loc_pragmas_, decl_pragmas_); auto_ptr u (p.parse (global_namespace, file_)); - // Validate. + // Validate, pass 1. // { validator v; - if (!v.validate (*options_, *u, file_)) + if (!v.validate (*options_, *u, file_, 1)) r = 1; } @@ -126,6 +126,15 @@ gate_callback (void*, void*) p.process (*options_, *u, file_); } + // Validate, pass 2. + // + if (r == 0) + { + validator v; + if (!v.validate (*options_, *u, file_, 2)) + r = 1; + } + // Generate. // if (r == 0) -- cgit v1.1