aboutsummaryrefslogtreecommitdiff
path: root/odb/semantics
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-19 17:54:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-19 17:54:23 +0200
commit53d846e0c6ce605c3bce5c902829e0c0ce70e444 (patch)
tree766930494cec032fc4d131aa10eea8fac15a938d /odb/semantics
parent2811680d652989ab2e2f9e12efd6f6de6169fa18 (diff)
Store enumerator values in semantics graph
Diffstat (limited to 'odb/semantics')
-rw-r--r--odb/semantics/enum.cxx16
-rw-r--r--odb/semantics/enum.hxx25
2 files changed, 35 insertions, 6 deletions
diff --git a/odb/semantics/enum.cxx b/odb/semantics/enum.cxx
index f324716..56be2fc 100644
--- a/odb/semantics/enum.cxx
+++ b/odb/semantics/enum.cxx
@@ -14,14 +14,22 @@ namespace semantics
}
enumerator::
- enumerator (path const& file, size_t line, size_t column, tree tn)
- : node (file, line, column, tn)
+ enumerator (path const& file,
+ size_t line,
+ size_t column,
+ tree tn,
+ unsigned long long value)
+ : node (file, line, column, tn), value_ (value)
{
}
enum_::
- enum_ (path const& file, size_t line, size_t column, tree tn)
- : node (file, line, column, tn)
+ enum_ (path const& file,
+ size_t line,
+ size_t column,
+ tree tn,
+ bool unsigned_)
+ : node (file, line, column, tn), unsigned__ (unsigned_)
{
}
diff --git a/odb/semantics/enum.hxx b/odb/semantics/enum.hxx
index dbc5790..12e43eb 100644
--- a/odb/semantics/enum.hxx
+++ b/odb/semantics/enum.hxx
@@ -71,8 +71,21 @@ namespace semantics
return *enumerated_;
}
+ // If the enumeration is signed, then this value should be re-
+ // interpreted as signed.
+ //
+ unsigned long long
+ value () const
+ {
+ return value_;
+ }
+
public:
- enumerator (path const&, size_t line, size_t column, tree);
+ enumerator (path const&,
+ size_t line,
+ size_t column,
+ tree,
+ unsigned long long value);
void
add_edge_right (enumerates& e)
@@ -83,6 +96,7 @@ namespace semantics
using nameable::add_edge_right;
private:
+ unsigned long long value_;
enumerates* enumerated_;
};
@@ -110,8 +124,14 @@ namespace semantics
return enumerates_.end ();
}
+ bool
+ unsigned_ () const
+ {
+ return unsigned__;
+ }
+
public:
- enum_ (path const&, size_t line, size_t column, tree);
+ enum_ (path const&, size_t line, size_t column, tree, bool unsigned_);
void
add_edge_left (enumerates& e)
@@ -120,6 +140,7 @@ namespace semantics
}
private:
+ bool unsigned__;
enumerates_list enumerates_;
};
}