Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
André Pedro
CMake
Commits
5bc964ed
Commit
5bc964ed
authored
8 years ago
by
Stephen Kelly
Browse files
Options
Downloads
Patches
Plain Diff
cmState: Move PositionType to separate namespace
Remove friend declarations supporting it being a nested type.
parent
2dc40996
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/cmState.cxx
+26
-23
26 additions, 23 deletions
Source/cmState.cxx
Source/cmState.h
+3
-6
3 additions, 6 deletions
Source/cmState.h
with
29 additions
and
29 deletions
Source/cmState.cxx
+
26
−
23
View file @
5bc964ed
...
...
@@ -27,8 +27,8 @@ static std::string const kSUBDIRECTORIES = "SUBDIRECTORIES";
struct
cmStateDetail
::
SnapshotDataType
{
cmState
::
PositionType
ScopeParent
;
cmState
::
PositionType
DirectoryParent
;
cmState
Detail
::
PositionType
ScopeParent
;
cmState
Detail
::
PositionType
DirectoryParent
;
cmLinkedTree
<
cmStateDetail
::
PolicyStackEntry
>::
iterator
Policies
;
cmLinkedTree
<
cmStateDetail
::
PolicyStackEntry
>::
iterator
PolicyRoot
;
cmLinkedTree
<
cmStateDetail
::
PolicyStackEntry
>::
iterator
PolicyScope
;
...
...
@@ -68,7 +68,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap
struct
cmStateDetail
::
BuildsystemDirectoryStateType
{
cmState
::
PositionType
DirectoryEnd
;
cmState
Detail
::
PositionType
DirectoryEnd
;
std
::
string
Location
;
std
::
string
OutputLocation
;
...
...
@@ -309,7 +309,7 @@ cmState::Snapshot cmState::Reset()
this
->
GlobalProperties
.
clear
();
this
->
PropertyDefinitions
.
clear
();
PositionType
pos
=
this
->
SnapshotData
.
Truncate
();
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Truncate
();
this
->
ExecutionListFiles
.
Truncate
();
{
...
...
@@ -744,7 +744,8 @@ void cmState::Directory::ComputeRelativePathTopBinary()
cmState
::
Snapshot
cmState
::
CreateBaseSnapshot
()
{
PositionType
pos
=
this
->
SnapshotData
.
Push
(
this
->
SnapshotData
.
Root
());
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
this
->
SnapshotData
.
Root
());
pos
->
DirectoryParent
=
this
->
SnapshotData
.
Root
();
pos
->
ScopeParent
=
this
->
SnapshotData
.
Root
();
pos
->
SnapshotType
=
BaseType
;
...
...
@@ -773,7 +774,8 @@ cmState::Snapshot cmState::CreateBuildsystemDirectorySnapshot(
Snapshot
originSnapshot
)
{
assert
(
originSnapshot
.
IsValid
());
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
);
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
);
pos
->
DirectoryParent
=
originSnapshot
.
Position
;
pos
->
ScopeParent
=
originSnapshot
.
Position
;
pos
->
SnapshotType
=
BuildsystemDirectoryType
;
...
...
@@ -805,7 +807,7 @@ cmState::Snapshot cmState::CreateBuildsystemDirectorySnapshot(
cmState
::
Snapshot
cmState
::
CreateFunctionCallSnapshot
(
cmState
::
Snapshot
originSnapshot
,
std
::
string
const
&
fileName
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
ScopeParent
=
originSnapshot
.
Position
;
pos
->
SnapshotType
=
FunctionCallType
;
...
...
@@ -824,7 +826,7 @@ cmState::Snapshot cmState::CreateFunctionCallSnapshot(
cmState
::
Snapshot
cmState
::
CreateMacroCallSnapshot
(
cmState
::
Snapshot
originSnapshot
,
std
::
string
const
&
fileName
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
SnapshotType
=
MacroCallType
;
pos
->
Keep
=
false
;
...
...
@@ -839,7 +841,7 @@ cmState::Snapshot cmState::CreateMacroCallSnapshot(
cmState
::
Snapshot
cmState
::
CreateIncludeFileSnapshot
(
cmState
::
Snapshot
originSnapshot
,
const
std
::
string
&
fileName
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
SnapshotType
=
IncludeFileType
;
pos
->
Keep
=
true
;
...
...
@@ -854,7 +856,7 @@ cmState::Snapshot cmState::CreateIncludeFileSnapshot(
cmState
::
Snapshot
cmState
::
CreateVariableScopeSnapshot
(
cmState
::
Snapshot
originSnapshot
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
ScopeParent
=
originSnapshot
.
Position
;
pos
->
SnapshotType
=
VariableScopeType
;
...
...
@@ -872,7 +874,7 @@ cmState::Snapshot cmState::CreateVariableScopeSnapshot(
cmState
::
Snapshot
cmState
::
CreateInlineListFileSnapshot
(
cmState
::
Snapshot
originSnapshot
,
const
std
::
string
&
fileName
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
SnapshotType
=
InlineListFileType
;
pos
->
Keep
=
true
;
...
...
@@ -886,7 +888,7 @@ cmState::Snapshot cmState::CreateInlineListFileSnapshot(
cmState
::
Snapshot
cmState
::
CreatePolicyScopeSnapshot
(
cmState
::
Snapshot
originSnapshot
)
{
PositionType
pos
=
cmStateDetail
::
PositionType
pos
=
this
->
SnapshotData
.
Push
(
originSnapshot
.
Position
,
*
originSnapshot
.
Position
);
pos
->
SnapshotType
=
PolicyScopeType
;
pos
->
Keep
=
false
;
...
...
@@ -897,8 +899,8 @@ cmState::Snapshot cmState::CreatePolicyScopeSnapshot(
cmState
::
Snapshot
cmState
::
Pop
(
cmState
::
Snapshot
originSnapshot
)
{
PositionType
pos
=
originSnapshot
.
Position
;
PositionType
prevPos
=
pos
;
cmStateDetail
::
PositionType
pos
=
originSnapshot
.
Position
;
cmStateDetail
::
PositionType
prevPos
=
pos
;
++
prevPos
;
prevPos
->
IncludeDirectoryPosition
=
prevPos
->
BuildSystemDirectory
->
IncludeDirectories
.
size
();
...
...
@@ -934,7 +936,8 @@ std::vector<cmState::Snapshot> cmState::Snapshot::GetChildren()
return
this
->
Position
->
BuildSystemDirectory
->
Children
;
}
cmState
::
Snapshot
::
Snapshot
(
cmState
*
state
,
PositionType
position
)
cmState
::
Snapshot
::
Snapshot
(
cmState
*
state
,
cmStateDetail
::
PositionType
position
)
:
State
(
state
)
,
Position
(
position
)
{
...
...
@@ -1022,7 +1025,7 @@ cmState::Snapshot cmState::Snapshot::GetBuildsystemDirectoryParent() const
if
(
!
this
->
State
||
this
->
Position
==
this
->
State
->
SnapshotData
.
Root
())
{
return
snapshot
;
}
PositionType
parentPos
=
this
->
Position
->
DirectoryParent
;
cmStateDetail
::
PositionType
parentPos
=
this
->
Position
->
DirectoryParent
;
if
(
parentPos
!=
this
->
State
->
SnapshotData
.
Root
())
{
snapshot
=
Snapshot
(
this
->
State
,
parentPos
->
BuildSystemDirectory
->
DirectoryEnd
);
...
...
@@ -1037,7 +1040,7 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const
assert
(
this
->
Position
!=
this
->
State
->
SnapshotData
.
Root
());
Snapshot
snapshot
;
PositionType
parentPos
=
this
->
Position
;
cmStateDetail
::
PositionType
parentPos
=
this
->
Position
;
while
(
parentPos
->
SnapshotType
==
cmState
::
PolicyScopeType
||
parentPos
->
SnapshotType
==
cmState
::
VariableScopeType
)
{
++
parentPos
;
...
...
@@ -1066,7 +1069,7 @@ cmState::Snapshot cmState::Snapshot::GetCallStackBottom() const
assert
(
this
->
State
);
assert
(
this
->
Position
!=
this
->
State
->
SnapshotData
.
Root
());
PositionType
pos
=
this
->
Position
;
cmStateDetail
::
PositionType
pos
=
this
->
Position
;
while
(
pos
->
SnapshotType
!=
cmState
::
BaseType
&&
pos
->
SnapshotType
!=
cmState
::
BuildsystemDirectoryType
&&
pos
!=
this
->
State
->
SnapshotData
.
Root
())
{
...
...
@@ -1077,14 +1080,14 @@ cmState::Snapshot cmState::Snapshot::GetCallStackBottom() const
void
cmState
::
Snapshot
::
PushPolicy
(
cmPolicies
::
PolicyMap
entry
,
bool
weak
)
{
PositionType
pos
=
this
->
Position
;
cmStateDetail
::
PositionType
pos
=
this
->
Position
;
pos
->
Policies
=
this
->
State
->
PolicyStack
.
Push
(
pos
->
Policies
,
cmStateDetail
::
PolicyStackEntry
(
entry
,
weak
));
}
bool
cmState
::
Snapshot
::
PopPolicy
()
{
PositionType
pos
=
this
->
Position
;
cmStateDetail
::
PositionType
pos
=
this
->
Position
;
if
(
pos
->
Policies
==
pos
->
PolicyScope
)
{
return
false
;
}
...
...
@@ -1135,8 +1138,8 @@ cmPolicies::PolicyStatus cmState::Snapshot::GetPolicy(
return
status
;
}
}
cmState
::
PositionType
e
=
dir
->
DirectoryEnd
;
cmState
::
PositionType
p
=
e
->
DirectoryParent
;
cmState
Detail
::
PositionType
e
=
dir
->
DirectoryEnd
;
cmState
Detail
::
PositionType
p
=
e
->
DirectoryParent
;
if
(
p
==
this
->
State
->
SnapshotData
.
Root
())
{
break
;
}
...
...
@@ -1305,7 +1308,7 @@ void cmState::Snapshot::SetDirectoryDefinitions()
void
cmState
::
Snapshot
::
InitializeFromParent
()
{
PositionType
parent
=
this
->
Position
->
DirectoryParent
;
cmStateDetail
::
PositionType
parent
=
this
->
Position
->
DirectoryParent
;
assert
(
this
->
Position
->
Vars
.
IsValid
());
assert
(
parent
->
Vars
.
IsValid
());
...
...
This diff is collapsed.
Click to expand it.
Source/cmState.h
+
3
−
6
View file @
5bc964ed
...
...
@@ -27,14 +27,11 @@ namespace cmStateDetail {
struct
BuildsystemDirectoryStateType
;
struct
SnapshotDataType
;
struct
PolicyStackEntry
;
typedef
cmLinkedTree
<
cmStateDetail
::
SnapshotDataType
>::
iterator
PositionType
;
}
class
cmState
{
typedef
cmLinkedTree
<
cmStateDetail
::
SnapshotDataType
>::
iterator
PositionType
;
friend
class
Snapshot
;
friend
struct
cmStateDetail
::
BuildsystemDirectoryStateType
;
friend
struct
cmStateDetail
::
SnapshotDataType
;
public:
cmState
();
...
...
@@ -58,7 +55,7 @@ public:
{
public:
Snapshot
(
cmState
*
state
=
CM_NULLPTR
);
Snapshot
(
cmState
*
state
,
PositionType
position
);
Snapshot
(
cmState
*
state
,
cmStateDetail
::
PositionType
position
);
const
char
*
GetDefinition
(
std
::
string
const
&
name
)
const
;
bool
IsInitialized
(
std
::
string
const
&
name
)
const
;
...
...
@@ -117,7 +114,7 @@ public:
void
InitializeFromParent
();
cmState
*
State
;
cmState
::
PositionType
Position
;
cmState
Detail
::
PositionType
Position
;
};
class
Directory
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment