[Cmake-commits] CMake branch, next, updated. v3.2.2-2389-g0243760
Stephen Kelly
steveire at gmail.com
Thu Apr 30 19:54:30 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 0243760567b7e05c08e3dd8852b2e6d9152dd7af (commit)
via d4143c8166396ec6d355e99a9bd61e3470dab561 (commit)
via c8367c85e56b273bf2d2ec428dbbc159691cdd8a (commit)
via c593ae71a3efe7c5fed08d16b0be46b114696e6d (commit)
from f255936761560c10aadb7e0b22b4c6851278f61b (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=0243760567b7e05c08e3dd8852b2e6d9152dd7af
commit 0243760567b7e05c08e3dd8852b2e6d9152dd7af
Merge: f255936 d4143c8
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Apr 30 19:54:21 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Apr 30 19:54:21 2015 -0400
Merge topic 'refactor-cmDefinitions-Get' into next
d4143c81 cmDefinitions: Make Get method static.
c8367c85 cmDefinitions: Inline GetInternal method.
c593ae71 cmDefinitions: Simplify creation of intermediate scope values.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4143c8166396ec6d355e99a9bd61e3470dab561
commit d4143c8166396ec6d355e99a9bd61e3470dab561
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 01:52:37 2015 +0200
cmDefinitions: Make Get method static.
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index cfcc000..ae42b8e 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 rit,
- std::list<cmDefinitions>::reverse_iterator rend);
+ static const char* Get(const std::string& key,
+ std::list<cmDefinitions>::reverse_iterator rit,
+ 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=c8367c85e56b273bf2d2ec428dbbc159691cdd8a
commit c8367c85e56b273bf2d2ec428dbbc159691cdd8a
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 01:40:42 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 01:52:37 2015 +0200
cmDefinitions: Inline GetInternal method.
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index d37f4ec..9117d0a 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -14,8 +14,7 @@
#include <assert.h>
//----------------------------------------------------------------------------
-cmDefinitions::Def const&
-cmDefinitions::GetInternal(const std::string& key,
+const char* cmDefinitions::Get(const std::string& key,
std::list<cmDefinitions>::reverse_iterator rit,
std::list<cmDefinitions>::reverse_iterator rend)
{
@@ -38,16 +37,7 @@ cmDefinitions::GetInternal(const std::string& key,
i = rit->Map.insert(MapType::value_type(
key, Def(i != rit->Map.end() ? i->second : 0))).first;
}
- return i->second;
-}
-
-//----------------------------------------------------------------------------
-const char* cmDefinitions::Get(const std::string& key,
- std::list<cmDefinitions>::reverse_iterator rit,
- std::list<cmDefinitions>::reverse_iterator rend)
-{
- Def const& def = this->GetInternal(key, rit, rend);
- return def.Exists? def.c_str() : 0;
+ return i->second.Exists ? i->second.c_str() : 0;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index d618911..cfcc000 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -72,11 +72,6 @@ private:
#endif
MapType Map;
- // Internal query and update methods.
- Def const& GetInternal(const std::string& key,
- std::list<cmDefinitions>::reverse_iterator rit,
- 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=c593ae71a3efe7c5fed08d16b0be46b114696e6d
commit c593ae71a3efe7c5fed08d16b0be46b114696e6d
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 1 01:30:49 2015 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 1 01:52:21 2015 +0200
cmDefinitions: Simplify creation of intermediate scope values.
Remove obsolete NoDef object.
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 1d0e108..d37f4ec 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -14,9 +14,6 @@
#include <assert.h>
//----------------------------------------------------------------------------
-cmDefinitions::Def cmDefinitions::NoDef;
-
-//----------------------------------------------------------------------------
cmDefinitions::Def const&
cmDefinitions::GetInternal(const std::string& key,
std::list<cmDefinitions>::reverse_iterator rit,
@@ -25,13 +22,11 @@ cmDefinitions::GetInternal(const std::string& key,
std::list<cmDefinitions>::reverse_iterator rbegin = rit;
assert(rit != rend);
MapType::const_iterator i;
- Def def = this->NoDef;
for ( ; rit != rend; ++rit)
{
i = rit->Map.find(key);
if(i != rit->Map.end())
{
- def = i->second;
break;
}
}
@@ -40,7 +35,8 @@ cmDefinitions::GetInternal(const std::string& key,
// Store the result in intermediate scopes.
for (rit = rbegin; rit != last; ++rit)
{
- i = rit->Map.insert(MapType::value_type(key, def)).first;
+ i = rit->Map.insert(MapType::value_type(
+ key, Def(i != rit->Map.end() ? i->second : 0))).first;
}
return i->second;
}
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 8b78f2c..d618911 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -63,7 +63,6 @@ private:
Def(Def const& d): std_string(d), Exists(d.Exists) {}
bool Exists;
};
- static Def NoDef;
// Local definitions, set or unset.
#if defined(CMAKE_BUILD_WITH_CMAKE)
-----------------------------------------------------------------------
Summary of changes:
Source/cmDefinitions.cxx | 22 ++++------------------
Source/cmDefinitions.h | 12 +++---------
Source/cmMakefile.cxx | 4 ++--
3 files changed, 9 insertions(+), 29 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list