cmMakefile: Move policy barriers inside cmState scopes.
This commit is contained in:
parent
a5fc17b509
commit
6ae8b30bf4
|
@ -468,6 +468,14 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||||
Makefile(mf), NoPolicyScope(noPolicyScope),
|
Makefile(mf), NoPolicyScope(noPolicyScope),
|
||||||
CheckCMP0011(false), ReportError(true)
|
CheckCMP0011(false), ReportError(true)
|
||||||
{
|
{
|
||||||
|
this->Makefile->PushFunctionBlockerBarrier();
|
||||||
|
|
||||||
|
this->Makefile->StateSnapshot =
|
||||||
|
this->Makefile->GetState()->CreateCallStackSnapshot(
|
||||||
|
this->Makefile->StateSnapshot,
|
||||||
|
this->Makefile->ContextStack.back()->Name,
|
||||||
|
this->Makefile->ContextStack.back()->Line,
|
||||||
|
filenametoread);
|
||||||
this->Makefile->PushPolicyBarrier();
|
this->Makefile->PushPolicyBarrier();
|
||||||
if(!this->NoPolicyScope)
|
if(!this->NoPolicyScope)
|
||||||
{
|
{
|
||||||
|
@ -497,27 +505,11 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->Makefile->PushFunctionBlockerBarrier();
|
|
||||||
|
|
||||||
this->Makefile->StateSnapshot =
|
|
||||||
this->Makefile->GetState()->CreateCallStackSnapshot(
|
|
||||||
this->Makefile->StateSnapshot,
|
|
||||||
this->Makefile->ContextStack.back()->Name,
|
|
||||||
this->Makefile->ContextStack.back()->Line,
|
|
||||||
filenametoread);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmMakefile::IncludeScope::~IncludeScope()
|
cmMakefile::IncludeScope::~IncludeScope()
|
||||||
{
|
{
|
||||||
this->Makefile->StateSnapshot =
|
|
||||||
this->Makefile->GetState()->Pop(this->Makefile->StateSnapshot);
|
|
||||||
assert(this->Makefile->StateSnapshot.IsValid());
|
|
||||||
|
|
||||||
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
|
|
||||||
// Enforce matching policy scopes inside the included file.
|
|
||||||
|
|
||||||
if(!this->NoPolicyScope)
|
if(!this->NoPolicyScope)
|
||||||
{
|
{
|
||||||
// If we need to enforce policy CMP0011 then the top entry is the
|
// If we need to enforce policy CMP0011 then the top entry is the
|
||||||
|
@ -540,6 +532,11 @@ cmMakefile::IncludeScope::~IncludeScope()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->Makefile->PopPolicyBarrier(this->ReportError);
|
this->Makefile->PopPolicyBarrier(this->ReportError);
|
||||||
|
this->Makefile->StateSnapshot =
|
||||||
|
this->Makefile->GetState()->Pop(this->Makefile->StateSnapshot);
|
||||||
|
assert(this->Makefile->StateSnapshot.IsValid());
|
||||||
|
|
||||||
|
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -634,8 +631,6 @@ public:
|
||||||
ListFileScope(cmMakefile* mf, std::string const& filenametoread)
|
ListFileScope(cmMakefile* mf, std::string const& filenametoread)
|
||||||
: Makefile(mf), ReportError(true)
|
: Makefile(mf), ReportError(true)
|
||||||
{
|
{
|
||||||
this->Makefile->PushPolicyBarrier();
|
|
||||||
|
|
||||||
long line = 0;
|
long line = 0;
|
||||||
std::string name;
|
std::string name;
|
||||||
if (!this->Makefile->ContextStack.empty())
|
if (!this->Makefile->ContextStack.empty())
|
||||||
|
@ -647,17 +642,21 @@ public:
|
||||||
this->Makefile->GetState()->CreateInlineListFileSnapshot(
|
this->Makefile->GetState()->CreateInlineListFileSnapshot(
|
||||||
this->Makefile->StateSnapshot, name, line, filenametoread);
|
this->Makefile->StateSnapshot, name, line, filenametoread);
|
||||||
assert(this->Makefile->StateSnapshot.IsValid());
|
assert(this->Makefile->StateSnapshot.IsValid());
|
||||||
|
|
||||||
|
this->Makefile->PushPolicyBarrier();
|
||||||
|
|
||||||
this->Makefile->PushFunctionBlockerBarrier();
|
this->Makefile->PushFunctionBlockerBarrier();
|
||||||
}
|
}
|
||||||
|
|
||||||
~ListFileScope()
|
~ListFileScope()
|
||||||
{
|
{
|
||||||
|
this->Makefile->PopPolicyBarrier(this->ReportError);
|
||||||
|
|
||||||
this->Makefile->StateSnapshot =
|
this->Makefile->StateSnapshot =
|
||||||
this->Makefile->GetState()->Pop(this->Makefile->StateSnapshot);
|
this->Makefile->GetState()->Pop(this->Makefile->StateSnapshot);
|
||||||
assert(this->Makefile->StateSnapshot.IsValid());
|
assert(this->Makefile->StateSnapshot.IsValid());
|
||||||
|
|
||||||
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
|
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
|
||||||
this->Makefile->PopPolicyBarrier(this->ReportError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Quiet() { this->ReportError = false; }
|
void Quiet() { this->ReportError = false; }
|
||||||
|
@ -1628,6 +1627,7 @@ void cmMakefile::PushFunctionScope(std::string const& fileName,
|
||||||
this->ContextStack.back()->Name, this->ContextStack.back()->Line,
|
this->ContextStack.back()->Name, this->ContextStack.back()->Line,
|
||||||
fileName);
|
fileName);
|
||||||
assert(this->StateSnapshot.IsValid());
|
assert(this->StateSnapshot.IsValid());
|
||||||
|
this->PushPolicyBarrier();
|
||||||
|
|
||||||
this->Internal->PushDefinitions();
|
this->Internal->PushDefinitions();
|
||||||
|
|
||||||
|
@ -1639,15 +1639,14 @@ void cmMakefile::PushFunctionScope(std::string const& fileName,
|
||||||
|
|
||||||
this->PushFunctionBlockerBarrier();
|
this->PushFunctionBlockerBarrier();
|
||||||
|
|
||||||
this->PushPolicyBarrier();
|
|
||||||
this->PushPolicy(true, pm);
|
this->PushPolicy(true, pm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::PopFunctionScope(bool reportError)
|
void cmMakefile::PopFunctionScope(bool reportError)
|
||||||
{
|
{
|
||||||
this->PopPolicy();
|
this->PopPolicy();
|
||||||
this->PopPolicyBarrier(reportError);
|
|
||||||
|
|
||||||
|
this->PopPolicyBarrier(reportError);
|
||||||
this->StateSnapshot = this->GetState()->Pop(this->StateSnapshot);
|
this->StateSnapshot = this->GetState()->Pop(this->StateSnapshot);
|
||||||
assert(this->StateSnapshot.IsValid());
|
assert(this->StateSnapshot.IsValid());
|
||||||
|
|
||||||
|
@ -1673,10 +1672,10 @@ void cmMakefile::PushMacroScope(std::string const& fileName,
|
||||||
this->ContextStack.back()->Name, this->ContextStack.back()->Line,
|
this->ContextStack.back()->Name, this->ContextStack.back()->Line,
|
||||||
fileName);
|
fileName);
|
||||||
assert(this->StateSnapshot.IsValid());
|
assert(this->StateSnapshot.IsValid());
|
||||||
|
this->PushPolicyBarrier();
|
||||||
|
|
||||||
this->PushFunctionBlockerBarrier();
|
this->PushFunctionBlockerBarrier();
|
||||||
|
|
||||||
this->PushPolicyBarrier();
|
|
||||||
this->PushPolicy(true, pm);
|
this->PushPolicy(true, pm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue