From 4ac72455fd7027039d498f007fdfe7c1d819b9f9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 12 Jun 2014 16:21:45 -0400 Subject: cmTarget: Drop 'head' argument from GetLinkClosure It is only ever passed the 'this' target itself. --- Source/cmComputeLinkInformation.cxx | 5 ++--- Source/cmTarget.cxx | 22 ++++++++++------------ Source/cmTarget.h | 6 ++---- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index bcafe2d..e1852a3 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -569,8 +569,7 @@ bool cmComputeLinkInformation::Compute() void cmComputeLinkInformation::AddImplicitLinkInfo() { // The link closure lists all languages whose implicit info is needed. - cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config, - this->Target); + cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config); for(std::vector::const_iterator li = lc->Languages.begin(); li != lc->Languages.end(); ++li) { @@ -1969,7 +1968,7 @@ void cmComputeLinkInformation::GetRPath(std::vector& runtimeDirs, // present. This is done even when skipping rpath support. { cmTarget::LinkClosure const* lc = - this->Target->GetLinkClosure(this->Config, this->Target); + this->Target->GetLinkClosure(this->Config); for(std::vector::const_iterator li = lc->Languages.begin(); li != lc->Languages.end(); ++li) { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f52c94d..f380052 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -136,8 +136,7 @@ public: cmTarget::LinkImplementation> LinkImplMapType; LinkImplMapType LinkImplMap; - typedef std::map - LinkClosureMapType; + typedef std::map LinkClosureMapType; LinkClosureMapType LinkClosureMap; typedef std::map > @@ -3554,21 +3553,20 @@ private: //---------------------------------------------------------------------------- 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( - const std::string& config, - cmTarget const* head) const +cmTarget::LinkClosure const* +cmTarget::GetLinkClosure(const std::string& config) const { - TargetConfigPair key(head, cmSystemTools::UpperCase(config)); + std::string key(cmSystemTools::UpperCase(config)); cmTargetInternals::LinkClosureMapType::iterator i = this->Internal->LinkClosureMap.find(key); if(i == this->Internal->LinkClosureMap.end()) { LinkClosure lc; - this->ComputeLinkClosure(config, lc, head); + this->ComputeLinkClosure(config, lc); cmTargetInternals::LinkClosureMapType::value_type entry(key, lc); i = this->Internal->LinkClosureMap.insert(entry).first; } @@ -3629,12 +3627,12 @@ public: }; //---------------------------------------------------------------------------- -void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc, - cmTarget const* head) const +void cmTarget::ComputeLinkClosure(const std::string& config, + LinkClosure& lc) const { // Get languages built in this target. std::set languages; - LinkImplementation const* impl = this->GetLinkImplementation(config, head); + LinkImplementation const* impl = this->GetLinkImplementation(config, this); for(std::vector::const_iterator li = impl->Languages.begin(); li != impl->Languages.end(); ++li) { @@ -3642,7 +3640,7 @@ void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc, } // Add interface languages from linked targets. - cmTargetCollectLinkLanguages cll(this, config, languages, head); + cmTargetCollectLinkLanguages cll(this, config, languages, this); for(std::vector::const_iterator li = impl->Libraries.begin(); li != impl->Libraries.end(); ++li) { diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 26a1e86..8c6955e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -308,8 +308,7 @@ public: // Languages whose runtime libraries must be linked. std::vector Languages; }; - LinkClosure const* GetLinkClosure(const std::string& config, - cmTarget const* head) const; + LinkClosure const* GetLinkClosure(const std::string& config) const; /** Strip off leading and trailing whitespace from an item named in the link dependencies of this target. */ @@ -757,8 +756,7 @@ private: void ComputeLinkImplementationLanguages(const std::string& config, LinkImplementation& impl, cmTarget const* head) const; - void ComputeLinkClosure(const std::string& config, LinkClosure& lc, - cmTarget const* head) const; + void ComputeLinkClosure(const std::string& config, LinkClosure& lc) const; void ExpandLinkItems(std::string const& prop, std::string const& value, std::string const& config, cmTarget const* headTarget, -- cgit v0.12