[Cmake-commits] CMake branch, next, updated. v3.2.2-2272-ged96169

Stephen Kelly steveire at gmail.com
Tue Apr 28 19:21:55 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  ed9616928b88eef8d7ea7b7f7e02a994ea8b0e59 (commit)
       via  37a66fa9cf34637ed0edc25df1156d9bdb241a43 (commit)
      from  ce6e191ff8036edf510f5ee0ebb8e79d8ae054d2 (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=ed9616928b88eef8d7ea7b7f7e02a994ea8b0e59
commit ed9616928b88eef8d7ea7b7f7e02a994ea8b0e59
Merge: ce6e191 37a66fa
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 28 19:21:50 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 28 19:21:50 2015 -0400

    Merge topic 'remove-cmDefinitions-stack-adaptor' into next
    
    37a66fa9 cmMakefile: Remove stack adaptor for the VarStack.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37a66fa9cf34637ed0edc25df1156d9bdb241a43
commit 37a66fa9cf34637ed0edc25df1156d9bdb241a43
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Apr 25 17:21:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 29 01:20:43 2015 +0200

    cmMakefile: Remove stack adaptor for the VarStack.
    
    The purpose of the stack is to allow access only to the top of it.  Access
    to items which are not at the top is needed, so cmDefinitions objects
    get a Parent pointer.
    
    The existence of the Parent pointer is a workaround for the inappropriate
    use of stack in the first place.  Remove it now.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5fc8647..0bff327 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -46,7 +46,7 @@
 class cmMakefile::Internals
 {
 public:
-  std::stack<cmDefinitions, std::list<cmDefinitions> > VarStack;
+  std::list<cmDefinitions> VarStack;
   std::stack<std::set<std::string> > VarInitStack;
   std::stack<std::set<std::string> > VarUsageStack;
   bool IsSourceFileTryCompile;
@@ -56,24 +56,24 @@ public:
     cmDefinitions* parent = 0;
     if (!this->VarStack.empty())
       {
-      parent = &this->VarStack.top();
+      parent = &this->VarStack.back();
       }
-    this->VarStack.push(cmDefinitions(parent));
+    this->VarStack.push_back(cmDefinitions(parent));
   }
 
   void InitializeDefinitions(cmMakefile* parent)
   {
-    this->VarStack.top() = parent->Internal->VarStack.top().MakeClosure();
+    this->VarStack.back() = parent->Internal->VarStack.back().MakeClosure();
   }
 
   const char* GetDefinition(std::string const& name)
   {
-    return this->VarStack.top().Get(name);
+    return this->VarStack.back().Get(name);
   }
 
   void SetDefinition(std::string const& name, std::string const& value)
   {
-    this->VarStack.top().Set(name, value.c_str());
+    this->VarStack.back().Set(name, value.c_str());
   }
 
   void RemoveDefinition(std::string const& name)
@@ -81,32 +81,32 @@ public:
     if (this->VarStack.size() > 1)
       {
       // In lower scopes we store keys, defined or not.
-      this->VarStack.top().Set(name, 0);
+      this->VarStack.back().Set(name, 0);
       }
     else
       {
-      this->VarStack.top().Erase(name);
+      this->VarStack.back().Erase(name);
       }
   }
 
   std::vector<std::string> LocalKeys() const
   {
-    return this->VarStack.top().LocalKeys();
+    return this->VarStack.back().LocalKeys();
   }
 
   std::vector<std::string> ClosureKeys() const
   {
-    return this->VarStack.top().ClosureKeys();
+    return this->VarStack.back().ClosureKeys();
   }
 
   void PopDefinitions()
   {
-    this->VarStack.pop();
+    this->VarStack.pop_back();
   }
 
   bool RaiseScope(std::string const& var, const char* varDef, cmMakefile* mf)
   {
-    cmDefinitions& cur = this->VarStack.top();
+    cmDefinitions& cur = this->VarStack.back();
     if(cmDefinitions* up = cur.GetParent())
       {
       // First localize the definition in the current scope.

-----------------------------------------------------------------------

Summary of changes:
 Source/cmMakefile.cxx |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list