[Cmake-commits] CMake branch, next, updated. v3.2.2-2415-g6c49c29

Stephen Kelly steveire at gmail.com
Fri May 1 13:48:31 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  6c49c290da32c1ff7f66ad84ca723ca0bcfe6217 (commit)
       via  6c7dad41d9f5e9b6ab6bdd6ddee837aa5509e19e (commit)
       via  a7ce0c7bc03efcfff6bf9fecc52663409262d73d (commit)
       via  7a5039fa6c0d84d1f4062211afcf0318db77f325 (commit)
       via  191573f7922aea3c1abdba325f5e65e4ba03d7c8 (commit)
       via  8b1745a1c5ed992e632bd4865c0f6a34b136041d (commit)
      from  f90f8e3476dc20851df186508314a681558ecf04 (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=6c49c290da32c1ff7f66ad84ca723ca0bcfe6217
commit 6c49c290da32c1ff7f66ad84ca723ca0bcfe6217
Merge: f90f8e3 6c7dad4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 13:48:30 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri May 1 13:48:30 2015 -0400

    Merge topic 'refactor-cmDefinitions-Get' into next
    
    6c7dad41 cmDefinitions: Make Get method static.
    a7ce0c7b cmDefinitions: Make GetInternal method static.
    7a5039fa cmDefinitions: Use static member without this->.
    191573f7 cmDefinitions: Remove Parent pointer.
    8b1745a1 cmDefinitions: Accept varStack iterators in Get API.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c7dad41d9f5e9b6ab6bdd6ddee837aa5509e19e
commit 6c7dad41d9f5e9b6ab6bdd6ddee837aa5509e19e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 01:50:45 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 19:45:05 2015 +0200

    cmDefinitions: Make Get method static.

diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 77edbd0..b244793 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -31,9 +31,9 @@ class cmDefinitions
 public:
   /** 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,
-                  std::list<cmDefinitions>::reverse_iterator rbegin,
-                  std::list<cmDefinitions>::reverse_iterator rend);
+  static const char* Get(const std::string& key,
+                         std::list<cmDefinitions>::reverse_iterator rbegin,
+                         std::list<cmDefinitions>::reverse_iterator rend);
 
   /** Set (or unset if null) a value associated with a key.  */
   void Set(const std::string& key, const char* value);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b16d7e6..4ed2419 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -65,8 +65,8 @@ public:
 
   const char* GetDefinition(std::string const& name)
   {
-    return this->VarStack.back().Get(name, this->VarStack.rbegin(),
-                                     this->VarStack.rend());
+    return cmDefinitions::Get(name, this->VarStack.rbegin(),
+                                    this->VarStack.rend());
   }
 
   void SetDefinition(std::string const& name, std::string const& value)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7ce0c7bc03efcfff6bf9fecc52663409262d73d
commit a7ce0c7bc03efcfff6bf9fecc52663409262d73d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 01:13:38 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 19:44:35 2015 +0200

    cmDefinitions: Make GetInternal method static.
    
    For some reason, using recursion here is faster to configure ParaView
    than using a loop.  Probably some compiler optimization is inhibited
    by using a loop.
    
    Co-Author: Brad King <brad.king at kitware.com>

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index a429b6d..f54bc4d 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -22,20 +22,20 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(
   std::list<cmDefinitions>::reverse_iterator rbegin,
   std::list<cmDefinitions>::reverse_iterator rend)
 {
-  assert(&*rbegin == this);
-  MapType::const_iterator i = this->Map.find(key);
-  if(i != this->Map.end())
+  assert(rbegin != rend);
+  MapType::const_iterator i = rbegin->Map.find(key);
+  if (i != rbegin->Map.end())
     {
     return i->second;
     }
-  ++rbegin;
-  if(rbegin == rend)
+  std::list<cmDefinitions>::reverse_iterator rit = rbegin;
+  ++rit;
+  if (rit == rend)
     {
     return cmDefinitions::NoDef;
     }
-  // Query the parent scope and store the result locally.
-  Def def = rbegin->GetInternal(key, rbegin, rend);
-  return this->Map.insert(MapType::value_type(key, def)).first->second;
+  Def const& def = cmDefinitions::GetInternal(key, rit, rend);
+  return rbegin->Map.insert(MapType::value_type(key, def)).first->second;
 }
 
 //----------------------------------------------------------------------------
@@ -43,7 +43,7 @@ const char* cmDefinitions::Get(const std::string& key,
     std::list<cmDefinitions>::reverse_iterator rbegin,
     std::list<cmDefinitions>::reverse_iterator rend)
 {
-  Def const& def = this->GetInternal(key, rbegin, rend);
+  Def const& def = cmDefinitions::GetInternal(key, rbegin, rend);
   return def.Exists? def.c_str() : 0;
 }
 
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 33f468b..77edbd0 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -73,11 +73,9 @@ private:
 #endif
   MapType Map;
 
-  // Internal query and update methods.
-  Def const& GetInternal(const std::string& key,
-                         std::list<cmDefinitions>::reverse_iterator rbegin,
-                         std::list<cmDefinitions>::reverse_iterator rend);
-
+  static Def const& GetInternal(const std::string& key,
+    std::list<cmDefinitions>::reverse_iterator rbegin,
+    std::list<cmDefinitions>::reverse_iterator rend);
   void MakeClosure(std::set<std::string>& undefined,
                    std::list<cmDefinitions>::const_reverse_iterator rbegin,
                    std::list<cmDefinitions>::const_reverse_iterator rend);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a5039fa6c0d84d1f4062211afcf0318db77f325
commit 7a5039fa6c0d84d1f4062211afcf0318db77f325
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 19:35:47 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 19:36:03 2015 +0200

    cmDefinitions: Use static member without this->.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 6e26656..a429b6d 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -31,7 +31,7 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(
   ++rbegin;
   if(rbegin == rend)
     {
-    return this->NoDef;
+    return cmDefinitions::NoDef;
     }
   // Query the parent scope and store the result locally.
   Def def = rbegin->GetInternal(key, rbegin, rend);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=191573f7922aea3c1abdba325f5e65e4ba03d7c8
commit 191573f7922aea3c1abdba325f5e65e4ba03d7c8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 16:19:11 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 19:34:59 2015 +0200

    cmDefinitions: Remove Parent pointer.
    
    All structural knowledge of the stack of scopes is now external.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 94d27c2..6e26656 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -17,12 +17,6 @@
 cmDefinitions::Def cmDefinitions::NoDef;
 
 //----------------------------------------------------------------------------
-cmDefinitions::cmDefinitions(cmDefinitions* parent)
-  : Up(parent)
-{
-}
-
-//----------------------------------------------------------------------------
 cmDefinitions::Def const& cmDefinitions::GetInternal(
   const std::string& key,
   std::list<cmDefinitions>::reverse_iterator rbegin,
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 2bcfcb0..33f468b 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<std::string, Def> MapType;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ae7e564..b16d7e6 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)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b1745a1c5ed992e632bd4865c0f6a34b136041d
commit 8b1745a1c5ed992e632bd4865c0f6a34b136041d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Apr 30 00:19:55 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 19:34:59 2015 +0200

    cmDefinitions: Accept varStack iterators in Get API.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 61328be..94d27c2 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -11,6 +11,8 @@
 ============================================================================*/
 #include "cmDefinitions.h"
 
+#include <assert.h>
+
 //----------------------------------------------------------------------------
 cmDefinitions::Def cmDefinitions::NoDef;
 
@@ -21,28 +23,33 @@ cmDefinitions::cmDefinitions(cmDefinitions* parent)
 }
 
 //----------------------------------------------------------------------------
-cmDefinitions::Def const&
-cmDefinitions::GetInternal(const std::string& key)
+cmDefinitions::Def const& cmDefinitions::GetInternal(
+  const std::string& key,
+  std::list<cmDefinitions>::reverse_iterator rbegin,
+  std::list<cmDefinitions>::reverse_iterator rend)
 {
+  assert(&*rbegin == this);
   MapType::const_iterator i = this->Map.find(key);
   if(i != this->Map.end())
     {
     return i->second;
     }
-  cmDefinitions* up = this->Up;
-  if(!up)
+  ++rbegin;
+  if(rbegin == rend)
     {
     return this->NoDef;
     }
   // Query the parent scope and store the result locally.
-  Def def = up->GetInternal(key);
+  Def def = rbegin->GetInternal(key, rbegin, rend);
   return this->Map.insert(MapType::value_type(key, def)).first->second;
 }
 
 //----------------------------------------------------------------------------
-const char* cmDefinitions::Get(const std::string& key)
+const char* cmDefinitions::Get(const std::string& key,
+    std::list<cmDefinitions>::reverse_iterator rbegin,
+    std::list<cmDefinitions>::reverse_iterator rend)
 {
-  Def const& def = this->GetInternal(key);
+  Def const& def = this->GetInternal(key, rbegin, rend);
   return def.Exists? def.c_str() : 0;
 }
 
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4c7f11f..2bcfcb0 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -37,7 +37,9 @@ public:
 
   /** 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);
+  const char* Get(const std::string& key,
+                  std::list<cmDefinitions>::reverse_iterator rbegin,
+                  std::list<cmDefinitions>::reverse_iterator rend);
 
   /** Set (or unset if null) a value associated with a key.  */
   void Set(const std::string& key, const char* value);
@@ -81,7 +83,9 @@ private:
   MapType Map;
 
   // Internal query and update methods.
-  Def const& GetInternal(const std::string& key);
+  Def const& GetInternal(const std::string& key,
+                         std::list<cmDefinitions>::reverse_iterator rbegin,
+                         std::list<cmDefinitions>::reverse_iterator rend);
 
   void MakeClosure(std::set<std::string>& undefined,
                    std::list<cmDefinitions>::const_reverse_iterator rbegin,
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 5686b1b..ae7e564 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -70,7 +70,8 @@ public:
 
   const char* GetDefinition(std::string const& name)
   {
-    return this->VarStack.back().Get(name);
+    return this->VarStack.back().Get(name, this->VarStack.rbegin(),
+                                     this->VarStack.rend());
   }
 
   void SetDefinition(std::string const& name, std::string const& value)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list