aboutsummaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index e6e50b8..726495f 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -1091,6 +1091,23 @@ class_file (semantics::class_& c)
return c.file ();
}
+location_t context::
+class_location (semantics::class_& c)
+{
+ if (c.count ("definition"))
+ {
+ return c.get<location_t> ("definition");
+ }
+ else if (c.is_a<semantics::class_instantiation> ())
+ {
+ return c.get<location_t> ("location");
+ }
+ else
+ {
+ return real_source_location (TYPE_NAME (c.tree_node ()));
+ }
+}
+
string context::
upcase (string const& s)
{