aboutsummaryrefslogtreecommitdiff
path: root/odb/plugin.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-09-19 16:42:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-09-19 16:42:28 +0200
commit8fc4fda0ce88fccbe40c36be3925237a4bca36d9 (patch)
treefc4aad589c9ae36cad4544eba8e06fe7e9b18099 /odb/plugin.cxx
parent55df757e98329e8e09afffe274ce2ceab269f8b3 (diff)
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.
Diffstat (limited to 'odb/plugin.cxx')
-rw-r--r--odb/plugin.cxx13
1 files changed, 11 insertions, 2 deletions
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<unit> 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)