summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.h
diff options
context:
space:
mode:
authorAaron Orenstein <aorenste@fb.com>2017-08-11 21:11:18 (GMT)
committerAaron Orenstein <aorenste@fb.com>2017-08-16 22:35:38 (GMT)
commitaf3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f (patch)
treef032e00aecd7a92e828b4f8bf0d3229f3bab307a /Source/cmLocalGenerator.h
parentc47c011c77bfd1bfb8d2060511a2b957ce181c62 (diff)
downloadCMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.zip
CMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.tar.gz
CMake-af3fd6f22f317d4209ff679e4f7c8dd8d2d0f89f.tar.bz2
Performance: Add an index to Change cmLocalGenerator::GeneratorTargets.
Add an index to Change cmLocalGenerator::GeneratorTargets for faster lookup by name. Also changed a bunch of uses of cmLocalGenerator::GetGeneratorTargets() to take const references instead of copying the vector. Represent generator targets as a map (name -> target) to make name lookups more efficient instead of looping through the entire vector to find the desired one.
Diffstat (limited to 'Source/cmLocalGenerator.h')
-rw-r--r--Source/cmLocalGenerator.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 9f78be4..9083c83 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -16,6 +16,7 @@
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmStateSnapshot.h"
+#include "cm_unordered_map.hxx"
#include "cmake.h"
class cmComputeLinkInformation;
@@ -353,8 +354,11 @@ protected:
std::string::size_type ObjectPathMax;
std::set<std::string> ObjectMaxPathViolations;
- std::set<cmGeneratorTarget const*> WarnCMP0063;
+ typedef CM_UNORDERED_MAP<std::string, cmGeneratorTarget*> GeneratorTargetMap;
+ GeneratorTargetMap GeneratorTargetSearchIndex;
std::vector<cmGeneratorTarget*> GeneratorTargets;
+
+ std::set<cmGeneratorTarget const*> WarnCMP0063;
std::vector<cmGeneratorTarget*> ImportedGeneratorTargets;
std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
std::map<std::string, std::string> AliasTargets;