diff options
Diffstat (limited to 'libbuild2/target.hxx')
-rw-r--r-- | libbuild2/target.hxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx index 6387b8f..9b75389 100644 --- a/libbuild2/target.hxx +++ b/libbuild2/target.hxx @@ -38,16 +38,19 @@ namespace build2 // Prerequisite inclusion/exclusion (see include() function below). // + // Note that posthoc is handled internally and should normally be treated by + // the rules the same as excluded. + // class include_type { public: - enum value {excluded, adhoc, normal}; + enum value {excluded, posthoc, adhoc, normal}; include_type (value v): v_ (v) {} include_type (bool v): v_ (v ? normal : excluded) {} operator value () const {return v_;} - explicit operator bool () const {return v_ != excluded;} + explicit operator bool () const {return v_ == normal || v_ == adhoc;} private: value v_; @@ -713,6 +716,13 @@ namespace build2 static const size_t offset_executed = 5; // Recipe has been executed. static const size_t offset_busy = 6; // Match/execute in progress. + // @@ PERF There is a lot of data below that is only needed for "output" + // as opposed to "source" targets (auxiliary data pads, + // {prerequisite,posthoc}_targets, etc). Maybe we should move this + // stuff to an optional extra (like we have for the root scope). Maybe + // we could even allocate it as part of the target's memory block or + // some such? + // Inner/outer operation state. See <libbuild2/action.hxx> for details. // class LIBBUILD2_SYMEXPORT opstate @@ -901,6 +911,11 @@ namespace build2 // mutable action_state<build2::prerequisite_targets> prerequisite_targets; + // Targets to which posthoc prerequisites resolve for this action. Note + // that it's normally not used by the rules directly. + // + mutable action_state<build2::prerequisite_targets> posthoc_targets; + // Auxiliary data storage. // // A rule that matches (i.e., returns true from its match() function) may |