diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-23 11:50:12 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-06-02 23:04:00 (GMT) |
commit | 499ebb6564800c23bfb6e7b1b706a6202b3f971a (patch) | |
tree | 5530ede11b8bc467ebd14005e83e169cc691f92b /Source/cmListFileCache.cxx | |
parent | 80b433b05ea921e6144c10260cfeafb4b25e5bc1 (diff) | |
download | CMake-499ebb6564800c23bfb6e7b1b706a6202b3f971a.zip CMake-499ebb6564800c23bfb6e7b1b706a6202b3f971a.tar.gz CMake-499ebb6564800c23bfb6e7b1b706a6202b3f971a.tar.bz2 |
cmListFileBacktrace: Internalize the step of making paths relative.
Currently cmMakefile calls MakeRelative on a copy of the backtrace,
emits the copy to the stream once, then discards the copy. There
is no need to have API for the path conversion.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r-- | Source/cmListFileCache.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 2756cd2..ffe1a1f 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -405,29 +405,17 @@ void cmListFileBacktrace::Append(cmListFileContext const& context) this->push_back(context); } -//---------------------------------------------------------------------------- -void cmListFileBacktrace::MakeRelative() -{ - if (this->Relative) - { - return; - } - for (cmListFileBacktrace::iterator i = this->begin(); - i != this->end(); ++i) - { - i->FilePath = this->LocalGenerator->Convert(i->FilePath, - cmLocalGenerator::HOME); - } - this->Relative = true; -} - void cmListFileBacktrace::PrintTitle(std::ostream& out) { if (this->empty()) { return; } - out << (this->front().Line ? " at " : " in ") << this->front(); + + cmListFileContext lfc = this->front(); + lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, + cmLocalGenerator::HOME); + out << (lfc.Line ? " at " : " in ") << lfc; } void cmListFileBacktrace::PrintCallStack(std::ostream& out) @@ -441,7 +429,9 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) out << "Call Stack (most recent call first):\n"; while(i != this->end()) { - cmListFileContext const& lfc = *i; + cmListFileContext lfc = *i; + lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath, + cmLocalGenerator::HOME); out << " " << lfc << "\n"; ++i; } |