[Cmake-commits] CMake branch, next, updated. v3.2.3-1497-gc27ccf3

Stephen Kelly steveire at gmail.com
Thu Jun 4 16:28:26 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  c27ccf3f4bf1ff5c0460a04e5eb922aaefcca102 (commit)
       via  09a2d64e53add41e64b6fdcefb8fb27a572bec5d (commit)
       via  7adb2986543d84509f02d39f7c1bdeb74b2a2c0e (commit)
       via  9e7d00f54032ceacafa586e709fc7b1a41f6f268 (commit)
       via  ca140c2e898ca74a7daa305449b136b1294a41f0 (commit)
       via  d5dc4169ac1c4dd5abd385b1e8499119df88c657 (commit)
      from  769f02cab22f0679b53772589b22d6fcf0105a45 (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=c27ccf3f4bf1ff5c0460a04e5eb922aaefcca102
commit c27ccf3f4bf1ff5c0460a04e5eb922aaefcca102
Merge: 769f02c 09a2d64
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jun 4 16:28:25 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Jun 4 16:28:25 2015 -0400

    Merge topic 'clean-up-cmMakefile' into next
    
    09a2d64e cmMakefile: Add a method to abstract access to execution file.
    7adb2986 cmMakefile: Out-of-line the cmMakefileCall.
    9e7d00f5 cmMakefile: Inline PushScope into PushFunctionScope.
    ca140c2e cmMakefile: Create a unified raii for macro scopes.
    d5dc4169 cmMakefile: Create a unified raii for function scopes.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09a2d64e53add41e64b6fdcefb8fb27a572bec5d
commit 09a2d64e53add41e64b6fdcefb8fb27a572bec5d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 29 22:48:51 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jun 4 22:08:24 2015 +0200

    cmMakefile: Add a method to abstract access to execution file.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d4bf6c1..e94cffa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -306,6 +306,15 @@ cmListFileContext cmMakefile::GetExecutionContext() const
   return *this->CallStack.back().Context;
 }
 
