summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-18 19:35:29 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-18 21:55:41 (GMT)
commite17b5e426294dc5cc86ba31dfd4d4acc553c0c72 (patch)
tree049ab6bd6a65638359d6e514b31b84f206a2d044 /Source/cmMakefile.cxx
parent1ec1bf9f071ce930094171ab45f2dbc02c57927b (diff)
downloadCMake-e17b5e426294dc5cc86ba31dfd4d4acc553c0c72.zip
CMake-e17b5e426294dc5cc86ba31dfd4d4acc553c0c72.tar.gz
CMake-e17b5e426294dc5cc86ba31dfd4d4acc553c0c72.tar.bz2
cmMakefile: Add access to the top-level execution context.
This is cheaper than getting the whole backtrace, and the cmListFileBacktrace will not always be composed of cmListFileContext objects.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 272ac4c..4de3bcd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -378,6 +378,12 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
}
//----------------------------------------------------------------------------
+cmListFileContext cmMakefile::GetExecutionContext() const
+{
+ return *this->CallStack.back().Context;
+}
+
+//----------------------------------------------------------------------------
void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
{
std::ostringstream msg;
@@ -1937,9 +1943,9 @@ void cmMakefile::CheckForUnused(const char* reason,
cmListFileBacktrace bt(this->GetLocalGenerator());
if (!this->CallStack.empty())
{
- const cmListFileContext* file = this->CallStack.back().Context;
- bt.push_back(*file);
- path = file->FilePath.c_str();
+ cmListFileContext file = this->GetExecutionContext();
+ bt.push_back(file);
+ path = file.FilePath;
}
else
{
@@ -3410,7 +3416,7 @@ void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb)
if(!this->CallStack.empty())
{
// Record the context in which the blocker is created.
- fb->SetStartingContext(*(this->CallStack.back().Context));
+ fb->SetStartingContext(this->GetExecutionContext());
}
this->FunctionBlockers.push_back(fb);