summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-25 17:33:06 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-25 17:33:06 (GMT)
commit9342a4c2033ce7bb6845afd3625ac9c195a8e22d (patch)
treee8ccf1393ae30bd639cb0f4313d248d094358804 /Source/cmMakefile.cxx
parent99533c8e345c627f5f5a98be5cda7b7624756fb9 (diff)
parent5f860ebb67e86e0aa407e26ddf79652f73742211 (diff)
downloadCMake-9342a4c2033ce7bb6845afd3625ac9c195a8e22d.zip
CMake-9342a4c2033ce7bb6845afd3625ac9c195a8e22d.tar.gz
CMake-9342a4c2033ce7bb6845afd3625ac9c195a8e22d.tar.bz2
Merge branch 'reduce-cmState-accumulation' into reduce-cmState-accumulation-for-master
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4fb4579..47e1731 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -391,7 +391,7 @@ cmMakefile::IncludeScope::~IncludeScope()
this->EnforceCMP0011();
}
}
- this->Makefile->PopPolicyBarrier(this->ReportError);
+ this->Makefile->PopSnapshot(this->ReportError);
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
}
@@ -505,7 +505,7 @@ public:
~ListFileScope()
{
- this->Makefile->PopPolicyBarrier(this->ReportError);
+ this->Makefile->PopSnapshot(this->ReportError);
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
}
@@ -1534,7 +1534,7 @@ void cmMakefile::PopFunctionScope(bool reportError)
{
this->PopPolicy();
- this->PopPolicyBarrier(reportError);
+ this->PopSnapshot(reportError);
this->PopFunctionBlockerBarrier(reportError);
@@ -1565,7 +1565,7 @@ void cmMakefile::PushMacroScope(std::string const& fileName,
void cmMakefile::PopMacroScope(bool reportError)
{
this->PopPolicy();
- this->PopPolicyBarrier(reportError);
+ this->PopSnapshot(reportError);
this->PopFunctionBlockerBarrier(reportError);
}
@@ -1602,7 +1602,7 @@ public:
~BuildsystemFileScope()
{
this->Makefile->PopFunctionBlockerBarrier(this->ReportError);
- this->Makefile->PopPolicyBarrier(this->ReportError);
+ this->Makefile->PopSnapshot(this->ReportError);
#if defined(CMAKE_BUILD_WITH_CMAKE)
this->GG->GetFileLockPool().PopFileScope();
#endif
@@ -4168,9 +4168,7 @@ void cmMakefile::PopScope()
this->CheckForUnusedVariables();
- this->StateSnapshot =
- this->GetState()->Pop(this->StateSnapshot);
- assert(this->StateSnapshot.IsValid());
+ this->PopSnapshot();
}
void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
@@ -4521,20 +4519,15 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
}
//----------------------------------------------------------------------------
-cmMakefile::PolicyPushPop::PolicyPushPop(cmMakefile* m, bool weak,
- cmPolicies::PolicyMap const& pm):
- Makefile(m), ReportError(true)
+cmMakefile::PolicyPushPop::PolicyPushPop(cmMakefile* m): Makefile(m)
{
- this->Makefile->StateSnapshot = this->Makefile->StateSnapshot.GetState()
- ->CreatePolicyScopeSnapshot(this->Makefile->StateSnapshot);
- this->Makefile->PushPolicy(weak, pm);
+ this->Makefile->PushPolicy();
}
//----------------------------------------------------------------------------
cmMakefile::PolicyPushPop::~PolicyPushPop()
{
this->Makefile->PopPolicy();
- this->Makefile->PopPolicyBarrier(this->ReportError);
}
//----------------------------------------------------------------------------
@@ -4554,8 +4547,11 @@ void cmMakefile::PopPolicy()
}
//----------------------------------------------------------------------------
-void cmMakefile::PopPolicyBarrier(bool reportError)
+void cmMakefile::PopSnapshot(bool reportError)
{
+ // cmState::Snapshot manages nested policy scopes within it.
+ // Since the scope corresponding to the snapshot is closing,
+ // reject any still-open nested policy scopes with an error.
while (!this->StateSnapshot.CanPopPolicyScope())
{
if(reportError)