cmMakefile: Simplify GetExecutionContext implementation

This method takes the function name and line from the top of the
current backtrace and then gets the file path from the state's
`GetExecutionListFile`.  This exactly matches what the `cmMakefileCall`
constructor does to create the top of the current backtrace anyway,
so we can just take that directly.
This commit is contained in:
Brad King
2020-09-25 07:22:42 -04:00
parent 0e59b45dfc
commit 280f3918f3

View File

@@ -285,12 +285,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace(cmCommandContext const& cc) const
cmListFileContext cmMakefile::GetExecutionContext() const
{
cmListFileContext const& cur = this->Backtrace.Top();
cmListFileContext lfc;
lfc.Name = cur.Name;
lfc.Line = cur.Line;
lfc.FilePath = this->StateSnapshot.GetExecutionListFile();
return lfc;
return this->Backtrace.Top();
}
void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const