cmComputeLinkInformation: Remove 'head' argument

It is only ever constructed with the current target as its own 'head'.

Co-Author: Stephen Kelly <steveire@gmail.com>
This commit is contained in:
Brad King 2014-06-12 16:15:10 -04:00
parent 06328dd58e
commit bd9b667bbe
5 changed files with 13 additions and 22 deletions

View File

@ -172,12 +172,10 @@ satisfy dependencies.
//----------------------------------------------------------------------------
cmComputeLinkDepends
::cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head)
::cmComputeLinkDepends(cmTarget const* target, const std::string& config)
{
// Store context information.
this->Target = target;
this->HeadTarget = head;
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = this->Makefile->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
@ -356,7 +354,7 @@ void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
{
// Follow the target dependencies.
if(cmTarget::LinkInterface const* iface =
entry.Target->GetLinkInterface(this->Config, this->HeadTarget))
entry.Target->GetLinkInterface(this->Config, this->Target))
{
const bool isIface =
entry.Target->GetType() == cmTarget::INTERFACE_LIBRARY;
@ -455,7 +453,7 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
if(entry.Target)
{
if(cmTarget::LinkInterface const* iface =
entry.Target->GetLinkInterface(this->Config, this->HeadTarget))
entry.Target->GetLinkInterface(this->Config, this->Target))
{
// Follow public and private dependencies transitively.
this->FollowSharedDeps(index, iface, true);
@ -544,7 +542,7 @@ void cmComputeLinkDepends::AddDirectLinkEntries()
{
// Add direct link dependencies in this configuration.
cmTarget::LinkImplementation const* impl =
this->Target->GetLinkImplementation(this->Config, this->HeadTarget);
this->Target->GetLinkImplementation(this->Config, this->Target);
this->AddLinkEntries(-1, impl->Libraries);
for(std::vector<std::string>::const_iterator
wi = impl->WrongConfigLibraries.begin();
@ -955,7 +953,7 @@ int cmComputeLinkDepends::ComputeComponentCount(NodeList const& nl)
if(cmTarget const* target = this->EntryList[*ni].Target)
{
if(cmTarget::LinkInterface const* iface =
target->GetLinkInterface(this->Config, this->HeadTarget))
target->GetLinkInterface(this->Config, this->Target))
{
if(iface->Multiplicity > count)
{

View File

@ -32,8 +32,7 @@ class cmake;
class cmComputeLinkDepends
{
public:
cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head);
cmComputeLinkDepends(cmTarget const* target, const std::string& config);
~cmComputeLinkDepends();
// Basic information about each link item.
@ -60,7 +59,6 @@ private:
// Context information.
cmTarget const* Target;
cmTarget const* HeadTarget;
cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator;
cmGlobalGenerator const* GlobalGenerator;

View File

@ -239,12 +239,10 @@ because this need be done only for shared libraries without soname-s.
//----------------------------------------------------------------------------
cmComputeLinkInformation
::cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget)
::cmComputeLinkInformation(cmTarget const* target, const std::string& config)
{
// Store context information.
this->Target = target;
this->HeadTarget = headTarget;
this->Makefile = this->Target->GetMakefile();
this->LocalGenerator = this->Makefile->GetLocalGenerator();
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
@ -267,7 +265,7 @@ cmComputeLinkInformation
this->OrderDependentRPath = 0;
// Get the language used for linking this target.
this->LinkLanguage = this->Target->GetLinkerLanguage(config, headTarget);
this->LinkLanguage = this->Target->GetLinkerLanguage(config);
if(this->LinkLanguage.empty())
{
// The Compute method will do nothing, so skip the rest of the
@ -505,8 +503,7 @@ bool cmComputeLinkInformation::Compute()
}
// Compute the ordered link line items.
cmComputeLinkDepends cld(this->Target, this->Config,
this->HeadTarget);
cmComputeLinkDepends cld(this->Target, this->Config);
cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
@ -573,7 +570,7 @@ void cmComputeLinkInformation::AddImplicitLinkInfo()
{
// The link closure lists all languages whose implicit info is needed.
cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config,
this->HeadTarget);
this->Target);
for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
li != lc->Languages.end(); ++li)
{
@ -1972,7 +1969,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// present. This is done even when skipping rpath support.
{
cmTarget::LinkClosure const* lc =
this->Target->GetLinkClosure(this->Config, this->HeadTarget);
this->Target->GetLinkClosure(this->Config, this->Target);
for(std::vector<std::string>::const_iterator li = lc->Languages.begin();
li != lc->Languages.end(); ++li)
{

View File

@ -29,8 +29,7 @@ class cmOrderDirectories;
class cmComputeLinkInformation
{
public:
cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget);
cmComputeLinkInformation(cmTarget const* target, const std::string& config);
~cmComputeLinkInformation();
bool Compute();
@ -75,7 +74,6 @@ private:
// Context information.
cmTarget const* Target;
cmTarget const* HeadTarget;
cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator;
cmGlobalGenerator* GlobalGenerator;

View File

@ -6953,7 +6953,7 @@ cmTarget::GetLinkInformation(const std::string& config) const
{
// Compute information for this configuration.
cmComputeLinkInformation* info =
new cmComputeLinkInformation(this, config, this);
new cmComputeLinkInformation(this, config);
if(!info || !info->Compute())
{
delete info;