summaryrefslogtreecommitdiffstats
path: root/Source/cmVariableWatchCommand.cxx
diff options
context:
space:
mode:
authorOleksandr Koval <oleksandr.koval.dev@gmail.com>2020-10-01 11:28:03 (GMT)
committerOleksandr Koval <oleksandr.koval.dev@gmail.com>2020-10-01 11:28:03 (GMT)
commite614528ad1e7d053169535cc32fe566f6eb22d41 (patch)
treefc81ab6b79afc387519d5b97d088ef99a0454567 /Source/cmVariableWatchCommand.cxx
parent47b569a85852f716b05ede538e9940392407316c (diff)
downloadCMake-e614528ad1e7d053169535cc32fe566f6eb22d41.zip
CMake-e614528ad1e7d053169535cc32fe566f6eb22d41.tar.gz
CMake-e614528ad1e7d053169535cc32fe566f6eb22d41.tar.bz2
cmListFileCache: Make cmListFileFunction a shared pointer
Passing cmListFileFunction everywhere by-value involves big overhead. Now cmListFileFunction stores std::shared_ptr to the underlying data.
Diffstat (limited to 'Source/cmVariableWatchCommand.cxx')
-rw-r--r--Source/cmVariableWatchCommand.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index 750b0b5..7c7fbca 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -45,20 +45,21 @@ void cmVariableWatchCommandVariableAccessed(const std::string& variable,
std::string stack = *mf->GetProperty("LISTFILE_STACK");
if (!data->Command.empty()) {
- cmListFileFunction newLFF;
cmProp const currentListFile =
mf->GetDefinition("CMAKE_CURRENT_LIST_FILE");
const auto fakeLineNo =
std::numeric_limits<decltype(cmListFileArgument::Line)>::max();
- newLFF.Arguments = {
+
+ std::vector<cmListFileArgument> newLFFArgs{
{ variable, cmListFileArgument::Quoted, fakeLineNo },
{ accessString, cmListFileArgument::Quoted, fakeLineNo },
{ newValue ? newValue : "", cmListFileArgument::Quoted, fakeLineNo },
{ *currentListFile, cmListFileArgument::Quoted, fakeLineNo },
{ stack, cmListFileArgument::Quoted, fakeLineNo }
};
- newLFF.Name = data->Command;
- newLFF.Line = fakeLineNo;
+
+ cmListFileFunction newLFF{ data->Command, fakeLineNo,
+ std::move(newLFFArgs) };
cmExecutionStatus status(*makefile);
if (!makefile->ExecuteCommand(newLFF, status)) {
cmSystemTools::Error(