diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-17 14:19:55 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-19 20:36:53 (GMT) |
commit | b9f9915516c9b426f4f528bb1ec5a79d115e21ab (patch) | |
tree | 5d98678c6cd4a92171909c14883d623decf39c30 /Source/cmDefinitions.cxx | |
parent | 2b09d9f346bd3220b059771a6da1bafb06ce0f5b (diff) | |
download | CMake-b9f9915516c9b426f4f528bb1ec5a79d115e21ab.zip CMake-b9f9915516c9b426f4f528bb1ec5a79d115e21ab.tar.gz CMake-b9f9915516c9b426f4f528bb1ec5a79d115e21ab.tar.bz2 |
cmMakefile: Remove VarUsageStack.
Store usage information in the cmDefintions value instead. We already
pay for the memory as padding in the Def struct, so we might as well
use it.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r-- | Source/cmDefinitions.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 5b03bd4..2dab169 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -21,9 +21,10 @@ cmDefinitions::Def const& cmDefinitions::GetInternal( const std::string& key, StackIter begin, StackIter end, bool raise) { assert(begin != end); - MapType::const_iterator i = begin->Map.find(key); + MapType::iterator i = begin->Map.find(key); if (i != begin->Map.end()) { + i->second.Used = true; return i->second; } StackIter it = begin; @@ -76,7 +77,7 @@ void cmDefinitions::Set(const std::string& key, const char* value) } //---------------------------------------------------------------------------- -std::vector<std::string> cmDefinitions::LocalKeys() const +std::vector<std::string> cmDefinitions::UnusedKeys() const { std::vector<std::string> keys; keys.reserve(this->Map.size()); @@ -84,7 +85,7 @@ std::vector<std::string> cmDefinitions::LocalKeys() const for(MapType::const_iterator mi = this->Map.begin(); mi != this->Map.end(); ++mi) { - if (mi->second.Exists) + if (!mi->second.Used) { keys.push_back(mi->first); } |