summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-21 15:36:16 (GMT)
committerBrad King <brad.king@kitware.com>2014-07-21 15:43:30 (GMT)
commit438d9c7c822f42c4fccd77a47b1a32f52a87e617 (patch)
tree7e37788b7c0a4cba4def4b77bebe0d35c6353efc
parentfe665fdda8986b3af061ec91a7ab5fbe8f606e4f (diff)
downloadCMake-438d9c7c822f42c4fccd77a47b1a32f52a87e617.zip
CMake-438d9c7c822f42c4fccd77a47b1a32f52a87e617.tar.gz
CMake-438d9c7c822f42c4fccd77a47b1a32f52a87e617.tar.bz2
cmTarget: Re-order link interface map lookup logic
In GetLinkInterface, GetLinkInterfaceLibraries, and GetImportLinkInterface, lookup the HeadToLinkInterfaceMap for the current configuration first, and then index it by head target. In GetLinkImplementationLibrariesInternal, lookup the HeadToLinkImplementationMap for the current configuration first, and then index it by head target.
-rw-r--r--Source/cmTarget.cxx31
1 files changed, 15 insertions, 16 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 52b7e68..df65a68 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5746,9 +5746,9 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
// Lookup any existing link interface for this configuration.
std::string CONFIG = cmSystemTools::UpperCase(config);
-
- cmTargetInternals::OptionalLinkInterface&
- iface = this->Internal->LinkInterfaceMap[CONFIG][head];
+ cmTargetInternals::HeadToLinkInterfaceMap& hm =
+ this->Internal->LinkInterfaceMap[CONFIG];
+ cmTargetInternals::OptionalLinkInterface& iface = hm[head];
if(!iface.LibrariesDone)
{
iface.LibrariesDone = true;
@@ -5789,12 +5789,11 @@ cmTarget::GetLinkInterfaceLibraries(const std::string& config,
// Lookup any existing link interface for this configuration.
std::string CONFIG = cmSystemTools::UpperCase(config);
- cmTargetInternals::LinkInterfaceMapType& lim =
+ cmTargetInternals::HeadToLinkInterfaceMap& hm =
(usage_requirements_only ?
- this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
- this->Internal->LinkInterfaceMap);
-
- cmTargetInternals::OptionalLinkInterface& iface = lim[CONFIG][head];
+ this->Internal->LinkInterfaceUsageRequirementsOnlyMap[CONFIG] :
+ this->Internal->LinkInterfaceMap[CONFIG]);
+ cmTargetInternals::OptionalLinkInterface& iface = hm[head];
if(!iface.LibrariesDone)
{
iface.LibrariesDone = true;
@@ -5817,13 +5816,12 @@ cmTarget::GetImportLinkInterface(const std::string& config,
return 0;
}
- cmTargetInternals::LinkInterfaceMapType& lim =
- (usage_requirements_only ?
- this->Internal->LinkInterfaceUsageRequirementsOnlyMap :
- this->Internal->LinkInterfaceMap);
-
std::string CONFIG = cmSystemTools::UpperCase(config);
- cmTargetInternals::OptionalLinkInterface& iface = lim[CONFIG][headTarget];
+ cmTargetInternals::HeadToLinkInterfaceMap& hm =
+ (usage_requirements_only ?
+ this->Internal->LinkInterfaceUsageRequirementsOnlyMap[CONFIG] :
+ this->Internal->LinkInterfaceMap[CONFIG]);
+ cmTargetInternals::OptionalLinkInterface& iface = hm[headTarget];
if(!iface.AllDone)
{
iface.AllDone = true;
@@ -6261,8 +6259,9 @@ cmTarget::GetLinkImplementationLibrariesInternal(const std::string& config,
// Populate the link implementation libraries for this configuration.
std::string CONFIG = cmSystemTools::UpperCase(config);
- cmTargetInternals::OptionalLinkImplementation&
- impl = this->Internal->LinkImplMap[CONFIG][head];
+ cmTargetInternals::HeadToLinkImplementationMap& hm =
+ this->Internal->LinkImplMap[CONFIG];
+ cmTargetInternals::OptionalLinkImplementation& impl = hm[head];
if(!impl.LibrariesDone)
{
impl.LibrariesDone = true;