[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-862-geafb3ee

Brad King brad.king at kitware.com
Mon Jul 6 11:22:49 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  eafb3eee02e59d4ff8987f57d9cab4f72fd12f06 (commit)
       via  d2475bb5c4488a0ef6015f13ee46ddc7a2e4455b (commit)
       via  238aac23514ecdae0d4edb71033e443f30e94158 (commit)
       via  329098a9a0e81e67bd760f53811cce582a3ebdcd (commit)
       via  91158a3369e0f06600a9ada93222535d53361035 (commit)
       via  821f91d6ab668bbfcfc645a872acf91f71f76ff1 (commit)
      from  22c6064708add4d69d70a0232a27561e89f64c89 (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=eafb3eee02e59d4ff8987f57d9cab4f72fd12f06
commit eafb3eee02e59d4ff8987f57d9cab4f72fd12f06
Merge: 22c6064 d2475bb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jul 6 11:22:48 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 6 11:22:48 2015 -0400

    Merge topic 'refactor-cmListFileBacktrace' into next
    
    d2475bb5 cmListFileBacktrace: Implement in terms of cmState::Snapshot.
    238aac23 cmListFile: Remove FilePath member from cmListFileContext.
    329098a9 cmMakefile: Set the FilePath on the frame from the cmState.
    91158a33 cmMakefile: Create intermediate variables for snapshot frames.
    821f91d6 cmMakefile: Create a scoped context for parsing listfiles.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d2475bb5c4488a0ef6015f13ee46ddc7a2e4455b
commit d2475bb5c4488a0ef6015f13ee46ddc7a2e4455b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 29 22:37:59 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 11:22:42 2015 -0400

    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=238aac23514ecdae0d4edb71033e443f30e94158
commit 238aac23514ecdae0d4edb71033e443f30e94158
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 13:12:50 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 11:22:41 2015 -0400

    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=329098a9a0e81e67bd760f53811cce582a3ebdcd
commit 329098a9a0e81e67bd760f53811cce582a3ebdcd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 12:16:39 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 11:22:41 2015 -0400

    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=91158a3369e0f06600a9ada93222535d53361035
commit 91158a3369e0f06600a9ada93222535d53361035
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Jul 4 12:14:58 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 11:22:41 2015 -0400

    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=821f91d6ab668bbfcfc645a872acf91f71f76ff1
commit 821f91d6ab668bbfcfc645a872acf91f71f76ff1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 5 19:28:45 2015 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 11:22:41 2015 -0400

    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..a845ffb 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
 
   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..cc4244b 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
 
   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..5f851bf 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
 
   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..d8fafd0 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
 
   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..a288280 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
 
   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..391e11b 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
 
   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..acaf7fe 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
 
   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..f12b2e5 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
 
   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..7157763 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
 
   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..c13969d 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
 
   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..37c5d6e 100644
--- a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
@@ -1,9 +1,11 @@
-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
 
   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\):
diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
index 64ef8b1..45b2e6a 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
 
   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
 
   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
 
   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..a4ec6e7 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
 
   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
 
   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