diff options
author | Brad King <brad.king@kitware.com> | 2022-11-07 19:33:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-11-07 19:36:46 (GMT) |
commit | 96ddcbee60ee304efd047bc0e20cf89066877ab5 (patch) | |
tree | e894c23a55711709f90ca022ef289694f433d678 /Source | |
parent | cb53d9309eb932e40fcdf3609eb050358ede2d17 (diff) | |
download | CMake-96ddcbee60ee304efd047bc0e20cf89066877ab5.zip CMake-96ddcbee60ee304efd047bc0e20cf89066877ab5.tar.gz CMake-96ddcbee60ee304efd047bc0e20cf89066877ab5.tar.bz2 |
cmState: Clarify name of member tracking the active scope in a directory
The `DirectoryEnd` member added by commit 52dbe654de (cmState: Record
the end position of each directory., 2015-08-01, v3.4.0-rc1~251^2~1)
actually tracks the current top-most scope in a directory's stack. This
is evidenced by the use case in commit 3f4e5e8c3d (cmState: Return end
snapshot for GetBuildsystemDirectoryParent., 2015-09-01,
v3.4.0-rc1~100^2~1). Rename the member to `CurrentScope` to clarify
this role.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmState.cxx | 22 | ||||
-rw-r--r-- | Source/cmStatePrivate.h | 2 | ||||
-rw-r--r-- | Source/cmStateSnapshot.cxx | 10 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 869414b..e54ccfc 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -281,7 +281,7 @@ cmStateSnapshot cmState::Reset() it->CompileOptions.clear(); it->LinkOptions.clear(); it->LinkDirectories.clear(); - it->DirectoryEnd = pos; + it->CurrentScope = pos; it->NormalTargetNames.clear(); it->ImportedTargetNames.clear(); it->Properties.Clear(); @@ -819,7 +819,7 @@ cmStateSnapshot cmState::CreateBaseSnapshot() pos->CompileOptionsPosition = 0; pos->LinkOptionsPosition = 0; pos->LinkDirectoriesPosition = 0; - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->Policies = this->PolicyStack.Root(); pos->PolicyRoot = this->PolicyStack.Root(); pos->PolicyScope = this->PolicyStack.Root(); @@ -846,7 +846,7 @@ cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot( originSnapshot.Position->BuildSystemDirectory); pos->ExecutionListFile = this->ExecutionListFiles.Push(originSnapshot.Position->ExecutionListFile); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->Policies = originSnapshot.Position->Policies; pos->PolicyRoot = originSnapshot.Position->Policies; pos->PolicyScope = originSnapshot.Position->Policies; @@ -876,7 +876,7 @@ cmStateSnapshot cmState::CreateDeferCallSnapshot( pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); assert(originSnapshot.Position->Vars.IsValid()); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; return { this, pos }; } @@ -891,7 +891,7 @@ cmStateSnapshot cmState::CreateFunctionCallSnapshot( pos->Keep = false; pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; assert(originSnapshot.Position->Vars.IsValid()); cmLinkedTree<cmDefinitions>::iterator origin = originSnapshot.Position->Vars; @@ -910,7 +910,7 @@ cmStateSnapshot cmState::CreateMacroCallSnapshot( pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); assert(originSnapshot.Position->Vars.IsValid()); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; return { this, pos }; } @@ -925,7 +925,7 @@ cmStateSnapshot cmState::CreateIncludeFileSnapshot( pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); assert(originSnapshot.Position->Vars.IsValid()); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; return { this, pos }; } @@ -938,7 +938,7 @@ cmStateSnapshot cmState::CreateVariableScopeSnapshot( pos->ScopeParent = originSnapshot.Position; pos->SnapshotType = cmStateEnums::VariableScopeType; pos->Keep = false; - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; assert(originSnapshot.Position->Vars.IsValid()); @@ -958,7 +958,7 @@ cmStateSnapshot cmState::CreateInlineListFileSnapshot( pos->Keep = true; pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; return { this, pos }; } @@ -970,7 +970,7 @@ cmStateSnapshot cmState::CreatePolicyScopeSnapshot( this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); pos->SnapshotType = cmStateEnums::PolicyScopeType; pos->Keep = false; - pos->BuildSystemDirectory->DirectoryEnd = pos; + pos->BuildSystemDirectory->CurrentScope = pos; pos->PolicyScope = originSnapshot.Position->Policies; return { this, pos }; } @@ -990,7 +990,7 @@ cmStateSnapshot cmState::Pop(cmStateSnapshot const& originSnapshot) prevPos->BuildSystemDirectory->LinkOptions.size(); prevPos->LinkDirectoriesPosition = prevPos->BuildSystemDirectory->LinkDirectories.size(); - prevPos->BuildSystemDirectory->DirectoryEnd = prevPos; + prevPos->BuildSystemDirectory->CurrentScope = prevPos; if (!pos->Keep && this->SnapshotData.IsLast(pos)) { if (pos->Vars != prevPos->Vars) { diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index fd46eed..ec14834 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -62,7 +62,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap struct cmStateDetail::BuildsystemDirectoryStateType { - cmStateDetail::PositionType DirectoryEnd; + cmStateDetail::PositionType CurrentScope; std::string Location; std::string OutputLocation; diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index c51650a..cb5f11f 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -64,7 +64,7 @@ bool cmStateSnapshot::IsValid() const cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectory() const { - return { this->State, this->Position->BuildSystemDirectory->DirectoryEnd }; + return { this->State, this->Position->BuildSystemDirectory->CurrentScope }; } cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const @@ -76,7 +76,7 @@ cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const cmStateDetail::PositionType parentPos = this->Position->DirectoryParent; if (parentPos != this->State->SnapshotData.Root()) { snapshot = cmStateSnapshot(this->State, - parentPos->BuildSystemDirectory->DirectoryEnd); + parentPos->BuildSystemDirectory->CurrentScope); } return snapshot; @@ -177,9 +177,9 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id, while (true) { assert(dir.IsValid()); cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator leaf = - dir->DirectoryEnd->Policies; + dir->CurrentScope->Policies; cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator root = - dir->DirectoryEnd->PolicyRoot; + dir->CurrentScope->PolicyRoot; for (; leaf != root; ++leaf) { if (parent_scope) { parent_scope = false; @@ -190,7 +190,7 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id, return status; } } - cmStateDetail::PositionType e = dir->DirectoryEnd; + cmStateDetail::PositionType e = dir->CurrentScope; cmStateDetail::PositionType p = e->DirectoryParent; if (p == this->State->SnapshotData.Root()) { break; |