summaryrefslogtreecommitdiff
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-26 15:54:02 +0200
committerStephen Kelly <steveire@gmail.com>2015-04-29 23:38:44 +0200
commitd858f36339d61e45913165bc957d645bf1060f54 (patch)
treee45d069a00e27907b42a1bc0cfa50e3a59fe3a9e /Source/cmDefinitions.cxx
parentaaaa65b6a5cdf227282a9d04bf5287413757ff03 (diff)
downloadcmake-d858f36339d61e45913165bc957d645bf1060f54.tar.gz
cmDefinitions: Use list of cmDefinitions* to create closure.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 2ee2618d01..5fe57c84c7 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;
}
}