summaryrefslogtreecommitdiff
path: root/odb/semantics/unit.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-28 17:51:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-28 17:51:23 +0200
commit7dff3249f7ef6f8675e0c0fcbe3109d50f4c1b1d (patch)
tree8596735f193cc4a377e97cf63af1a0a6c40d5bbf /odb/semantics/unit.hxx
parentc6a2b0f125c70f521daf820d014ff07b4fe8af3b (diff)
Add support for literal names (template-id, derived type declarator)
Diffstat (limited to 'odb/semantics/unit.hxx')
-rw-r--r--odb/semantics/unit.hxx28
1 files changed, 22 insertions, 6 deletions
diff --git a/odb/semantics/unit.hxx b/odb/semantics/unit.hxx
index e12f181..0dd6033 100644
--- a/odb/semantics/unit.hxx
+++ b/odb/semantics/unit.hxx
@@ -18,6 +18,10 @@ namespace semantics
public:
unit (path const&);
+ private:
+ unit (unit const&);
+ unit& operator= (unit const&);
+
// Mapping from tree nodes to semantic graph nodes.
//
public:
@@ -39,14 +43,18 @@ namespace semantics
T&
new_node (path const& file, size_t line, size_t column)
{
- return graph_.new_node<T> (file, line, column);
+ T& r (graph_.new_node<T> (file, line, column));
+ r.unit (*this);
+ return r;
}
template <typename T, typename A0>
T&
new_node (path const& file, size_t line, size_t column, A0 const& a0)
{
- return graph_.new_node<T> (file, line, column, a0);
+ T& r (graph_.new_node<T> (file, line, column, a0));
+ r.unit (*this);
+ return r;
}
template <typename T, typename A0, typename A1>
@@ -54,7 +62,9 @@ namespace semantics
new_node (path const& file, size_t line, size_t column,
A0 const& a0, A1 const& a1)
{
- return graph_.new_node<T> (file, line, column, a0, a1);
+ T& r (graph_.new_node<T> (file, line, column, a0, a1));
+ r.unit (*this);
+ return r;
}
template <typename T, typename A0, typename A1, typename A2>
@@ -62,7 +72,9 @@ namespace semantics
new_node (path const& file, size_t line, size_t column,
A0 const& a0, A1 const& a1, A2 const& a2)
{
- return graph_.new_node<T> (file, line, column, a0, a1, a2);
+ T& r (graph_.new_node<T> (file, line, column, a0, a1, a2));
+ r.unit (*this);
+ return r;
}
template <typename T, typename A0, typename A1, typename A2, typename A3>
@@ -70,7 +82,9 @@ namespace semantics
new_node (path const& file, size_t line, size_t column,
A0 const& a0, A1 const& a1, A2 const& a2, A3 const& a3)
{
- return graph_.new_node<T> (file, line, column, a0, a1, a2, a3);
+ T& r (graph_.new_node<T> (file, line, column, a0, a1, a2, a3));
+ r.unit (*this);
+ return r;
}
// For fundamental types.
@@ -79,7 +93,9 @@ namespace semantics
T&
new_fund_node (tree tn)
{
- return graph_.new_node<T> (tn);
+ T& r (graph_.new_node<T> (tn));
+ r.unit (*this);
+ return r;
}
protected: