From 191573f7922aea3c1abdba325f5e65e4ba03d7c8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 26 Apr 2015 16:19:11 +0200 Subject: [PATCH] cmDefinitions: Remove Parent pointer. All structural knowledge of the stack of scopes is now external. --- Source/cmDefinitions.cxx | 6 ------ Source/cmDefinitions.h | 9 --------- Source/cmMakefile.cxx | 7 +------ 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 94d27c29c..6e2665665 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -16,12 +16,6 @@ //---------------------------------------------------------------------------- cmDefinitions::Def cmDefinitions::NoDef; -//---------------------------------------------------------------------------- -cmDefinitions::cmDefinitions(cmDefinitions* parent) - : Up(parent) -{ -} - //---------------------------------------------------------------------------- cmDefinitions::Def const& cmDefinitions::GetInternal( const std::string& key, diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 2bcfcb0b2..33f468b4b 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -29,12 +29,6 @@ class cmDefinitions { public: - /** Construct with the given parent scope. */ - cmDefinitions(cmDefinitions* parent = 0); - - /** Returns the parent scope, if any. */ - cmDefinitions* GetParent() const { return this->Up; } - /** Get the value associated with a key; null if none. Store the result locally if it came from a parent. */ const char* Get(const std::string& key, @@ -71,9 +65,6 @@ private: }; static Def NoDef; - // Parent scope, if any. - cmDefinitions* Up; - // Local definitions, set or unset. #if defined(CMAKE_BUILD_WITH_CMAKE) typedef cmsys::hash_map MapType; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ae7e56454..b16d7e6de 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -53,12 +53,7 @@ public: void PushDefinitions() { - cmDefinitions* parent = 0; - if (!this->VarStack.empty()) - { - parent = &this->VarStack.back(); - } - this->VarStack.push_back(cmDefinitions(parent)); + this->VarStack.push_back(cmDefinitions()); } void InitializeDefinitions(cmMakefile* parent)