diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-11-04 07:44:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-11-04 07:44:34 +0200 |
commit | 74c9269e1363e33e4b3223a029049a13e6595e7e (patch) | |
tree | 1d360d56c9f04e976e8ed5700fe0fde0a1dd420b /libbuild2/target.hxx | |
parent | 95da67852e7c837592a61fb44cd8acd325d16ba2 (diff) |
Redo group_prerequisites to use snapshots of prerequisites (GH issue #408)
It turns out both target and group prerequisites can be replaced during
dependency synthesis in more obscure cases.
Diffstat (limited to 'libbuild2/target.hxx')
-rw-r--r-- | libbuild2/target.hxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx index ae45082..1b7b755 100644 --- a/libbuild2/target.hxx +++ b/libbuild2/target.hxx @@ -733,8 +733,6 @@ namespace build2 atomic<uint8_t> prerequisites_state_ {0}; prerequisites_type prerequisites_; - static const prerequisites_type empty_prerequisites_; - // Target-specific variables. // // See also rule-specific variables below. @@ -1488,9 +1486,9 @@ namespace build2 { public: explicit - group_prerequisites (const target& t); + group_prerequisites (const target&); - group_prerequisites (const target& t, const target* g); + group_prerequisites (const target&, const target* group); using prerequisites_type = target::prerequisites_type; using base_iterator = prerequisites_type::const_iterator; @@ -1504,8 +1502,8 @@ namespace build2 using iterator_category = std::bidirectional_iterator_tag; iterator () {} - iterator (const target* t, - const target* g, + iterator (const prerequisites_type* t, + const prerequisites_type* g, const prerequisites_type* c, base_iterator i): t_ (t), g_ (g), c_ (c), i_ (i) {} @@ -1534,8 +1532,8 @@ namespace build2 operator!= (const iterator& x, const iterator& y) {return !(x == y);} private: - const target* t_ = nullptr; - const target* g_ = nullptr; + const prerequisites_type* t_ = nullptr; + const prerequisites_type* g_ = nullptr; const prerequisites_type* c_ = nullptr; base_iterator i_; }; @@ -1558,8 +1556,8 @@ namespace build2 size () const; private: - const target& t_; - const target* g_; + const prerequisites_type* t_; // NULL if empty. + const prerequisites_type* g_; // NULL if no group or empty. }; // A member of a prerequisite. If 'member' is NULL, then this is the |