[Cmake-commits] CMake branch, next, updated. v3.2.2-2329-ga14d6b0
Stephen Kelly
steveire at gmail.com
Wed Apr 29 18:32:39 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via a14d6b039db25d374ae0c4740e79e78d55b9072f (commit)
via 5ccff6408c93e67d7f8445ce1bf6465b068d6f6b (commit)
from e6c8bcef7e39344832a015b02283213d855e83d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a14d6b039db25d374ae0c4740e79e78d55b9072f
commit a14d6b039db25d374ae0c4740e79e78d55b9072f
Merge: e6c8bce 5ccff64
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Apr 29 18:32:38 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Apr 29 18:32:38 2015 -0400
Merge topic 'ClosureKeys-external-loop' into next
5ccff640 cmDefinitions: Externalize looping for ClosureKeys.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ccff6408c93e67d7f8445ce1bf6465b068d6f6b
commit 5ccff6408c93e67d7f8445ce1bf6465b068d6f6b
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 15:38:36 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Apr 30 00:32:18 2015 +0200
cmDefinitions: Externalize looping for ClosureKeys.
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 718d9ec..115e30a 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -116,26 +116,19 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined,
}
//----------------------------------------------------------------------------
-std::vector<std::string> cmDefinitions::ClosureKeys() const
+std::vector<std::string>
+cmDefinitions::ClosureKeys(std::set<std::string>& bound) const
{
std::vector<std::string> defined;
- std::set<std::string> bound;
-
- cmDefinitions const* up = this;
-
- while (up)
+ defined.reserve(this->Map.size());
+ for(MapType::const_iterator mi = this->Map.begin();
+ mi != this->Map.end(); ++mi)
{
- // Consider local definitions.
- for(MapType::const_iterator mi = up->Map.begin();
- mi != up->Map.end(); ++mi)
+ // Use this key if it is not already set or unset.
+ if(bound.insert(mi->first).second && mi->second.Exists)
{
- // Use this key if it is not already set or unset.
- if(bound.insert(mi->first).second && mi->second.Exists)
- {
- defined.push_back(mi->first);
- }
+ defined.push_back(mi->first);
}
- up = up->Up;
}
return defined;
}
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 87f5c34..4c7f11f 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -47,8 +47,8 @@ public:
/** Get the set of all local keys. */
std::vector<std::string> LocalKeys() const;
- /** Compute the set of all defined keys. */
- std::vector<std::string> ClosureKeys() const;
+ std::vector<std::string>
+ ClosureKeys(std::set<std::string>& bound) const;
static cmDefinitions MakeClosure(
std::list<cmDefinitions>::const_reverse_iterator rbegin,
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6451874..1d3e496 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -98,7 +98,16 @@ public:
std::vector<std::string> ClosureKeys() const
{
- return this->VarStack.back().ClosureKeys();
+ std::vector<std::string> closureKeys;
+ std::set<std::string> bound;
+ for (std::list<cmDefinitions>::const_reverse_iterator it =
+ this->VarStack.rbegin(); it != this->VarStack.rend(); ++it)
+ {
+ std::vector<std::string> const& localKeys = it->ClosureKeys(bound);
+ closureKeys.insert(closureKeys.end(),
+ localKeys.begin(), localKeys.end());
+ }
+ return closureKeys;
}
void PopDefinitions()
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list