Merge topic 'simplify-condition-context'

2379b3ae cmConditionEvaluator: Remove GetConditionContext method
02fce523 cmConditionEvaluator: Drop unnecessary path conversion
This commit is contained in:
Brad King 2016-03-31 08:45:54 -04:00 committed by CMake Topic Stage
commit 91d91d9d5d
4 changed files with 6 additions and 28 deletions

View File

@ -104,25 +104,6 @@ bool cmConditionEvaluator::IsTrue(
errorString, status, true);
}
cmListFileContext cmConditionEvaluator::GetConditionContext(
cmMakefile* mf,
const cmCommandContext& command,
const std::string& filePath)
{
cmListFileContext context =
cmListFileContext::FromCommandContext(
command,
filePath);
if(!mf->GetCMakeInstance()->GetIsInTryCompile())
{
cmOutputConverter converter(mf->GetStateSnapshot());
context.FilePath = converter.Convert(context.FilePath,
cmOutputConverter::HOME);
}
return context;
}
//=========================================================================
const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
cmExpandedCommandArgument const& argument) const

View File

@ -33,9 +33,6 @@ public:
std::string &errorString,
cmake::MessageType &status);
static cmListFileContext GetConditionContext(cmMakefile* mf,
const cmCommandContext& command, std::string const& filePath);
private:
// Filter the given variable definition based on policy CMP0054.
const char* GetDefinitionIfUnquoted(

View File

@ -108,8 +108,8 @@ IsFunctionBlocked(const cmListFileFunction& lff,
cmake::MessageType messType;
cmListFileContext conditionContext =
cmConditionEvaluator::GetConditionContext(
&mf, this->Functions[c],
cmListFileContext::FromCommandContext(
this->Functions[c],
this->GetStartingContext().FilePath);
cmConditionEvaluator conditionEvaluator(
@ -210,8 +210,8 @@ bool cmIfCommand
commandContext.Name = execContext.Name;
cmConditionEvaluator conditionEvaluator(
*(this->Makefile), cmConditionEvaluator::GetConditionContext(
this->Makefile, commandContext, execContext.FilePath),
*(this->Makefile), cmListFileContext::FromCommandContext(
commandContext, execContext.FilePath),
this->Makefile->GetBacktrace());
bool isTrue = conditionEvaluator.IsTrue(

View File

@ -56,8 +56,8 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
commandContext.Name = execContext.Name;
cmListFileContext conditionContext =
cmConditionEvaluator::GetConditionContext(
&mf, commandContext,
cmListFileContext::FromCommandContext(
commandContext,
this->GetStartingContext().FilePath);
cmConditionEvaluator conditionEvaluator(