Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
dbafb015
Commit
dbafb015
authored
May 31, 2015
by
Stephen Kelly
Browse files
cmMakefile: Split CallStack into two pieces.
parent
27ff19a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/cmMakefile.cxx
View file @
dbafb015
...
...
@@ -247,11 +247,11 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
std
::
string
const
&
text
)
const
{
// Collect context information.
if
(
!
this
->
Call
Stack
.
empty
())
if
(
!
this
->
ExecutionStatus
Stack
.
empty
())
{
if
((
t
==
cmake
::
FATAL_ERROR
)
||
(
t
==
cmake
::
INTERNAL_ERROR
))
{
this
->
Call
Stack
.
back
()
.
Status
->
SetNestedError
(
true
);
this
->
ExecutionStatus
Stack
.
back
()
->
SetNestedError
(
true
);
}
this
->
GetCMakeInstance
()
->
IssueMessage
(
t
,
text
,
this
->
GetBacktrace
());
}
...
...
@@ -276,10 +276,11 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
cmListFileBacktrace
cmMakefile
::
GetBacktrace
()
const
{
cmListFileBacktrace
backtrace
(
this
->
StateSnapshot
);
for
(
CallStackType
::
const_reverse_iterator
i
=
this
->
CallStack
.
rbegin
();
i
!=
this
->
CallStack
.
rend
();
++
i
)
for
(
std
::
vector
<
cmListFileContext
const
*>::
const_reverse_iterator
i
=
this
->
ContextStack
.
rbegin
();
i
!=
this
->
ContextStack
.
rend
();
++
i
)
{
backtrace
.
Append
(
*
i
->
Context
);
backtrace
.
Append
(
*
(
*
i
)
);
}
return
backtrace
;
}
...
...
@@ -290,10 +291,11 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
{
cmListFileBacktrace
backtrace
(
this
->
StateSnapshot
);
backtrace
.
Append
(
lfc
);
for
(
CallStackType
::
const_reverse_iterator
i
=
this
->
CallStack
.
rbegin
();
i
!=
this
->
CallStack
.
rend
();
++
i
)
for
(
std
::
vector
<
cmListFileContext
const
*>::
const_reverse_iterator
i
=
this
->
ContextStack
.
rbegin
();
i
!=
this
->
ContextStack
.
rend
();
++
i
)
{
backtrace
.
Append
(
*
i
->
Context
);
backtrace
.
Append
(
*
(
*
i
)
);
}
return
backtrace
;
}
...
...
@@ -301,7 +303,7 @@ cmMakefile::GetBacktrace(cmListFileContext const& lfc) const
//----------------------------------------------------------------------------
cmListFileContext
cmMakefile
::
GetExecutionContext
()
const
{
return
*
this
->
C
all
Stack
.
back
()
.
Context
;
return
*
this
->
C
ontext
Stack
.
back
();
}
//----------------------------------------------------------------------------
...
...
@@ -1996,7 +1998,7 @@ void cmMakefile::LogUnused(const char* reason,
{
std
::
string
path
;
cmListFileContext
lfc
;
if
(
!
this
->
Call
Stack
.
empty
())
if
(
!
this
->
ExecutionStatus
Stack
.
empty
())
{
lfc
=
this
->
GetExecutionContext
();
path
=
lfc
.
FilePath
;
...
...
@@ -3360,11 +3362,11 @@ bool cmMakefile::IsLoopBlock() const
std
::
string
cmMakefile
::
GetExecutionFilePath
()
const
{
if
(
this
->
C
all
Stack
.
empty
())
if
(
this
->
C
ontext
Stack
.
empty
())
{
return
std
::
string
();
}
return
this
->
C
all
Stack
.
back
()
.
Context
->
FilePath
;
return
this
->
C
ontext
Stack
.
back
()
->
FilePath
;
}
//----------------------------------------------------------------------------
...
...
@@ -3455,7 +3457,7 @@ bool cmMakefile::ExpandArguments(
//----------------------------------------------------------------------------
void
cmMakefile
::
AddFunctionBlocker
(
cmFunctionBlocker
*
fb
)
{
if
(
!
this
->
Call
Stack
.
empty
())
if
(
!
this
->
ExecutionStatus
Stack
.
empty
())
{
// Record the context in which the blocker is created.
fb
->
SetStartingContext
(
this
->
GetExecutionContext
());
...
...
@@ -5503,11 +5505,12 @@ cmMakefile::MacroPushPop::~MacroPushPop()
cmMakefileCall
::
cmMakefileCall
(
cmMakefile
*
mf
,
const
cmListFileContext
&
lfc
,
cmExecutionStatus
&
status
)
:
Makefile
(
mf
)
{
cm
Makefile
::
CallStackEntry
entry
=
{
&
lfc
,
&
status
}
;
this
->
Makefile
->
Call
Stack
.
push_back
(
entry
);
this
->
Makefile
->
ContextStack
.
push_back
(
&
lfc
)
;
this
->
Makefile
->
ExecutionStatus
Stack
.
push_back
(
&
status
);
}
cmMakefileCall
::~
cmMakefileCall
()
{
this
->
Makefile
->
CallStack
.
pop_back
();
this
->
Makefile
->
ExecutionStatusStack
.
pop_back
();
this
->
Makefile
->
ContextStack
.
pop_back
();
}
Source/cmMakefile.h
View file @
dbafb015
...
...
@@ -935,14 +935,8 @@ private:
// stack of list files being read
std
::
vector
<
std
::
string
>
ListFileStack
;
// stack of commands being invoked.
struct
CallStackEntry
{
cmListFileContext
const
*
Context
;
cmExecutionStatus
*
Status
;
};
typedef
std
::
vector
<
CallStackEntry
>
CallStackType
;
CallStackType
CallStack
;
std
::
vector
<
cmListFileContext
const
*>
ContextStack
;
std
::
vector
<
cmExecutionStatus
*>
ExecutionStatusStack
;
friend
class
cmMakefileCall
;
std
::
vector
<
cmTarget
*>
ImportedTargetsOwned
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment