aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link.cxx
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/cc/link.cxx
parent1dd17210b76d544a04fc6b4f3c98162ae9718102 (diff)
Pass const scope& where modification should not happen
Diffstat (limited to 'build2/cc/link.cxx')
-rw-r--r--build2/cc/link.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index 6de294a..d85faed 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -322,8 +322,8 @@ namespace build2
file& t (static_cast<file&> (xt));
- scope& bs (t.base_scope ());
- scope& rs (*bs.root_scope ());
+ const scope& bs (t.base_scope ());
+ const scope& rs (*bs.root_scope ());
otype lt (link_type (t));
lorder lo (link_order (bs, lt));
@@ -657,7 +657,7 @@ namespace build2
void link::
append_libraries (strings& args,
file& l, bool la,
- scope& bs, lorder lo) const
+ const scope& bs, lorder lo) const
{
// Note: lack of the "small function object" optimization will really
// kill us here since we are called in a loop.
@@ -704,7 +704,11 @@ namespace build2
}
void link::
- hash_libraries (sha256& cs, file& l, bool la, scope& bs, lorder lo) const
+ hash_libraries (sha256& cs,
+ file& l,
+ bool la,
+ const scope& bs,
+ lorder lo) const
{
bool win (tclass == "windows");
@@ -747,7 +751,9 @@ namespace build2
void link::
rpath_libraries (strings& args,
- target& t, scope& bs, lorder lo,
+ target& t,
+ const scope& bs,
+ lorder lo,
bool for_install) const
{
// Use -rpath-link on targets that support it (Linux, *BSD). Note
@@ -887,8 +893,8 @@ namespace build2
file& t (static_cast<file&> (xt));
- scope& bs (t.base_scope ());
- scope& rs (*bs.root_scope ());
+ const scope& bs (t.base_scope ());
+ const scope& rs (*bs.root_scope ());
otype lt (link_type (t));
lorder lo (link_order (bs, lt));