[Cmake-commits] CMake branch, next, updated. v3.2.2-2267-gcacf47a

Stephen Kelly steveire at gmail.com
Tue Apr 28 18:54:18 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  cacf47a2354c547f40a0cbd6ad9aed248c216c0e (commit)
       via  933c144f1d2ff5d21b1e7fb41da83f9d47e740e5 (commit)
       via  1e2170d4461fe1feebfc5c5efa14dfc11f3d6455 (commit)
       via  0bc62a1e4f6c041a4134e3303c22a0de36286b4f (commit)
       via  6c953b73176e246783c87b3a7be08833af8a645d (commit)
      from  6e5d72779f4cfbad2ad281b458914b8c0f914116 (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=cacf47a2354c547f40a0cbd6ad9aed248c216c0e
commit cacf47a2354c547f40a0cbd6ad9aed248c216c0e
Merge: 6e5d727 933c144
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Apr 28 18:54:17 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 28 18:54:17 2015 -0400

    Merge topic 'refactor-cmDefinitions-API' into next
    
    933c144f cmDefinitions: Make ClosureKeys API vector-based.
    1e2170d4 cmDefinitions: Inline GetClosureKeys implementation.
    0bc62a1e cmDefinitions: Replace ClosureKeys recursion with looping.
    6c953b73 cmDefinitions: Change LocalKeys to return a vector.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=933c144f1d2ff5d21b1e7fb41da83f9d47e740e5
commit 933c144f1d2ff5d21b1e7fb41da83f9d47e740e5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 15:36:49 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 29 00:53:11 2015 +0200

    cmDefinitions: Make ClosureKeys API vector-based.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index a543edf..0556654 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -121,7 +121,7 @@ void cmDefinitions::ClosureImpl(std::set<std::string>& undefined,
 }
 
 //----------------------------------------------------------------------------
-std::set<std::string> cmDefinitions::ClosureKeys() const
+std::vector<std::string> cmDefinitions::ClosureKeys() const
 {
   std::set<std::string> defined;
   std::set<std::string> undefined;
@@ -144,5 +144,5 @@ std::set<std::string> cmDefinitions::ClosureKeys() const
       }
     up = up->Up;
     }
-  return defined;
+  return std::vector<std::string>(defined.begin(), defined.end());
 }
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 950970b..4664090 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -50,7 +50,7 @@ public:
   cmDefinitions Closure() const;
 
   /** Compute the set of all defined keys.  */
-  std::set<std::string> ClosureKeys() const;
+  std::vector<std::string> ClosureKeys() const;
 
 private:
   // String with existence boolean.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 598c657..cbf32dd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -94,7 +94,7 @@ public:
     return this->VarStack.top().LocalKeys();
   }
 
-  std::set<std::string> ClosureKeys() const
+  std::vector<std::string> ClosureKeys() const
   {
     return this->VarStack.top().ClosureKeys();
   }
@@ -2496,8 +2496,7 @@ std::vector<std::string> cmMakefile
   std::vector<std::string> res;
   if ( !cacheonly )
     {
-    std::set<std::string> definitions = this->Internal->ClosureKeys();
-    res.insert(res.end(), definitions.begin(), definitions.end());
+    res = this->Internal->ClosureKeys();
     }
   std::vector<std::string> cacheKeys =
       this->GetState()->GetCacheEntryKeys();

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e2170d4461fe1feebfc5c5efa14dfc11f3d6455
commit 1e2170d4461fe1feebfc5c5efa14dfc11f3d6455
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 15:38:09 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 29 00:53:11 2015 +0200

    cmDefinitions: Inline GetClosureKeys implementation.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index ec40edf..a543edf 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -125,14 +125,7 @@ std::set<std::string> cmDefinitions::ClosureKeys() const
 {
   std::set<std::string> defined;
   std::set<std::string> undefined;
-  this->ClosureKeys(defined, undefined);
-  return defined;
-}
 
-//----------------------------------------------------------------------------
-void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
-                                std::set<std::string>& undefined) const
-{
   cmDefinitions const* up = this;
 
   while (up)
@@ -151,4 +144,5 @@ void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
       }
     up = up->Up;
     }
+  return defined;
 }
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index d21ec23..950970b 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -86,10 +86,6 @@ private:
   cmDefinitions(ClosureTag const&, cmDefinitions const* root);
   void ClosureImpl(std::set<std::string>& undefined,
                    cmDefinitions const* defs);
-
-  // Implementation of ClosureKeys() method.
-  void ClosureKeys(std::set<std::string>& defined,
-                   std::set<std::string>& undefined) const;
 };
 
 #endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bc62a1e4f6c041a4134e3303c22a0de36286b4f
