diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-26 13:54:02 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-29 21:38:44 (GMT) |
commit | d858f36339d61e45913165bc957d645bf1060f54 (patch) | |
tree | e45d069a00e27907b42a1bc0cfa50e3a59fe3a9e /Source/cmDefinitions.cxx | |
parent | aaaa65b6a5cdf227282a9d04bf5287413757ff03 (diff) | |
download | CMake-d858f36339d61e45913165bc957d645bf1060f54.zip CMake-d858f36339d61e45913165bc957d645bf1060f54.tar.gz CMake-d858f36339d61e45913165bc957d645bf1060f54.tar.bz2 |
cmDefinitions: Use list of cmDefinitions* to create closure.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r-- | Source/cmDefinitions.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 2ee2618..5fe57c8 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -11,6 +11,8 @@ ============================================================================*/ #include "cmDefinitions.h" +#include <list> + //---------------------------------------------------------------------------- cmDefinitions::Def cmDefinitions::NoDef; @@ -87,11 +89,18 @@ cmDefinitions cmDefinitions::MakeClosure() const void cmDefinitions::MakeClosure(std::set<std::string>& undefined, cmDefinitions const* defs) { + std::list<cmDefinitions const*> ups; while(defs) { + ups.push_back(defs); + defs = defs->Up; + } + for (std::list<cmDefinitions const*>::const_iterator it = ups.begin(); + it != ups.end(); ++it) + { // Consider local definitions. - for(MapType::const_iterator mi = defs->Map.begin(); - mi != defs->Map.end(); ++mi) + for(MapType::const_iterator mi = (*it)->Map.begin(); + mi != (*it)->Map.end(); ++mi) { // Use this key if it is not already set or unset. if(this->Map.find(mi->first) == this->Map.end() && @@ -107,7 +116,6 @@ void cmDefinitions::MakeClosure(std::set<std::string>& undefined, } } } - defs = defs->Up; } } |