summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-04 20:00:14 +0200
committerStephen Kelly <steveire@gmail.com>2015-06-06 09:15:57 +0200
commit242dcc2c22535c00348de18bba41605428ccdb73 (patch)
tree6ec83f61539772b1bb53b1bf2ebe9925151c3afc
parent1cff330b0fcd635f47047bd1a2d94f344e88c0f9 (diff)
downloadcmake-242dcc2c22535c00348de18bba41605428ccdb73.tar.gz
cmListFileBacktrace: Replace local generator with cmState::Snapshot.
Construct cmOutputConverter only when needed.
-rw-r--r--Source/cmListFileCache.cxx8
-rw-r--r--Source/cmListFileCache.h8
-rw-r--r--Source/cmMakefile.cxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index ffe1a1ff9e..ca583145ab 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -412,9 +412,9 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out)
return;
}
+ cmOutputConverter converter(this->Snapshot);
cmListFileContext lfc = this->front();
- lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
- cmLocalGenerator::HOME);
+ lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
out << (lfc.Line ? " at " : " in ") << lfc;
}
@@ -425,13 +425,13 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out)
return;
}
+ cmOutputConverter converter(this->Snapshot);
const_iterator i = this->begin() + 1;
out << "Call Stack (most recent call first):\n";
while(i != this->end())
{
cmListFileContext lfc = *i;
- lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
- cmLocalGenerator::HOME);
+ lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
out << " " << lfc << "\n";
++i;
}
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 1971862a7c..4002d94b00 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -14,7 +14,7 @@
#include "cmStandardIncludes.h"
-class cmLocalGenerator;
+#include "cmState.h"
/** \class cmListFileCache
* \brief A class to cache list file contents.
@@ -74,8 +74,8 @@ struct cmListFileFunction: public cmListFileContext
class cmListFileBacktrace: private std::vector<cmListFileContext>
{
public:
- cmListFileBacktrace(cmLocalGenerator* localGen = 0)
- : LocalGenerator(localGen)
+ cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot())
+ : Snapshot(snapshot)
{
}
@@ -84,7 +84,7 @@ class cmListFileBacktrace: private std::vector<cmListFileContext>
void PrintTitle(std::ostream& out);
void PrintCallStack(std::ostream& out);
private:
- cmLocalGenerator* LocalGenerator;
+ cmState::Snapshot Snapshot;
};
struct cmListFile
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 06febbfe41..f55b5dfeb9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -277,7 +277,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
//----------------------------------------------------------------------------
cmListFileBacktrace cmMakefile::GetBacktrace() const
{
- cmListFileBacktrace backtrace(this->GetLocalGenerator());
+ cmListFileBacktrace backtrace(this->StateSnapshot);
for(CallStackType::const_reverse_iterator i = this->CallStack.rbegin();
i != this->CallStack.rend(); ++i)
{
@@ -290,7 +290,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
cmListFileBacktrace
cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
{
- cmListFileBacktrace backtrace(this->GetLocalGenerator());
+ cmListFileBacktrace backtrace(this->StateSnapshot);
backtrace.Append(lfc);
for(CallStackType::const_reverse_iterator i = this->CallStack.rbegin();
i != this->CallStack.rend(); ++i)