commit 0bc62a1e4f6c041a4134e3303c22a0de36286b4f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 11:38:08 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 29 00:53:11 2015 +0200

    cmDefinitions: Replace ClosureKeys recursion with looping.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 6b874b1..ec40edf 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -133,22 +133,22 @@ std::set<std::string> cmDefinitions::ClosureKeys() const
 void cmDefinitions::ClosureKeys(std::set<std::string>& defined,
                                 std::set<std::string>& undefined) const
 {
-  // Consider local definitions.
-  for(MapType::const_iterator mi = this->Map.begin();
-      mi != this->Map.end(); ++mi)
+  cmDefinitions const* up = this;
+
+  while (up)
     {
-    // Use this key if it is not already set or unset.
-    if(defined.find(mi->first) == defined.end() &&
-       undefined.find(mi->first) == undefined.end())
+    // Consider local definitions.
+    for(MapType::const_iterator mi = up->Map.begin();
+        mi != up->Map.end(); ++mi)
       {
-      std::set<std::string>& m = mi->second.Exists? defined : undefined;
-      m.insert(mi->first);
+      // Use this key if it is not already set or unset.
+      if(defined.find(mi->first) == defined.end() &&
+         undefined.find(mi->first) == undefined.end())
+        {
+        std::set<std::string>& m = mi->second.Exists? defined : undefined;
+        m.insert(mi->first);
+        }
       }
-    }
-
-  // Traverse parents.
-  if(cmDefinitions const* up = this->Up)
-    {
-    up->ClosureKeys(defined, undefined);
+    up = up->Up;
     }
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c953b73176e246783c87b3a7be08833af8a645d
commit 6c953b73176e246783c87b3a7be08833af8a645d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 26 16:34:13 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed Apr 29 00:40:26 2015 +0200

    cmDefinitions: Change LocalKeys to return a vector.
    
    This is more efficient and we lose nothing.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 032a96e..6b874b1 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -60,16 +60,17 @@ void cmDefinitions::Erase(const std::string& key)
 }
 
 //----------------------------------------------------------------------------
-std::set<std::string> cmDefinitions::LocalKeys() const
+std::vector<std::string> cmDefinitions::LocalKeys() const
 {
-  std::set<std::string> keys;
+  std::vector<std::string> keys;
+  keys.reserve(this->Map.size());
   // Consider local definitions.
   for(MapType::const_iterator mi = this->Map.begin();
       mi != this->Map.end(); ++mi)
     {
     if (mi->second.Exists)
       {
-      keys.insert(mi->first);
+      keys.push_back(mi->first);
       }
     }
   return keys;
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 13f885d..d21ec23 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -43,7 +43,7 @@ public:
   void Erase(const std::string& key);
 
   /** Get the set of all local keys.  */
-  std::set<std::string> LocalKeys() const;
+  std::vector<std::string> LocalKeys() const;
 
   /** Compute the closure of all defined keys with values.
       This flattens the scope.  The result has no parent.  */
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7180c6c..598c657 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -89,7 +89,7 @@ public:
       }
   }
 
-  std::set<std::string> LocalKeys() const
+  std::vector<std::string> LocalKeys() const
   {
     return this->VarStack.top().LocalKeys();
   }
@@ -1883,8 +1883,8 @@ void cmMakefile::CheckForUnusedVariables() const
     {
     return;
     }
-  const std::set<std::string>& locals = this->Internal->LocalKeys();
-  std::set<std::string>::const_iterator it = locals.begin();
+  const std::vector<std::string>& locals = this->Internal->LocalKeys();
+  std::vector<std::string>::const_iterator it = locals.begin();
   for (; it != locals.end(); ++it)
     {
     this->CheckForUnused("out of scope", *it);
@@ -4436,10 +4436,10 @@ void cmMakefile::PopScope()
 
   std::set<std::string> init = this->Internal->VarInitStack.top();
   std::set<std::string> usage = this->Internal->VarUsageStack.top();
-  const std::set<std::string>& locals = this->Internal->LocalKeys();
+  const std::vector<std::string>& locals = this->Internal->LocalKeys();
   // Remove initialization and usage information for variables in the local
   // scope.
-  std::set<std::string>::const_iterator it = locals.begin();
+  std::vector<std::string>::const_iterator it = locals.begin();
   for (; it != locals.end(); ++it)
     {
     init.erase(*it);

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

Summary of changes:
 Source/cmDefinitions.cxx |   45 ++++++++++++++++++++-------------------------
 Source/cmDefinitions.h   |    8 ++------
 Source/cmMakefile.cxx    |   15 +++++++--------
 3 files changed, 29 insertions(+), 39 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list