[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-828-gad034c4

Stephen Kelly steveire at gmail.com
Sun Jul 5 20:12:04 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  ad034c4a97a777f7a2f42a35110599b4fd99ac9c (commit)
       via  9c323873a433cab7b90616cee08eb4374cc1a54f (commit)
       via  4551b90e7395e2c4e5680c8101ac494b7c7ab77e (commit)
       via  0eb70376014b73c4970489c49000fcc6e46478cb (commit)
       via  b64c894238344222acf7292718d699fa420324db (commit)
       via  5af7740bd25582cb03bbda81c8badc47c98e325b (commit)
      from  30c71d915bf2feb6a37791f840f6519ebcf624d8 (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=ad034c4a97a777f7a2f42a35110599b4fd99ac9c
commit ad034c4a97a777f7a2f42a35110599b4fd99ac9c
Merge: 30c71d9 9c32387
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 5 20:12:02 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jul 5 20:12:02 2015 -0400

    Merge topic 'refactor-cmListFileBacktrace' into next
    
    9c323873 cmListFileBacktrace: Implement in terms of cmState::Snapshot.
    4551b90e cmListFile: Remove FilePath member from cmListFileContext.
    0eb70376 cmMakefile: Set the FilePath on the frame from the cmState.
    b64c8942 cmMakefile: Create intermediate variables for snapshot frames.
    5af7740b cmMakefile: Create a scoped context for parsing listfiles.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c323873a433cab7b90616cee08eb4374cc1a54f
commit 9c323873a433cab7b90616cee08eb4374cc1a54f
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 29 22:37:59 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 6 02:11:51 2015 +0200

    cmListFileBacktrace: Implement in terms of cmState::Snapshot.
    
    Avoid copying many strings into each backtrace object.

diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index cdf278c..20448c1 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -115,10 +115,7 @@ IsFunctionBlocked(const cmListFileFunction& lff,
               {
               std::string err = cmIfCommandError(expandedArguments);
               err += errorString;
-              cmListFileContext lfc =
-                  cmListFileContext::FromCommandContext(
-                    this->Functions[c], this->GetStartingContext().FilePath);
-              cmListFileBacktrace bt = mf.GetBacktrace(lfc);
+              cmListFileBacktrace bt = mf.GetBacktrace(this->Functions[c]);
               mf.GetCMakeInstance()->IssueMessage(messType, err, bt);
               if (messType == cmake::FATAL_ERROR)
                 {
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 9141d88..1097dc2 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -398,40 +398,50 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
     }
 }
 
-void cmListFileBacktrace::Append(cmListFileContext const& context)
-{
-  this->push_back(context);
-}
-
 void cmListFileBacktrace::PrintTitle(std::ostream& out)
 {
-  if (this->empty())
+  if (!this->Snapshot.IsValid())
     {
     return;
     }
-
   cmOutputConverter converter(this->Snapshot);
-  cmListFileContext lfc = this->front();
+  cmListFileContext lfc =
+      cmListFileContext::FromCommandContext(
+        this->Context, this->Snapshot.GetExecutionListFile());
   lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
   out << (lfc.Line ? " at " : " in ") << lfc;
 }
 
 void cmListFileBacktrace::PrintCallStack(std::ostream& out)
 {
-  if (size() <= 1)
+  if (!this->Snapshot.IsValid())
+    {
+    return;
+    }
+  cmState::Snapshot parent = this->Snapshot.GetCallStackParent();
+  if (!parent.IsValid() || parent.GetExecutionListFile().empty())
     {
     return;
     }
 
   cmOutputConverter converter(this->Snapshot);
-  const_iterator i = this->begin() + 1;
+  std::string commandName = this->Snapshot.GetEntryPointCommand();
+  long commandLine = this->Snapshot.GetEntryPointLine();
+
   out << "Call Stack (most recent call first):\n";
-  while(i != this->end())
+  while(parent.IsValid())
     {
-    cmListFileContext lfc = *i;
-    lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
+    cmListFileContext lfc;
+    lfc.Name = commandName;
+    lfc.Line = commandLine;
+
+    lfc.FilePath = converter.Convert(parent.GetExecutionListFile(),
+                                     cmOutputConverter::HOME);
     out << "  " << lfc << "\n";
-    ++i;
+
+    commandName = parent.GetEntryPointCommand();
+    commandLine = parent.GetEntryPointLine();
+    parent = parent.GetCallStackParent();
     }
 }
 
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 57bf253..aa8a34c 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -86,19 +86,19 @@ struct cmListFileFunction: public cmCommandContext
   std::vector<cmListFileArgument> Arguments;
 };
 
-class cmListFileBacktrace: private std::vector<cmListFileContext>
+class cmListFileBacktrace
 {
   public:
-    cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot())
-      : Snapshot(snapshot)
+    cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot(),
+                        cmCommandContext const& cc = cmCommandContext())
+      : Context(cc), Snapshot(snapshot)
     {
     }
 
-    void Append(cmListFileContext const& context);
-
     void PrintTitle(std::ostream& out);
     void PrintCallStack(std::ostream& out);
   private:
+    cmCommandContext Context;
     cmState::Snapshot Snapshot;
 };
 
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9f2abff..94c77e1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -275,43 +275,21 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
 //----------------------------------------------------------------------------
 cmListFileBacktrace cmMakefile::GetBacktrace() const
 {
-  cmListFileBacktrace backtrace(this->StateSnapshot);
-  cmState::Snapshot snp = this->StateSnapshot;
-  for(std::vector<cmCommandContext const*>::const_reverse_iterator
-      i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend();
-      ++i, snp = snp.GetCallStackParent())
+  cmListFileBacktrace backtrace;
+  if (!this->ContextStack.empty())
     {
-    assert(snp.IsValid());
-    cmListFileContext frame =
-        cmListFileContext::FromCommandContext(*(*i),
-                                              snp.GetExecutionListFile());
-    backtrace.Append(frame);
+    backtrace = cmListFileBacktrace(this->StateSnapshot,
+                                    *this->ContextStack.back());
     }
   return backtrace;
 }
 
 //----------------------------------------------------------------------------
 cmListFileBacktrace
-cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
+cmMakefile::GetBacktrace(cmCommandContext const& cc) const
 {
-  cmListFileBacktrace backtrace(this->StateSnapshot);
-  backtrace.Append(lfc);
   cmState::Snapshot snp = this->StateSnapshot;
-  assert(snp.GetExecutionListFile() == lfc.FilePath);
-  snp = snp.GetCallStackParent();
-  for(std::vector<cmCommandContext const*>::const_reverse_iterator
-      i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend();
-      ++i, snp = snp.GetCallStackParent())
-    {
-    assert(snp.IsValid());
-    cmListFileContext frame =
-        cmListFileContext::FromCommandContext(*(*i),
-                                              snp.GetExecutionListFile());
-    backtrace.Append(frame);
-    }
-  return backtrace;
+  return cmListFileBacktrace(snp, cc);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d3cf02e..82a2279 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -547,7 +547,7 @@ public:
    * Get the current context backtrace.
    */
   cmListFileBacktrace GetBacktrace() const;
-  cmListFileBacktrace GetBacktrace(cmListFileContext const& lfc) const;
+  cmListFileBacktrace GetBacktrace(cmCommandContext const& lfc) const;
   cmListFileContext GetExecutionContext() const;
 
   /**

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4551b90e7395e2c4e5680c8101ac494b7c7ab77e
commit 4551b90e7395e2c4e5680c8101ac494b7c7ab77e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 13:12:50 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 6 02:11:51 2015 +0200

    cmListFile: Remove FilePath member from cmListFileContext.
    
    There is no need to store the FilePath for every function, as it is
    known by other means.

diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 20448c1..cdf278c 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -115,7 +115,10 @@ IsFunctionBlocked(const cmListFileFunction& lff,
               {
               std::string err = cmIfCommandError(expandedArguments);
               err += errorString;
-              cmListFileBacktrace bt = mf.GetBacktrace(this->Functions[c]);
+              cmListFileContext lfc =
+                  cmListFileContext::FromCommandContext(
+                    this->Functions[c], this->GetStartingContext().FilePath);
+              cmListFileBacktrace bt = mf.GetBacktrace(lfc);
               mf.GetCMakeInstance()->IssueMessage(messType, err, bt);
               if (messType == cmake::FATAL_ERROR)
                 {
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 006ca4c..9141d88 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -251,7 +251,6 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
 {
   // Inintialize a new function call.
   this->Function = cmListFileFunction();
-  this->Function.FilePath = this->FileName;
   this->Function.Name = name;
   this->Function.Line = line;
 
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index f5859ec..57bf253 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -25,6 +25,13 @@
 
 class cmMakefile;
 
+struct cmCommandContext
+{
+  std::string Name;
+  long Line;
+  cmCommandContext(): Name(), Line(0) {}
+};
+
 struct cmListFileArgument
 {
   enum Delimiter
@@ -57,6 +64,16 @@ struct cmListFileContext
   std::string FilePath;
   long Line;
   cmListFileContext(): Name(), FilePath(), Line(0) {}
+
+  static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
+                                              std::string const& fileName)
+  {
+    cmListFileContext lfc;
+    lfc.FilePath = fileName;
+    lfc.Line = lfcc.Line;
+    lfc.Name = lfcc.Name;
+    return lfc;
+  }
 };
 
 std::ostream& operator<<(std::ostream&, cmListFileContext const&);
@@ -64,7 +81,7 @@ bool operator<(const cmListFileContext& lhs, const cmListFileContext& rhs);
 bool operator==(cmListFileContext const& lhs, cmListFileContext const& rhs);
 bool operator!=(cmListFileContext const& lhs, cmListFileContext const& rhs);
 
-struct cmListFileFunction: public cmListFileContext
+struct cmListFileFunction: public cmCommandContext
 {
   std::vector<cmListFileArgument> Arguments;
 };
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 3c2117b..6d3054a 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -132,7 +132,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
     newLFF.Arguments.clear();
     newLFF.Arguments.reserve(this->Functions[c].Arguments.size());
     newLFF.Name = this->Functions[c].Name;
-    newLFF.FilePath = this->Functions[c].FilePath;
     newLFF.Line = this->Functions[c].Line;
 
     // for each argument of the current function
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a65f6ba..9f2abff 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -277,12 +277,15 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
 {
   cmListFileBacktrace backtrace(this->StateSnapshot);
   cmState::Snapshot snp = this->StateSnapshot;
-  for(std::vector<cmListFileContext const*>::const_reverse_iterator
+  for(std::vector<cmCommandContext const*>::const_reverse_iterator
       i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent())
+      i != this->ContextStack.rend();
+      ++i, snp = snp.GetCallStackParent())
     {
-    cmListFileContext frame = *(*i);
-    frame.FilePath = snp.GetExecutionListFile();
+    assert(snp.IsValid());
+    cmListFileContext frame =
+        cmListFileContext::FromCommandContext(*(*i),
+                                              snp.GetExecutionListFile());
     backtrace.Append(frame);
     }
   return backtrace;
@@ -297,12 +300,15 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
   cmState::Snapshot snp = this->StateSnapshot;
   assert(snp.GetExecutionListFile() == lfc.FilePath);
   snp = snp.GetCallStackParent();
-  for(std::vector<cmListFileContext const*>::const_reverse_iterator
+  for(std::vector<cmCommandContext const*>::const_reverse_iterator
       i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent())
+      i != this->ContextStack.rend();
+      ++i, snp = snp.GetCallStackParent())
     {
-    cmListFileContext frame = *(*i);
-    frame.FilePath = snp.GetExecutionListFile();
+    assert(snp.IsValid());
+    cmListFileContext frame =
+        cmListFileContext::FromCommandContext(*(*i),
+                                              snp.GetExecutionListFile());
     backtrace.Append(frame);
     }
   return backtrace;
@@ -311,7 +317,9 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
 //----------------------------------------------------------------------------
 cmListFileContext cmMakefile::GetExecutionContext() const
 {
-  return *this->ContextStack.back();
+  return cmListFileContext::FromCommandContext(
+        *this->ContextStack.back(),
+        this->StateSnapshot.GetExecutionListFile());
 }
 
 //----------------------------------------------------------------------------
@@ -561,7 +569,6 @@ public:
   cmParseFileScope(cmMakefile* mf)
     : Makefile(mf)
   {
-    this->Context.FilePath = this->Makefile->GetExecutionFilePath();
     this->Makefile->ContextStack.push_back(&this->Context);
   }
 
@@ -572,7 +579,7 @@ public:
 
 private:
   cmMakefile* Makefile;
-  cmListFileContext Context;
+  cmCommandContext Context;
 };
 
 bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
@@ -3581,11 +3588,13 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb,
       if(!(*pos)->ShouldRemove(lff, *this))
         {
         cmListFileContext const& lfc = fb->GetStartingContext();
+        cmListFileContext closingContext =
+            cmListFileContext::FromCommandContext(lff, lfc.FilePath);
         std::ostringstream e;
         e << "A logical block opening on the line\n"
           << "  " << lfc << "\n"
           << "closes on the line\n"
-          << "  " << lff << "\n"
+          << "  " << closingContext << "\n"
           << "with mis-matching arguments.";
         this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
         }
@@ -5595,7 +5604,7 @@ cmMakefile::MacroPushPop::~MacroPushPop()
   this->Makefile->PopMacroScope(this->ReportError);
 }
 
-cmMakefileCall::cmMakefileCall(cmMakefile* mf, const cmListFileContext& lfc,
+cmMakefileCall::cmMakefileCall(cmMakefile* mf, const cmCommandContext& lfc,
                                cmExecutionStatus& status): Makefile(mf)
 {
   this->Makefile->ContextStack.push_back(&lfc);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 03b9c04..d3cf02e 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -937,7 +937,7 @@ private:
   // stack of list files being read
   std::vector<std::string> ListFileStack;
 
-  std::vector<cmListFileContext const*> ContextStack;
+  std::vector<cmCommandContext const*> ContextStack;
   std::vector<cmExecutionStatus*> ExecutionStatusStack;
   friend class cmMakefileCall;
   friend class cmParseFileScope;
@@ -1055,7 +1055,7 @@ class cmMakefileCall
 {
 public:
   cmMakefileCall(cmMakefile* mf,
-                 cmListFileContext const& lfc,
+                 cmCommandContext const& lfc,
                  cmExecutionStatus& status);
   ~cmMakefileCall();
 private:
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 6521c04..98a397c 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -63,7 +63,6 @@ static void cmVariableWatchCommandVariableAccessed(
       cmListFileArgument(stack, cmListFileArgument::Quoted,
                          9999));
     newLFF.Name = data->Command;
-    newLFF.FilePath = "unknown";
     newLFF.Line = 9999;
     cmExecutionStatus status;
     if(!makefile->ExecuteCommand(newLFF,status))

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0eb70376014b73c4970489c49000fcc6e46478cb
commit 0eb70376014b73c4970489c49000fcc6e46478cb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 12:16:39 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 6 02:11:51 2015 +0200

    cmMakefile: Set the FilePath on the frame from the cmState.
    
    To verify unit tests pass and for future bisecting.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8d02092..a65f6ba 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -276,11 +276,13 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
 cmListFileBacktrace cmMakefile::GetBacktrace() const
 {
   cmListFileBacktrace backtrace(this->StateSnapshot);
+  cmState::Snapshot snp = this->StateSnapshot;
   for(std::vector<cmListFileContext const*>::const_reverse_iterator
       i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend(); ++i)
+      i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent())
     {
     cmListFileContext frame = *(*i);
+    frame.FilePath = snp.GetExecutionListFile();
     backtrace.Append(frame);
     }
   return backtrace;
@@ -292,11 +294,15 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
 {
   cmListFileBacktrace backtrace(this->StateSnapshot);
   backtrace.Append(lfc);
+  cmState::Snapshot snp = this->StateSnapshot;
+  assert(snp.GetExecutionListFile() == lfc.FilePath);
+  snp = snp.GetCallStackParent();
   for(std::vector<cmListFileContext const*>::const_reverse_iterator
       i = this->ContextStack.rbegin();
-      i != this->ContextStack.rend(); ++i)
+      i != this->ContextStack.rend(); ++i, snp = snp.GetCallStackParent())
     {
     cmListFileContext frame = *(*i);
+    frame.FilePath = snp.GetExecutionListFile();
     backtrace.Append(frame);
     }
   return backtrace;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b64c894238344222acf7292718d699fa420324db
commit b64c894238344222acf7292718d699fa420324db
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 12:14:58 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 6 02:11:51 2015 +0200

    cmMakefile: Create intermediate variables for snapshot frames.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0d48cbc..8d02092 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -280,7 +280,8 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
       i = this->ContextStack.rbegin();
       i != this->ContextStack.rend(); ++i)
     {
-    backtrace.Append(*(*i));
+    cmListFileContext frame = *(*i);
+    backtrace.Append(frame);
     }
   return backtrace;
 }
@@ -295,7 +296,8 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
       i = this->ContextStack.rbegin();
       i != this->ContextStack.rend(); ++i)
     {
-    backtrace.Append(*(*i));
+    cmListFileContext frame = *(*i);
+    backtrace.Append(frame);
     }
   return backtrace;
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5af7740bd25582cb03bbda81c8badc47c98e325b
commit 5af7740bd25582cb03bbda81c8badc47c98e325b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 5 19:28:45 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jul 6 02:11:50 2015 +0200

    cmMakefile: Create a scoped context for parsing listfiles.
    
    Update the Syntax tests to check for updated/improved backtraces.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 08df655..0d48cbc 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -547,6 +547,26 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
     }
 }
 
+class cmParseFileScope
+{
+public:
+  cmParseFileScope(cmMakefile* mf)
+    : Makefile(mf)
+  {
+    this->Context.FilePath = this->Makefile->GetExecutionFilePath();
+    this->Makefile->ContextStack.push_back(&this->Context);
+  }
+
+  ~cmParseFileScope()
+  {
+    this->Makefile->ContextStack.pop_back();
+  }
+
+private:
+  cmMakefile* Makefile;
+  cmListFileContext Context;
+};
+
 bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
 {
   this->AddDefinition("CMAKE_PARENT_LIST_FILE",
@@ -558,10 +578,14 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
   IncludeScope incScope(this, filenametoread, noPolicyScope);
 
   cmListFile listFile;
+  {
+  cmParseFileScope pfs(this);
   if (!listFile.ParseFile(filenametoread.c_str(), false, this))
     {
     return false;
     }
+  }
+
   this->ReadListFile(listFile, filenametoread);
   if(cmSystemTools::GetFatalErrorOccured())
     {
@@ -619,10 +643,13 @@ bool cmMakefile::ReadListFile(const char* filename)
   ListFileScope scope(this, filenametoread);
 
   cmListFile listFile;
+  {
+  cmParseFileScope pfs(this);
   if (!listFile.ParseFile(filenametoread.c_str(), false, this))
     {
     return false;
     }
+  }
 
   this->ReadListFile(listFile, filenametoread);
   if(cmSystemTools::GetFatalErrorOccured())
@@ -1738,11 +1765,14 @@ void cmMakefile::Configure()
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
 
   cmListFile listFile;
+  {
+  cmParseFileScope pfs(this);
   if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(), this))
     {
     this->SetConfigured();
     return;
     }
+  }
   this->ReadListFile(listFile, currentStart);
   if(cmSystemTools::GetFatalErrorOccured())
     {
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 01c9e8c..03b9c04 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -940,6 +940,7 @@ private:
   std::vector<cmListFileContext const*> ContextStack;
   std::vector<cmExecutionStatus*> ExecutionStatusStack;
   friend class cmMakefileCall;
+  friend class cmParseFileScope;
 
   std::vector<cmTarget*> ImportedTargetsOwned;
   TargetMap ImportedTargets;
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
index b3f1e47..606b5bb 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BOM-UTF-16-BE.cmake:
   File
 
-    .*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
+    .*Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
 
   starts with a Byte-Order-Mark that is not UTF-8.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
index c08c902..25c14f3 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BOM-UTF-16-LE.cmake:
   File
 
-    .*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
+    .*Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
 
   starts with a Byte-Order-Mark that is not UTF-8.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
index 5dde4e3..7244bf4 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BOM-UTF-32-BE.cmake:
   File
 
-    .*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
+    .*Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
 
   starts with a Byte-Order-Mark that is not UTF-8.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
index eb054ec..ac59c24 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BOM-UTF-32-LE.cmake:
   File
 
-    .*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
+    .*Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
 
   starts with a Byte-Order-Mark that is not UTF-8.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
index afd91f9..b9f132c 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace0.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27
+    .*Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
index 826e511..aca9c35 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace1.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24
+    .*Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
index 23ecdcd..ea37a7b 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace2.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44
+    .*Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
index 906d6fc..a4ee9d0 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace3.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45
+    .*Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
index a461e93..e36dbab 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace4.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44
+    .*Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
index ff8bf1c..0ef8b13 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
@@ -1,6 +1,8 @@
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in BracketNoSpace5.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45
+    .*Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
index 7ecfe11..d2c6b6f 100644
--- a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
@@ -1,15 +1,17 @@
-CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+CMake Warning \(dev\) in ParenInENV.cmake:
   Syntax Warning in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2:21
+    .*Tests/RunCMake/Syntax/ParenInENV.cmake:2:21
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
 CMake Error at ParenInENV.cmake:2 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2
+    .*Tests/RunCMake/Syntax/ParenInENV.cmake:2
 
   when parsing string
 
diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
index 64ef8b1..97b1b71 100644
--- a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
@@ -1,22 +1,28 @@
-CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+CMake Warning \(dev\) in ParenNoSpace1.cmake:
   Syntax Warning in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26
+    .*Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+CMake Warning \(dev\) in ParenNoSpace1.cmake:
   Syntax Warning in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26
+    .*Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Error at CMakeLists.txt:3 \(include\):
+CMake Error in ParenNoSpace1.cmake:
   Syntax Error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29
+    .*Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
index 89c2d2a..d79a79b 100644
--- a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
+++ b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
@@ -1,17 +1,21 @@
-CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+CMake Warning \(dev\) in StringNoSpace.cmake:
   Syntax Warning in cmake code at
 
-    .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
+    .*Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) at CMakeLists.txt:3 \(include\):
+CMake Warning \(dev\) in StringNoSpace.cmake:
   Syntax Warning in cmake code at
 
-    .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
+    .*Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
 
   Argument not separated from preceding token by whitespace.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
 \[1 \${var} \\n 4\]

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list