From 174f6e5d0f370ddfe28ace6acfb5362cfb102280 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 11 Oct 2009 09:32:17 +0200 Subject: Simplify to work around VC++ bugs --- cli/semantics/unit.hxx | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) (limited to 'cli/semantics/unit.hxx') diff --git a/cli/semantics/unit.hxx b/cli/semantics/unit.hxx index a67e1ff..d7e6727 100644 --- a/cli/semantics/unit.hxx +++ b/cli/semantics/unit.hxx @@ -36,9 +36,7 @@ namespace semantics return file_; } - protected: - friend class graph; - + public: includes (string const& file) : file_ (file) { @@ -66,9 +64,7 @@ namespace semantics return *includee_; } - protected: - friend class graph; - + public: cli_includes (string const& file) : includes (file) { @@ -95,9 +91,7 @@ namespace semantics return *includee_; } - protected: - friend class graph; - + public: cxx_includes (string const& file) : includes (file) { @@ -117,9 +111,7 @@ namespace semantics // class cxx_unit: public node { - protected: - friend class graph; - + public: cxx_unit (path const& file, size_t line, size_t column) : node (file, line, column) { @@ -156,7 +148,7 @@ namespace semantics public: cli_unit (path const& file) - : node (file, 1, 1) + : node (file, 1, 1), graph_ (*this) { // Use a special edge to get this->name() return the global // namespace name (""). @@ -169,14 +161,14 @@ namespace semantics T& new_node (path const& file, size_t line, size_t column) { - return graph ().new_node (file, line, column); + return graph_.new_node (file, line, column); } template T& new_node (path const& file, size_t line, size_t column, A0 const& a0) { - return graph ().new_node (file, line, column, a0); + return graph_.new_node (file, line, column, a0); } template @@ -184,7 +176,7 @@ namespace semantics new_node (path const& file, size_t line, size_t column, A0 const& a0, A1 const& a1) { - return graph ().new_node (file, line, column, a0, a1); + return graph_.new_node (file, line, column, a0, a1); } template @@ -192,7 +184,7 @@ 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 (file, line, column, a0, a1, a2); + return graph_.new_node (file, line, column, a0, a1, a2); } template @@ -200,7 +192,7 @@ 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 (file, line, column, a0, a1, a2, a3); + return graph_.new_node (file, line, column, a0, a1, a2, a3); } public: @@ -219,9 +211,7 @@ namespace semantics // class global_names: public names { - protected: - friend class graph; - + public: global_names () : names ("") { @@ -252,9 +242,7 @@ namespace semantics } }; - protected: - friend class graph; - + public: void add_edge_left (cli_includes& e) { @@ -280,16 +268,10 @@ namespace semantics using namespace_::add_edge_right; private: - semantics::graph& - graph () - { - return *this; - } - - private: typedef std::map type_map; private: + graph& graph_; includes_list includes_; type_map types_; }; -- cgit v1.1