From 280f3918f3a731f64c94b2b7c912c58d714fc676 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 25 Sep 2020 07:22:42 -0400 Subject: 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. --- Source/cmMakefile.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d77c4af..1c9aa52 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -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 -- cgit v0.12