cmTarget: Drop 'head' argument from GetLinkClosure

It is only ever passed the 'this' target itself.
This commit is contained in:
Brad King 2014-06-12 16:21:45 -04:00
parent bcdb7ff9df
commit 4ac72455fd
3 changed files with 14 additions and 19 deletions

View File

@ -569,8 +569,7 @@ bool cmComputeLinkInformation::Compute()
void cmComputeLinkInformation::AddImplicitLinkInfo() void cmComputeLinkInformation::AddImplicitLinkInfo()
{ {
// The link closure lists all languages whose implicit info is needed. // The link closure lists all languages whose implicit info is needed.
cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config, cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config);
this->Target);
for(std::vector<std::string>::const_iterator li = lc->Languages.begin(); for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
li != lc->Languages.end(); ++li) li != lc->Languages.end(); ++li)
{ {
@ -1969,7 +1968,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// present. This is done even when skipping rpath support. // present. This is done even when skipping rpath support.
{ {
cmTarget::LinkClosure const* lc = cmTarget::LinkClosure const* lc =
this->Target->GetLinkClosure(this->Config, this->Target); this->Target->GetLinkClosure(this->Config);
for(std::vector<std::string>::const_iterator li = lc->Languages.begin(); for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
li != lc->Languages.end(); ++li) li != lc->Languages.end(); ++li)
{ {

View File

@ -136,8 +136,7 @@ public:
cmTarget::LinkImplementation> LinkImplMapType; cmTarget::LinkImplementation> LinkImplMapType;
LinkImplMapType LinkImplMap; LinkImplMapType LinkImplMap;
typedef std::map<TargetConfigPair, cmTarget::LinkClosure> typedef std::map<std::string, cmTarget::LinkClosure> LinkClosureMapType;
LinkClosureMapType;
LinkClosureMapType LinkClosureMap; LinkClosureMapType LinkClosureMap;
typedef std::map<TargetConfigPair, std::vector<cmSourceFile*> > typedef std::map<TargetConfigPair, std::vector<cmSourceFile*> >
@ -3554,21 +3553,20 @@ private:
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetLinkerLanguage(const std::string& config) const std::string cmTarget::GetLinkerLanguage(const std::string& config) const
{ {
return this->GetLinkClosure(config, this)->LinkerLanguage; return this->GetLinkClosure(config)->LinkerLanguage;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkClosure const* cmTarget::GetLinkClosure( cmTarget::LinkClosure const*
const std::string& config, cmTarget::GetLinkClosure(const std::string& config) const
cmTarget const* head) const
{ {
TargetConfigPair key(head, cmSystemTools::UpperCase(config)); std::string key(cmSystemTools::UpperCase(config));
cmTargetInternals::LinkClosureMapType::iterator cmTargetInternals::LinkClosureMapType::iterator
i = this->Internal->LinkClosureMap.find(key); i = this->Internal->LinkClosureMap.find(key);
if(i == this->Internal->LinkClosureMap.end()) if(i == this->Internal->LinkClosureMap.end())
{ {
LinkClosure lc; LinkClosure lc;
this->ComputeLinkClosure(config, lc, head); this->ComputeLinkClosure(config, lc);
cmTargetInternals::LinkClosureMapType::value_type entry(key, lc); cmTargetInternals::LinkClosureMapType::value_type entry(key, lc);
i = this->Internal->LinkClosureMap.insert(entry).first; i = this->Internal->LinkClosureMap.insert(entry).first;
} }
@ -3629,12 +3627,12 @@ public:
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc, void cmTarget::ComputeLinkClosure(const std::string& config,
cmTarget const* head) const LinkClosure& lc) const
{ {
// Get languages built in this target. // Get languages built in this target.
std::set<std::string> languages; std::set<std::string> languages;
LinkImplementation const* impl = this->GetLinkImplementation(config, head); LinkImplementation const* impl = this->GetLinkImplementation(config, this);
for(std::vector<std::string>::const_iterator li = impl->Languages.begin(); for(std::vector<std::string>::const_iterator li = impl->Languages.begin();
li != impl->Languages.end(); ++li) li != impl->Languages.end(); ++li)
{ {
@ -3642,7 +3640,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
} }
// Add interface languages from linked targets. // Add interface languages from linked targets.
cmTargetCollectLinkLanguages cll(this, config, languages, head); cmTargetCollectLinkLanguages cll(this, config, languages, this);
for(std::vector<std::string>::const_iterator li = impl->Libraries.begin(); for(std::vector<std::string>::const_iterator li = impl->Libraries.begin();
li != impl->Libraries.end(); ++li) li != impl->Libraries.end(); ++li)
{ {

View File

@ -308,8 +308,7 @@ public:
// Languages whose runtime libraries must be linked. // Languages whose runtime libraries must be linked.
std::vector<std::string> Languages; std::vector<std::string> Languages;
}; };
LinkClosure const* GetLinkClosure(const std::string& config, LinkClosure const* GetLinkClosure(const std::string& config) const;
cmTarget const* head) const;
/** Strip off leading and trailing whitespace from an item named in /** Strip off leading and trailing whitespace from an item named in
the link dependencies of this target. */ the link dependencies of this target. */
@ -757,8 +756,7 @@ private:
void ComputeLinkImplementationLanguages(const std::string& config, void ComputeLinkImplementationLanguages(const std::string& config,
LinkImplementation& impl, LinkImplementation& impl,
cmTarget const* head) const; cmTarget const* head) const;
void ComputeLinkClosure(const std::string& config, LinkClosure& lc, void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const;
cmTarget const* head) const;
void ExpandLinkItems(std::string const& prop, std::string const& value, void ExpandLinkItems(std::string const& prop, std::string const& value,
std::string const& config, cmTarget const* headTarget, std::string const& config, cmTarget const* headTarget,