diff options
author | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2020-10-01 11:28:03 (GMT) |
---|---|---|
committer | Oleksandr Koval <oleksandr.koval.dev@gmail.com> | 2020-10-01 11:28:03 (GMT) |
commit | e614528ad1e7d053169535cc32fe566f6eb22d41 (patch) | |
tree | fc81ab6b79afc387519d5b97d088ef99a0454567 /Source/cmVariableWatchCommand.cxx | |
parent | 47b569a85852f716b05ede538e9940392407316c (diff) | |
download | CMake-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.cxx | 9 |
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( |