From 89095514a7f6d7075e8d2fda1b88445b87a3bec8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Jul 2014 12:58:19 -0400 Subject: cmTarget: Refactor GetLinkImplementationClosure internals Store the 'Done' flag directly in each map entry instead of using a separate map. --- Source/cmTarget.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8185bcc..d3a9beb 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -164,6 +164,13 @@ public: typedef std::map LinkClosureMapType; LinkClosureMapType LinkClosureMap; + struct LinkImplClosure: public std::vector + { + LinkImplClosure(): Done(false) {} + bool Done; + }; + std::map LinkImplClosureMap; + typedef std::map > SourceFilesMapType; SourceFilesMapType SourceFilesMap; @@ -203,15 +210,12 @@ public: CachedLinkInterfaceSourcesEntries; std::map > CachedLinkInterfaceCompileFeaturesEntries; - std::map > - CachedLinkImplementationClosure; std::map CacheLinkInterfaceIncludeDirectoriesDone; std::map CacheLinkInterfaceCompileDefinitionsDone; std::map CacheLinkInterfaceCompileOptionsDone; std::map CacheLinkInterfaceSourcesDone; std::map CacheLinkInterfaceCompileFeaturesDone; - std::map CacheLinkImplementationClosureDone; }; cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem; @@ -6034,11 +6038,11 @@ void processILibs(const std::string& config, std::vector const& cmTarget::GetLinkImplementationClosure(const std::string& config) const { - std::vector& tgts = - this->Internal->CachedLinkImplementationClosure[config]; - if(!this->Internal->CacheLinkImplementationClosureDone[config]) + cmTargetInternals::LinkImplClosure& tgts = + this->Internal->LinkImplClosureMap[config]; + if(!tgts.Done) { - this->Internal->CacheLinkImplementationClosureDone[config] = true; + tgts.Done = true; std::set emitted; cmTarget::LinkImplementationLibraries const* impl -- cgit v0.12