diff options
Diffstat (limited to 'gcc/tree-logical-location.cc')
-rw-r--r-- | gcc/tree-logical-location.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/gcc/tree-logical-location.cc b/gcc/tree-logical-location.cc index 1d0cc58..19bccd1 100644 --- a/gcc/tree-logical-location.cc +++ b/gcc/tree-logical-location.cc @@ -27,6 +27,8 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "intl.h" +using namespace diagnostics::logical_locations; + static void assert_valid_tree (const_tree node) { @@ -35,7 +37,8 @@ assert_valid_tree (const_tree node) gcc_assert (TREE_CODE (node) != TRANSLATION_UNIT_DECL); } -/* class tree_logical_location_manager : public logical_location_manager. */ +/* class tree_logical_location_manager + : public diagnostics::logical_locations::manager. */ const char * tree_logical_location_manager::get_short_name (key k) const @@ -81,7 +84,7 @@ tree_logical_location_manager::get_internal_name (key k) const return NULL; } -enum logical_location_kind +enum kind tree_logical_location_manager::get_kind (key k) const { tree node = tree_from_key (k); @@ -90,18 +93,18 @@ tree_logical_location_manager::get_kind (key k) const switch (TREE_CODE (node)) { default: - return logical_location_kind::unknown; + return kind::unknown; case FUNCTION_DECL: - return logical_location_kind::function; + return kind::function; case PARM_DECL: - return logical_location_kind::parameter; + return kind::parameter; case VAR_DECL: - return logical_location_kind::variable; + return kind::variable; case NAMESPACE_DECL: - return logical_location_kind::namespace_; + return kind::namespace_; case RECORD_TYPE: - return logical_location_kind::type; + return kind::type; } } @@ -123,7 +126,7 @@ tree_logical_location_manager::get_name_for_path_output (key k) const return label_text (); } -logical_location +key tree_logical_location_manager::get_parent (key k) const { tree node = tree_from_key (k); @@ -132,16 +135,16 @@ tree_logical_location_manager::get_parent (key k) const if (DECL_P (node)) { if (!DECL_CONTEXT (node)) - return logical_location (); + return key (); if (TREE_CODE (DECL_CONTEXT (node)) == TRANSLATION_UNIT_DECL) - return logical_location (); + return key (); return key_from_tree (DECL_CONTEXT (node)); } else if (TYPE_P (node)) { if (!TYPE_CONTEXT (node)) - return logical_location (); + return key (); return key_from_tree (TYPE_CONTEXT (node)); } - return logical_location (); + return key (); } |