diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-09-21 16:36:42 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-09-21 16:36:42 +0000 |
commit | 5b2b60003b225260904c0073cc952ed2f7169e11 (patch) | |
tree | dd3c20b429ac90c86d6950ff0135ba4c1a480f3f /src/expr/node_builder.h | |
parent | d3d08250a1ec33689ec29736600c17aab7614d18 (diff) |
Moving automatic type check to NodeBuilder (Fixes: #199)
Diffstat (limited to 'src/expr/node_builder.h')
-rw-r--r-- | src/expr/node_builder.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/expr/node_builder.h b/src/expr/node_builder.h index 422cb47a8..ff696dca9 100644 --- a/src/expr/node_builder.h +++ b/src/expr/node_builder.h @@ -829,22 +829,42 @@ TypeNode NodeBuilder<nchild_thresh>::constructTypeNode() const { template <unsigned nchild_thresh> Node NodeBuilder<nchild_thresh>::constructNode() { - return Node(constructNV()); + Node n = Node(constructNV()); + if( IS_DEBUG_BUILD ) { + // force an immediate type check + d_nm->getType(n,true); + } + return n; } template <unsigned nchild_thresh> Node NodeBuilder<nchild_thresh>::constructNode() const { - return Node(constructNV()); + Node n = Node(constructNV()); + if( IS_DEBUG_BUILD ) { + // force an immediate type check + d_nm->getType(n,true); + } + return n; } template <unsigned nchild_thresh> Node* NodeBuilder<nchild_thresh>::constructNodePtr() { - return new Node(constructNV()); + Node *np = new Node(constructNV()); + if( IS_DEBUG_BUILD ) { + // force an immediate type check + d_nm->getType(*np,true); + } + return np; } template <unsigned nchild_thresh> Node* NodeBuilder<nchild_thresh>::constructNodePtr() const { - return new Node(constructNV()); + Node *np = new Node(constructNV()); + if( IS_DEBUG_BUILD ) { + // force an immediate type check + d_nm->getType(*np,true); + } + return np; } template <unsigned nchild_thresh> |