aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-01 16:36:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:41 +0200
commite3e597180487328a54721e2afb95e33ed853d586 (patch)
tree89d59f482d41eb37a90f97b0dd55c2e878e4800b /build2/algorithm
parent1dd17210b76d544a04fc6b4f3c98162ae9718102 (diff)
Pass const scope& where modification should not happen
Diffstat (limited to 'build2/algorithm')
-rw-r--r--build2/algorithm27
1 files changed, 12 insertions, 15 deletions
diff --git a/build2/algorithm b/build2/algorithm
index 5cd31fe..742b2e9 100644
--- a/build2/algorithm
+++ b/build2/algorithm
@@ -45,7 +45,7 @@ namespace build2
const dir_path& out,
const string& name,
const optional<string>& ext,
- scope*,
+ const scope*,
const optional<string>& proj = nullopt);
// As above but specify the target type as template argument.
@@ -56,14 +56,14 @@ namespace build2
const dir_path& out,
const string& name,
const optional<string>& ext,
- scope*);
+ const scope*);
// Search for a target identified by the name. The semantics is "as if" we
// first created a prerequisite based on this name in exactly the same way
// as the parser would and then searched based on this prerequisite.
//
target&
- search (name, scope&);
+ search (name, const scope&);
// As above but only search for an already existing target. Unlike the
// above version, this one can be called during the execute phase.
@@ -72,7 +72,9 @@ namespace build2
// unknown target types.
//
target*
- search_existing (const name&, scope&, const dir_path& out = dir_path ());
+ search_existing (const name&,
+ const scope&,
+ const dir_path& out = dir_path ());
// Match and apply a rule to the action/target with ambiguity detection.
// Increment the target's dependents count, which means that you should call
@@ -105,8 +107,9 @@ namespace build2
match_delegate (slock&, action, target&, const rule&);
// The standard prerequisite search and match implementations. They call
- // search_and_match_*() versions below passing non-empty directory for
- // the clean operation.
+ // search() and then match() for each prerequisite in a loop omitting out of
+ // project prerequisites for the clean operation. If this target is a member
+ // of a group, then they first do this to the group's prerequisites.
//
void
search_and_match_prerequisites (slock&, action, target&);
@@ -117,20 +120,14 @@ namespace build2
void
search_and_match_prerequisite_members (slock&, action, target&);
- // The actual prerequisite search and match implementations. They call
- // search() and then match() for each prerequisite in a loop. If this
- // target is a member of a group, then they first do this to the group's
- // prerequisites.
- //
- // If the directory argument is not empty, then they ignore (do not
- // match) prerequisites that are not in the same or its subdirectory.
+ // As above but omit prerequisites that are not in the specified scope.
//
void
- search_and_match_prerequisites (slock&, action, target&, const dir_path&);
+ search_and_match_prerequisites (slock&, action, target&, const scope&);
void
search_and_match_prerequisite_members (
- slock&, action, target&, const dir_path&);
+ slock&, action, target&, const scope&);
// Unless already available, match, and, if necessary, execute the group
// in order to obtain its members list. Note that even after that the