+std::string cmMakefile::GetExecutionFilePath() const
+{
+  if (this->CallStack.empty())
+    {
+    return std::string();
+    }
+  return this->CallStack.back().Context->FilePath;
+}
+
 //----------------------------------------------------------------------------
 void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
 {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 0b328e9..1806b5b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -576,6 +576,8 @@ public:
   cmListFileBacktrace GetBacktrace() const;
   cmListFileBacktrace GetBacktrace(cmListFileContext const& lfc) const;
   cmListFileContext GetExecutionContext() const;
+  std::string GetExecutionFilePath() const;
+
 
   /**
    * Get the vector of  files created by this makefile

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7adb2986543d84509f02d39f7c1bdeb74b2a2c0e
commit 7adb2986543d84509f02d39f7c1bdeb74b2a2c0e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 31 19:03:46 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jun 4 22:08:24 2015 +0200

    cmMakefile: Out-of-line the cmMakefileCall.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2072418..d4bf6c1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -5494,3 +5494,15 @@ cmMakefile::MacroPushPop::~MacroPushPop()
 {
   this->Makefile->PopMacroScope(this->ReportError);
 }
+
+cmMakefileCall::cmMakefileCall(cmMakefile* mf, const cmListFileContext& lfc,
+                               cmExecutionStatus& status): Makefile(mf)
+{
+  cmMakefile::CallStackEntry entry = {&lfc, &status};
+  this->Makefile->CallStack.push_back(entry);
+}
+
+cmMakefileCall::~cmMakefileCall()
+{
+  this->Makefile->CallStack.pop_back();
+}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 0914a99..0b328e9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -1084,15 +1084,8 @@ class cmMakefileCall
 public:
   cmMakefileCall(cmMakefile* mf,
                  cmListFileContext const& lfc,
-                 cmExecutionStatus& status): Makefile(mf)
-    {
-    cmMakefile::CallStackEntry entry = {&lfc, &status};
-    this->Makefile->CallStack.push_back(entry);
-    }
-  ~cmMakefileCall()
-    {
-    this->Makefile->CallStack.pop_back();
-    }
+                 cmExecutionStatus& status);
+  ~cmMakefileCall();
 private:
   cmMakefile* Makefile;
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e7d00f54032ceacafa586e709fc7b1a41f6f268
commit 9e7d00f54032ceacafa586e709fc7b1a41f6f268
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 31 23:45:52 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jun 4 22:08:23 2015 +0200

    cmMakefile: Inline PushScope into PushFunctionScope.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d3a8121..2072418 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1564,7 +1564,13 @@ void cmMakefile::InitializeFromParent()
 
 void cmMakefile::PushFunctionScope(const cmPolicies::PolicyMap& pm)
 {
-  this->PushScope();
+  this->Internal->PushDefinitions();
+
+  this->PushLoopBlockBarrier();
+
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+  this->GetGlobalGenerator()->GetFileLockPool().PushFunctionScope();
+#endif
 
   this->PushFunctionBlockerBarrier();
 
@@ -1579,7 +1585,15 @@ void cmMakefile::PopFunctionScope(bool reportError)
 
   this->PopFunctionBlockerBarrier(reportError);
 
-  this->PopScope();
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+  this->GetGlobalGenerator()->GetFileLockPool().PopFunctionScope();
+#endif
+
+  this->PopLoopBlockBarrier();
+
+  this->CheckForUnusedVariables();
+
+  this->Internal->PopDefinitions();
 }
 
 void cmMakefile::PushMacroScope(const cmPolicies::PolicyMap& pm)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca140c2e898ca74a7daa305449b136b1294a41f0
commit ca140c2e898ca74a7daa305449b136b1294a41f0
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 31 18:32:01 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jun 4 22:08:23 2015 +0200

    cmMakefile: Create a unified raii for macro scopes.

diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 7ac4432..028ab62 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -96,12 +96,8 @@ bool cmMacroHelperCommand::InvokeInitialPass
     return false;
     }
 
-  // Enforce matching logical blocks inside the macro.
-  cmMakefile::LexicalPushPop lexScope(this->Makefile);
-
-  // Push a weak policy scope which restores the policies recorded at
-  // macro creation.
-  cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies);
+  cmMakefile::MacroPushPop macroScope(this->Makefile,
+                                      this->Policies);
 
   // set the value of argc
   std::ostringstream argcDefStream;
@@ -191,8 +187,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
       {
       // The error message should have already included the call stack
       // so we do not need to report an error here.
-      lexScope.Quiet();
-      polScope.Quiet();
+      macroScope.Quiet();
       inStatus.SetNestedError(true);
       return false;
       }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7012701..d3a8121 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1582,6 +1582,22 @@ void cmMakefile::PopFunctionScope(bool reportError)
   this->PopScope();
 }
 
+void cmMakefile::PushMacroScope(const cmPolicies::PolicyMap& pm)
+{
+  this->PushFunctionBlockerBarrier();
+
+  this->PushPolicy(true, pm);
+  this->PushPolicyBarrier();
+}
+
+void cmMakefile::PopMacroScope(bool reportError)
+{
+  this->PopPolicyBarrier(reportError);
+  this->PopPolicy();
+
+  this->PopFunctionBlockerBarrier(reportError);
+}
+
 //----------------------------------------------------------------------------
 class cmMakefileCurrent
 {
@@ -5451,3 +5467,16 @@ cmMakefile::FunctionPushPop::~FunctionPushPop()
 {
   this->Makefile->PopFunctionScope(this->ReportError);
 }
+
+
+cmMakefile::MacroPushPop::MacroPushPop(cmMakefile* mf,
+                                       const cmPolicies::PolicyMap& pm)
+  : Makefile(mf), ReportError(true)
+{
+  this->Makefile->PushMacroScope(pm);
+}
+
+cmMakefile::MacroPushPop::~MacroPushPop()
+{
+  this->Makefile->PopMacroScope(this->ReportError);
+}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ed9bc70..0914a99 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -759,8 +759,23 @@ public:
     bool ReportError;
   };
 
+  class MacroPushPop
+  {
+  public:
+    MacroPushPop(cmMakefile* mf,
+                    cmPolicies::PolicyMap const& pm);
+    ~MacroPushPop();
+
+    void Quiet() { this->ReportError = false; }
+  private:
+    cmMakefile* Makefile;
+    bool ReportError;
+  };
+
   void PushFunctionScope(cmPolicies::PolicyMap const& pm);
   void PopFunctionScope(bool reportError);
+  void PushMacroScope(cmPolicies::PolicyMap const& pm);
+  void PopMacroScope(bool reportError);
   void PushScope();
   void PopScope();
   void RaiseScope(const std::string& var, const char *value);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5dc4169ac1c4dd5abd385b1e8499119df88c657
commit d5dc4169ac1c4dd5abd385b1e8499119df88c657
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun May 31 18:19:58 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Thu Jun 4 22:08:23 2015 +0200

    cmMakefile: Create a unified raii for function scopes.

diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 001adb1..dc6d2d2 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -73,7 +73,6 @@ public:
   cmPolicies::PolicyMap Policies;
 };
 
-
 bool cmFunctionHelperCommand::InvokeInitialPass
 (const std::vector<cmListFileArgument>& args,
  cmExecutionStatus & inStatus)
@@ -93,14 +92,8 @@ bool cmFunctionHelperCommand::InvokeInitialPass
     return false;
     }
 
-  // we push a scope on the makefile
-  cmMakefile::ScopePushPop varScope(this->Makefile);
-  cmMakefile::LexicalPushPop lexScope(this->Makefile);
-  static_cast<void>(varScope);
-
-  // Push a weak policy scope which restores the policies recorded at
-  // function creation.
-  cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies);
+  cmMakefile::FunctionPushPop functionScope(this->Makefile,
+                                            this->Policies);
 
   // set the value of argc
   std::ostringstream strStream;
@@ -145,8 +138,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
       {
       // The error message should have already included the call stack
       // so we do not need to report an error here.
-      lexScope.Quiet();
-      polScope.Quiet();
+      functionScope.Quiet();
       inStatus.SetNestedError(true);
       return false;
       }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b5d976a..7012701 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1562,6 +1562,26 @@ void cmMakefile::InitializeFromParent()
   this->ImportedTargets = parent->ImportedTargets;
 }
 
+void cmMakefile::PushFunctionScope(const cmPolicies::PolicyMap& pm)
+{
+  this->PushScope();
+
+  this->PushFunctionBlockerBarrier();
+
+  this->PushPolicy(true, pm);
+  this->PushPolicyBarrier();
+}
+
+void cmMakefile::PopFunctionScope(bool reportError)
+{
+  this->PopPolicyBarrier(reportError);
+  this->PopPolicy();
+
+  this->PopFunctionBlockerBarrier(reportError);
+
+  this->PopScope();
+}
+
 //----------------------------------------------------------------------------
 class cmMakefileCurrent
 {
@@ -5418,3 +5438,16 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const
     }
   return true;
 }
+
+
+cmMakefile::FunctionPushPop::FunctionPushPop(cmMakefile* mf,
+                                             cmPolicies::PolicyMap const& pm)
+  : Makefile(mf), ReportError(true)
+{
+  this->Makefile->PushFunctionScope(pm);
+}
+
+cmMakefile::FunctionPushPop::~FunctionPushPop()
+{
+  this->Makefile->PopFunctionScope(this->ReportError);
+}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 431ed08..ed9bc70 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -746,7 +746,21 @@ public:
   const std::vector<cmTestGenerator*>& GetTestGenerators() const
     { return this->TestGenerators; }
 
-  // push and pop variable scopes
+  class FunctionPushPop
+  {
+  public:
+    FunctionPushPop(cmMakefile* mf,
+                    cmPolicies::PolicyMap const& pm);
+    ~FunctionPushPop();
+
+    void Quiet() { this->ReportError = false; }
+  private:
+    cmMakefile* Makefile;
+    bool ReportError;
+  };
+
+  void PushFunctionScope(cmPolicies::PolicyMap const& pm);
+  void PopFunctionScope(bool reportError);
   void PushScope();
   void PopScope();
   void RaiseScope(const std::string& var, const char *value);

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

Summary of changes:
 Source/cmFunctionCommand.cxx |   14 ++----
 Source/cmMacroCommand.cxx    |   11 ++---
 Source/cmMakefile.cxx        |   97 ++++++++++++++++++++++++++++++++++++++++++
 Source/cmMakefile.h          |   44 ++++++++++++++-----
 4 files changed, 137 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list