mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user