cmMakefile: Use more suitable method name to log var usage.
This commit is contained in:
parent
9118b53b79
commit
528d68021c
@ -1722,7 +1722,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
|
|||||||
this->Internal->SetDefinition(name, value);
|
this->Internal->SetDefinition(name, value);
|
||||||
if (this->VariableInitialized(name))
|
if (this->VariableInitialized(name))
|
||||||
{
|
{
|
||||||
this->CheckForUnused("changing definition", name);
|
this->LogUnused("changing definition", name);
|
||||||
this->Internal->VarUsageStack.top().erase(name);
|
this->Internal->VarUsageStack.top().erase(name);
|
||||||
}
|
}
|
||||||
this->Internal->VarInitStack.top().insert(name);
|
this->Internal->VarInitStack.top().insert(name);
|
||||||
@ -1797,7 +1797,7 @@ void cmMakefile::AddDefinition(const std::string& name, bool value)
|
|||||||
this->Internal->SetDefinition(name, value ? "ON" : "OFF");
|
this->Internal->SetDefinition(name, value ? "ON" : "OFF");
|
||||||
if (this->VariableInitialized(name))
|
if (this->VariableInitialized(name))
|
||||||
{
|
{
|
||||||
this->CheckForUnused("changing definition", name);
|
this->LogUnused("changing definition", name);
|
||||||
this->Internal->VarUsageStack.top().erase(name);
|
this->Internal->VarUsageStack.top().erase(name);
|
||||||
}
|
}
|
||||||
this->Internal->VarInitStack.top().insert(name);
|
this->Internal->VarInitStack.top().insert(name);
|
||||||
@ -1821,7 +1821,7 @@ void cmMakefile::CheckForUnusedVariables() const
|
|||||||
std::vector<std::string>::const_iterator it = locals.begin();
|
std::vector<std::string>::const_iterator it = locals.begin();
|
||||||
for (; it != locals.end(); ++it)
|
for (; it != locals.end(); ++it)
|
||||||
{
|
{
|
||||||
this->CheckForUnused("out of scope", *it);
|
this->LogUnused("out of scope", *it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1850,7 +1850,7 @@ bool cmMakefile::VariableUsed(const std::string& var) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmMakefile::CheckForUnused(const char* reason,
|
void cmMakefile::LogUnused(const char* reason,
|
||||||
const std::string& name) const
|
const std::string& name) const
|
||||||
{
|
{
|
||||||
if (this->WarnUnused && !this->VariableUsed(name))
|
if (this->WarnUnused && !this->VariableUsed(name))
|
||||||
@ -1894,7 +1894,7 @@ void cmMakefile::RemoveDefinition(const std::string& name)
|
|||||||
this->Internal->RemoveDefinition(name);
|
this->Internal->RemoveDefinition(name);
|
||||||
if (this->VariableInitialized(name))
|
if (this->VariableInitialized(name))
|
||||||
{
|
{
|
||||||
this->CheckForUnused("unsetting", name);
|
this->LogUnused("unsetting", name);
|
||||||
this->Internal->VarUsageStack.top().erase(name);
|
this->Internal->VarUsageStack.top().erase(name);
|
||||||
}
|
}
|
||||||
this->Internal->VarInitStack.top().insert(name);
|
this->Internal->VarInitStack.top().insert(name);
|
||||||
@ -4347,7 +4347,7 @@ void cmMakefile::PopScope()
|
|||||||
init.erase(*it);
|
init.erase(*it);
|
||||||
if (!this->VariableUsed(*it))
|
if (!this->VariableUsed(*it))
|
||||||
{
|
{
|
||||||
this->CheckForUnused("out of scope", *it);
|
this->LogUnused("out of scope", *it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -823,7 +823,7 @@ protected:
|
|||||||
void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
|
void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
|
||||||
|
|
||||||
// Check for a an unused variable
|
// Check for a an unused variable
|
||||||
void CheckForUnused(const char* reason, const std::string& name) const;
|
void LogUnused(const char* reason, const std::string& name) const;
|
||||||
|
|
||||||
std::string ProjectName; // project name
|
std::string ProjectName; // project name
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user