cmCommonTargetGenerator: Rename member to avoid shadowing

Rename the `LocalGenerator` and `GlobalGenerator` members to avoid
shadowing similar members in subclasses that use more-specific pointer
types.
This commit is contained in:
Brad King
2017-06-14 16:31:07 -04:00
parent c1f15e1c79
commit 7b02cb2996
2 changed files with 20 additions and 18 deletions

View File

@@ -22,10 +22,11 @@
cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
: GeneratorTarget(gt)
, Makefile(gt->Makefile)
, LocalGenerator(static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
, GlobalGenerator(static_cast<cmGlobalCommonGenerator*>(
, LocalCommonGenerator(
static_cast<cmLocalCommonGenerator*>(gt->LocalGenerator))
, GlobalCommonGenerator(static_cast<cmGlobalCommonGenerator*>(
gt->LocalGenerator->GetGlobalGenerator()))
, ConfigName(LocalGenerator->GetConfigName())
, ConfigName(LocalCommonGenerator->GetConfigName())
{
}
@@ -62,10 +63,10 @@ void cmCommonTargetGenerator::AddModuleDefinitionFlag(
// Append the flag and value. Use ConvertToLinkReference to help
// vs6's "cl -link" pass it to the linker.
std::string flag = defFileFlag;
flag += this->LocalGenerator->ConvertToOutputFormat(
flag += this->LocalCommonGenerator->ConvertToOutputFormat(
linkLineComputer->ConvertToLinkReference(mdi->DefFile),
cmOutputConverter::SHELL);
this->LocalGenerator->AppendFlags(flags, flag);
this->LocalCommonGenerator->AppendFlags(flags, flag);
}
void cmCommonTargetGenerator::AppendFortranFormatFlags(
@@ -90,8 +91,8 @@ void cmCommonTargetGenerator::AppendFortranFormatFlags(
break;
}
if (var) {
this->LocalGenerator->AppendFlags(flags,
this->Makefile->GetDefinition(var));
this->LocalCommonGenerator->AppendFlags(
flags, this->Makefile->GetDefinition(var));
}
}
@@ -101,8 +102,8 @@ std::string cmCommonTargetGenerator::GetFlags(const std::string& l)
if (i == this->FlagsByLanguage.end()) {
std::string flags;
this->LocalGenerator->GetTargetCompileFlags(this->GeneratorTarget,
this->ConfigName, l, flags);
this->LocalCommonGenerator->GetTargetCompileFlags(
this->GeneratorTarget, this->ConfigName, l, flags);
ByLanguageMap::value_type entry(l, flags);
i = this->FlagsByLanguage.insert(entry).first;
@@ -115,11 +116,11 @@ std::string cmCommonTargetGenerator::GetDefines(const std::string& l)
ByLanguageMap::iterator i = this->DefinesByLanguage.find(l);
if (i == this->DefinesByLanguage.end()) {
std::set<std::string> defines;
this->LocalGenerator->GetTargetDefines(this->GeneratorTarget,
this->ConfigName, l, defines);
this->LocalCommonGenerator->GetTargetDefines(this->GeneratorTarget,
this->ConfigName, l, defines);
std::string definesString;
this->LocalGenerator->JoinDefines(defines, definesString, l);
this->LocalCommonGenerator->JoinDefines(defines, definesString, l);
ByLanguageMap::value_type entry(l, definesString);
i = this->DefinesByLanguage.insert(entry).first;
@@ -198,9 +199,10 @@ std::string cmCommonTargetGenerator::GetManifests()
std::vector<std::string> manifests;
for (std::vector<cmSourceFile const*>::iterator mi = manifest_srcs.begin();
mi != manifest_srcs.end(); ++mi) {
manifests.push_back(this->LocalGenerator->ConvertToOutputFormat(
this->LocalGenerator->ConvertToRelativePath(
this->LocalGenerator->GetWorkingDirectory(), (*mi)->GetFullPath()),
manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
this->LocalCommonGenerator->ConvertToRelativePath(
this->LocalCommonGenerator->GetWorkingDirectory(),
(*mi)->GetFullPath()),
cmOutputConverter::SHELL));
}
@@ -233,6 +235,6 @@ void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
// Append the flag since a non-zero version is specified.
std::ostringstream vflag;
vflag << flag << major << "." << minor << "." << patch;
this->LocalGenerator->AppendFlags(flags, vflag.str());
this->LocalCommonGenerator->AppendFlags(flags, vflag.str());
}
}

View File

@@ -37,8 +37,8 @@ protected:
cmGeneratorTarget* GeneratorTarget;
cmMakefile* Makefile;
cmLocalCommonGenerator* LocalGenerator;
cmGlobalCommonGenerator* GlobalGenerator;
cmLocalCommonGenerator* LocalCommonGenerator;
cmGlobalCommonGenerator* GlobalCommonGenerator;
std::string ConfigName;
void AppendFortranFormatFlags(std::string& flags,