summaryrefslogtreecommitdiffstats
path: root/Source/cmStateSnapshot.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-08-27 13:54:54 (GMT)
committerBrad King <brad.king@kitware.com>2021-09-03 13:52:14 (GMT)
commitab94c369c9f653d249e5a48ccc43f2dd2d95bc56 (patch)
tree14421b0b0fb0f0b2461a2e73b73d8828da3e0d2b /Source/cmStateSnapshot.cxx
parent80e0245e0e05c27dee316a9b53e23a4c0b12a9fe (diff)
downloadCMake-ab94c369c9f653d249e5a48ccc43f2dd2d95bc56.zip
CMake-ab94c369c9f653d249e5a48ccc43f2dd2d95bc56.tar.gz
CMake-ab94c369c9f653d249e5a48ccc43f2dd2d95bc56.tar.bz2
Refactor: Convert parallel string/backtrace vectors to BT vectors
Diffstat (limited to 'Source/cmStateSnapshot.cxx')
-rw-r--r--Source/cmStateSnapshot.cxx27
1 files changed, 7 insertions, 20 deletions
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 66cbcca..bd7db85 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -19,6 +19,10 @@
#include "cmSystemTools.h"
#include "cmVersion.h"
+#if defined(__CYGWIN__)
+# include "cmStringAlgorithms.h"
+#endif
+
cmStateSnapshot::cmStateSnapshot(cmState* state)
: State(state)
{
@@ -259,12 +263,10 @@ bool cmStateSnapshot::RaiseScope(std::string const& var, const char* varDef)
return true;
}
-template <typename T, typename U, typename V>
+template <typename T, typename U>
void InitializeContentFromParent(T& parentContent, T& thisContent,
- U& parentBacktraces, U& thisBacktraces,
- V& contentEndPosition)
+ U& contentEndPosition)
{
- auto parentBegin = parentContent.begin();
auto parentEnd = parentContent.end();
auto parentRbegin = cm::make_reverse_iterator(parentEnd);
@@ -272,12 +274,7 @@ void InitializeContentFromParent(T& parentContent, T& thisContent,
parentRbegin = std::find(parentRbegin, parentRend, cmPropertySentinal);
auto parentIt = parentRbegin.base();
- thisContent = std::vector<std::string>(parentIt, parentEnd);
-
- auto btIt = parentBacktraces.begin() + std::distance(parentBegin, parentIt);
- auto btEnd = parentBacktraces.end();
-
- thisBacktraces = std::vector<cmListFileBacktrace>(btIt, btEnd);
+ thisContent = std::vector<BT<std::string>>(parentIt, parentEnd);
contentEndPosition = thisContent.size();
}
@@ -359,36 +356,26 @@ void cmStateSnapshot::InitializeFromParent()
InitializeContentFromParent(
parent->BuildSystemDirectory->IncludeDirectories,
this->Position->BuildSystemDirectory->IncludeDirectories,
- parent->BuildSystemDirectory->IncludeDirectoryBacktraces,
- this->Position->BuildSystemDirectory->IncludeDirectoryBacktraces,
this->Position->IncludeDirectoryPosition);
InitializeContentFromParent(
parent->BuildSystemDirectory->CompileDefinitions,
this->Position->BuildSystemDirectory->CompileDefinitions,
- parent->BuildSystemDirectory->CompileDefinitionsBacktraces,
- this->Position->BuildSystemDirectory->CompileDefinitionsBacktraces,
this->Position->CompileDefinitionsPosition);
InitializeContentFromParent(
parent->BuildSystemDirectory->CompileOptions,
this->Position->BuildSystemDirectory->CompileOptions,
- parent->BuildSystemDirectory->CompileOptionsBacktraces,
- this->Position->BuildSystemDirectory->CompileOptionsBacktraces,
this->Position->CompileOptionsPosition);
InitializeContentFromParent(
parent->BuildSystemDirectory->LinkOptions,
this->Position->BuildSystemDirectory->LinkOptions,
- parent->BuildSystemDirectory->LinkOptionsBacktraces,
- this->Position->BuildSystemDirectory->LinkOptionsBacktraces,
this->Position->LinkOptionsPosition);
InitializeContentFromParent(
parent->BuildSystemDirectory->LinkDirectories,
this->Position->BuildSystemDirectory->LinkDirectories,
- parent->BuildSystemDirectory->LinkDirectoriesBacktraces,
- this->Position->BuildSystemDirectory->LinkDirectoriesBacktraces,
this->Position->LinkDirectoriesPosition);
cmProp include_regex =