diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-22 21:05:27 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-22 21:05:27 (GMT) |
commit | cbcfb79f9c38c1dac28e9353cc7d7e5efec0357f (patch) | |
tree | bc2a5bea4adc0805b5439679c90e52103348a23a | |
parent | 8a0ed37f617347a6c7c37c50a5321f05d678fa76 (diff) | |
download | CMake-cbcfb79f9c38c1dac28e9353cc7d7e5efec0357f.zip CMake-cbcfb79f9c38c1dac28e9353cc7d7e5efec0357f.tar.gz CMake-cbcfb79f9c38c1dac28e9353cc7d7e5efec0357f.tar.bz2 |
Use C++11 unordered containers
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 2 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_unordered_map.cxx | 7 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_unordered_set.cxx | 7 | ||||
-rw-r--r-- | Source/cmConfigure.cmake.h.in | 2 | ||||
-rw-r--r-- | Source/cmDefinitions.h | 4 | ||||
-rw-r--r-- | Source/cmExportLibraryDependenciesCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmFileTimeComparison.cxx | 5 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 37 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 9 | ||||
-rw-r--r-- | Source/cmInstallTargetsCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 5 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 | ||||
-rw-r--r-- | Source/cmOutputRequiredFilesCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 4 | ||||
-rw-r--r-- | Source/cmTarget.h | 4 | ||||
-rw-r--r-- | Source/cmTargetPropertyComputer.cxx | 4 | ||||
-rw-r--r-- | Source/cm_unordered_map.hxx | 25 | ||||
-rw-r--r-- | Source/cm_unordered_set.hxx | 25 | ||||
-rw-r--r-- | Source/cmake.cxx | 4 | ||||
-rw-r--r-- | Utilities/IWYU/mapping.imp | 20 |
20 files changed, 45 insertions, 131 deletions
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 3b08025..e75a7ef 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -54,5 +54,3 @@ endif() cm_check_cxx_feature(nullptr) cm_check_cxx_feature(override) cm_check_cxx_feature(unique_ptr) -cm_check_cxx_feature(unordered_map) -cm_check_cxx_feature(unordered_set) diff --git a/Source/Checks/cm_cxx_unordered_map.cxx b/Source/Checks/cm_cxx_unordered_map.cxx deleted file mode 100644 index be3de25..0000000 --- a/Source/Checks/cm_cxx_unordered_map.cxx +++ /dev/null @@ -1,7 +0,0 @@ -#include <unordered_map> -int main() -{ - std::unordered_map<int, int> map; - map[0] = 0; - return 0; -} diff --git a/Source/Checks/cm_cxx_unordered_set.cxx b/Source/Checks/cm_cxx_unordered_set.cxx deleted file mode 100644 index de4bb77..0000000 --- a/Source/Checks/cm_cxx_unordered_set.cxx +++ /dev/null @@ -1,7 +0,0 @@ -#include <unordered_set> -int main() -{ - std::unordered_set<int> set; - set.insert(0); - return 0; -} diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 302000a..a920bf2 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -28,8 +28,6 @@ #cmakedefine CMake_HAVE_CXX_NULLPTR #cmakedefine CMake_HAVE_CXX_OVERRIDE #cmakedefine CMake_HAVE_CXX_UNIQUE_PTR -#cmakedefine CMake_HAVE_CXX_UNORDERED_MAP -#cmakedefine CMake_HAVE_CXX_UNORDERED_SET #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@" #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@" diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index ddb8918..528b157 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -6,10 +6,10 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <string> +#include <unordered_map> #include <vector> #include "cmLinkedTree.h" -#include "cm_unordered_map.hxx" /** \class cmDefinitions * \brief Store a scope of variable definitions for CMake language. @@ -70,7 +70,7 @@ private: }; static Def NoDef; - typedef CM_UNORDERED_MAP<std::string, Def> MapType; + typedef std::unordered_map<std::string, Def> MapType; MapType Map; static Def const& GetInternal(const std::string& key, StackIter begin, diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx index 69150ae..a1fdeae 100644 --- a/Source/cmExportLibraryDependenciesCommand.cxx +++ b/Source/cmExportLibraryDependenciesCommand.cxx @@ -4,6 +4,7 @@ #include "cmsys/FStream.hxx" #include <map> +#include <unordered_map> #include <utility> #include "cmGeneratedFileStream.h" @@ -14,7 +15,6 @@ #include "cmTarget.h" #include "cmTargetLinkLibraryType.h" #include "cm_auto_ptr.hxx" -#include "cm_unordered_map.hxx" #include "cmake.h" class cmExecutionStatus; diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx index f591a8d..61e419c 100644 --- a/Source/cmFileTimeComparison.cxx +++ b/Source/cmFileTimeComparison.cxx @@ -4,10 +4,9 @@ #include <string> #include <time.h> +#include <unordered_map> #include <utility> -#include "cm_unordered_map.hxx" - // Use a platform-specific API to get file times efficiently. #if !defined(_WIN32) || defined(__CYGWIN__) #include "cm_sys_stat.h" @@ -27,7 +26,7 @@ public: bool FileTimesDiffer(const char* f1, const char* f2); private: - typedef CM_UNORDERED_MAP<std::string, cmFileTimeComparison_Type> + typedef std::unordered_map<std::string, cmFileTimeComparison_Type> FileStatsMap; FileStatsMap Files; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 95f4543..05f94dd 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -12,6 +12,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unordered_set> #include "cmAlgorithms.h" #include "cmComputeLinkInformation.h" @@ -32,7 +33,6 @@ #include "cmTargetLinkLibraryType.h" #include "cmTargetPropertyComputer.h" #include "cm_auto_ptr.hxx" -#include "cm_unordered_set.hxx" #include "cmake.h" class cmMessenger; @@ -823,7 +823,7 @@ static void AddInterfaceEntries( static bool processSources( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, - std::vector<std::string>& srcs, CM_UNORDERED_SET<std::string>& uniqueSrcs, + std::vector<std::string>& srcs, std::unordered_set<std::string>& uniqueSrcs, cmGeneratorExpressionDAGChecker* dagChecker, std::string const& config, bool debugSources) { @@ -950,7 +950,7 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files, cmGeneratorExpressionDAGChecker dagChecker(this->GetName(), "SOURCES", CM_NULLPTR, CM_NULLPTR); - CM_UNORDERED_SET<std::string> uniqueSrcs; + std::unordered_set<std::string> uniqueSrcs; bool contextDependentDirectSources = processSources(this, this->SourceEntries, files, uniqueSrcs, &dagChecker, config, debugSources); @@ -1728,7 +1728,7 @@ class cmTargetCollectLinkLanguages public: cmTargetCollectLinkLanguages(cmGeneratorTarget const* target, const std::string& config, - CM_UNORDERED_SET<std::string>& languages, + std::unordered_set<std::string>& languages, cmGeneratorTarget const* head) : Config(config) , Languages(languages) @@ -1795,7 +1795,7 @@ public: private: std::string Config; - CM_UNORDERED_SET<std::string>& Languages; + std::unordered_set<std::string>& Languages; cmGeneratorTarget const* HeadTarget; const cmGeneratorTarget* Target; std::set<cmGeneratorTarget const*> Visited; @@ -1867,7 +1867,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc) const { // Get languages built in this target. - CM_UNORDERED_SET<std::string> languages; + std::unordered_set<std::string> languages; cmLinkImplementation const* impl = this->GetLinkImplementation(config); assert(impl); for (std::vector<std::string>::const_iterator li = impl->Languages.begin(); @@ -1884,7 +1884,7 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config, } // Store the transitive closure of languages. - for (CM_UNORDERED_SET<std::string>::const_iterator li = languages.begin(); + for (std::unordered_set<std::string>::const_iterator li = languages.begin(); li != languages.end(); ++li) { lc.Languages.push_back(*li); } @@ -1905,7 +1905,8 @@ void cmGeneratorTarget::ComputeLinkClosure(const std::string& config, } // Now consider languages that propagate from linked targets. - for (CM_UNORDERED_SET<std::string>::const_iterator sit = languages.begin(); + for (std::unordered_set<std::string>::const_iterator sit = + languages.begin(); sit != languages.end(); ++sit) { std::string propagates = "CMAKE_" + *sit + "_LINKER_PREFERENCE_PROPAGATES"; @@ -2477,7 +2478,7 @@ static void processIncludeDirectories( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, std::vector<std::string>& includes, - CM_UNORDERED_SET<std::string>& uniqueIncludes, + std::unordered_set<std::string>& uniqueIncludes, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugIncludes, const std::string& language) { @@ -2591,7 +2592,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories( const std::string& config, const std::string& lang) const { std::vector<std::string> includes; - CM_UNORDERED_SET<std::string> uniqueIncludes; + std::unordered_set<std::string> uniqueIncludes; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "INCLUDE_DIRECTORIES", CM_NULLPTR, CM_NULLPTR); @@ -2657,7 +2658,7 @@ static void processCompileOptionsInternal( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, std::vector<std::string>& options, - CM_UNORDERED_SET<std::string>& uniqueOptions, + std::unordered_set<std::string>& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, const char* logName, std::string const& language) { @@ -2695,7 +2696,7 @@ static void processCompileOptions( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, std::vector<std::string>& options, - CM_UNORDERED_SET<std::string>& uniqueOptions, + std::unordered_set<std::string>& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, std::string const& language) { @@ -2708,7 +2709,7 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result, const std::string& config, const std::string& language) const { - CM_UNORDERED_SET<std::string> uniqueOptions; + std::unordered_set<std::string> uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "COMPILE_OPTIONS", CM_NULLPTR, CM_NULLPTR); @@ -2749,7 +2750,7 @@ static void processCompileFeatures( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, std::vector<std::string>& options, - CM_UNORDERED_SET<std::string>& uniqueOptions, + std::unordered_set<std::string>& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions) { @@ -2761,7 +2762,7 @@ static void processCompileFeatures( void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result, const std::string& config) const { - CM_UNORDERED_SET<std::string> uniqueFeatures; + std::unordered_set<std::string> uniqueFeatures; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "COMPILE_FEATURES", CM_NULLPTR, CM_NULLPTR); @@ -2799,7 +2800,7 @@ static void processCompileDefinitions( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, std::vector<std::string>& options, - CM_UNORDERED_SET<std::string>& uniqueOptions, + std::unordered_set<std::string>& uniqueOptions, cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, bool debugOptions, std::string const& language) { @@ -2812,7 +2813,7 @@ void cmGeneratorTarget::GetCompileDefinitions( std::vector<std::string>& list, const std::string& config, const std::string& language) const { - CM_UNORDERED_SET<std::string> uniqueOptions; + std::unordered_set<std::string> uniqueOptions; cmGeneratorExpressionDAGChecker dagChecker( this->GetName(), "COMPILE_DEFINITIONS", CM_NULLPTR, CM_NULLPTR); @@ -4363,7 +4364,7 @@ void cmGeneratorTarget::ComputeLinkInterface( this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { // Shared libraries may have runtime implementation dependencies // on other shared libraries that are not in the interface. - CM_UNORDERED_SET<std::string> emitted; + std::unordered_set<std::string> emitted; for (std::vector<cmLinkItem>::const_iterator li = iface.Libraries.begin(); li != iface.Libraries.end(); ++li) { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 23c6218..aad6725 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -9,6 +9,7 @@ #include <map> #include <set> #include <string> +#include <unordered_map> #include <utility> #include <vector> @@ -19,7 +20,6 @@ #include "cmTarget.h" #include "cmTargetDepend.h" #include "cm_codecvt.hxx" -#include "cm_unordered_map.hxx" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmFileLockPool.h" @@ -488,9 +488,10 @@ protected: const char* GetPredefinedTargetsFolder(); private: - typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap; - typedef CM_UNORDERED_MAP<std::string, cmGeneratorTarget*> GeneratorTargetMap; - typedef CM_UNORDERED_MAP<std::string, cmMakefile*> MakefileMap; + typedef std::unordered_map<std::string, cmTarget*> TargetMap; + typedef std::unordered_map<std::string, cmGeneratorTarget*> + GeneratorTargetMap; + typedef std::unordered_map<std::string, cmMakefile*> MakefileMap; // Map efficiently from target name to cmTarget instance. // Do not use this structure for looping over all targets. // It contains both normal and globally visible imported targets. diff --git a/Source/cmInstallTargetsCommand.cxx b/Source/cmInstallTargetsCommand.cxx index e00eba0..d721ca0 100644 --- a/Source/cmInstallTargetsCommand.cxx +++ b/Source/cmInstallTargetsCommand.cxx @@ -2,12 +2,12 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmInstallTargetsCommand.h" +#include <unordered_map> #include <utility> #include "cmGlobalGenerator.h" #include "cmMakefile.h" #include "cmTarget.h" -#include "cm_unordered_map.hxx" class cmExecutionStatus; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 9083c83..aaf7d71 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -10,13 +10,13 @@ #include <map> #include <set> #include <string> +#include <unordered_map> #include <vector> #include "cmListFileCache.h" #include "cmOutputConverter.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" -#include "cm_unordered_map.hxx" #include "cmake.h" class cmComputeLinkInformation; @@ -354,7 +354,8 @@ protected: std::string::size_type ObjectPathMax; std::set<std::string> ObjectMaxPathViolations; - typedef CM_UNORDERED_MAP<std::string, cmGeneratorTarget*> GeneratorTargetMap; + typedef std::unordered_map<std::string, cmGeneratorTarget*> + GeneratorTargetMap; GeneratorTargetMap GeneratorTargetSearchIndex; std::vector<cmGeneratorTarget*> GeneratorTargets; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e65ba46..35cda6d 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -12,6 +12,7 @@ #include <stack> #include <stddef.h> #include <string> +#include <unordered_map> #include <vector> #include "cmAlgorithms.h" @@ -22,7 +23,6 @@ #include "cmStateTypes.h" #include "cmTarget.h" #include "cm_auto_ptr.hxx" -#include "cm_unordered_map.hxx" #include "cmake.h" #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -871,7 +871,7 @@ private: friend class cmParseFileScope; std::vector<cmTarget*> ImportedTargetsOwned; - typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap; + typedef std::unordered_map<std::string, cmTarget*> TargetMap; TargetMap ImportedTargets; // Internal policy stack management. @@ -909,7 +909,7 @@ private: cmSourceFile* LinearGetSourceFileWithOutput(const std::string& cname) const; // A map for fast output to input look up. - typedef CM_UNORDERED_MAP<std::string, cmSourceFile*> OutputToSourceMap; + typedef std::unordered_map<std::string, cmSourceFile*> OutputToSourceMap; OutputToSourceMap OutputToSource; void UpdateOutputToSourceMap(std::vector<std::string> const& outputs, diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx index 2339d68..93d2c14 100644 --- a/Source/cmOutputRequiredFilesCommand.cxx +++ b/Source/cmOutputRequiredFilesCommand.cxx @@ -5,6 +5,7 @@ #include "cmsys/FStream.hxx" #include "cmsys/RegularExpression.hxx" #include <map> +#include <unordered_map> #include <utility> #include "cmAlgorithms.h" @@ -13,7 +14,6 @@ #include "cmSourceFile.h" #include "cmSystemTools.h" #include "cmTarget.h" -#include "cm_unordered_map.hxx" class cmExecutionStatus; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 501aebf..a116ea3 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -9,6 +9,7 @@ #include <set> #include <sstream> #include <string.h> +#include <unordered_set> #include "cmAlgorithms.h" #include "cmGeneratorExpression.h" @@ -26,7 +27,6 @@ #include "cmStateSnapshot.h" #include "cmSystemTools.h" #include "cmTargetPropertyComputer.h" -#include "cm_unordered_set.hxx" #include "cmake.h" template <> @@ -1180,7 +1180,7 @@ const char* cmTarget::GetComputedProperty( const char* cmTarget::GetProperty(const std::string& prop) const { - static CM_UNORDERED_SET<std::string> specialProps; + static std::unordered_set<std::string> specialProps; #define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP MAKE_STATIC_PROP(LINK_LIBRARIES); MAKE_STATIC_PROP(TYPE); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 1f00c01..53fd45e 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -9,6 +9,7 @@ #include <map> #include <set> #include <string> +#include <unordered_map> #include <utility> #include <vector> @@ -19,7 +20,6 @@ #include "cmPropertyMap.h" #include "cmStateTypes.h" #include "cmTargetLinkLibraryType.h" -#include "cm_unordered_map.hxx" class cmGlobalGenerator; class cmMakefile; @@ -323,7 +323,7 @@ private: cmListFileBacktrace Backtrace; }; -typedef CM_UNORDERED_MAP<std::string, cmTarget> cmTargets; +typedef std::unordered_map<std::string, cmTarget> cmTargets; class cmTargetSet : public std::set<std::string> { diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index a57bc5a..b19b024 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -4,11 +4,11 @@ #include "cmTargetPropertyComputer.h" #include <sstream> +#include <unordered_set> #include "cmMessenger.h" #include "cmPolicies.h" #include "cmStateSnapshot.h" -#include "cm_unordered_set.hxx" #include "cmake.h" bool cmTargetPropertyComputer::HandleLocationPropertyPolicy( @@ -49,7 +49,7 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty( if (cmHasLiteralPrefix(prop, "INTERFACE_")) { return true; } - static CM_UNORDERED_SET<std::string> builtIns; + static std::unordered_set<std::string> builtIns; if (builtIns.empty()) { builtIns.insert("COMPATIBLE_INTERFACE_BOOL"); builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX"); diff --git a/Source/cm_unordered_map.hxx b/Source/cm_unordered_map.hxx deleted file mode 100644 index bf38903..0000000 --- a/Source/cm_unordered_map.hxx +++ /dev/null @@ -1,25 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef CM_UNORDERED_MAP_HXX -#define CM_UNORDERED_MAP_HXX - -#include "cmConfigure.h" - -#if defined(CMake_HAVE_CXX_UNORDERED_MAP) - -#include <unordered_map> -#define CM_UNORDERED_MAP std::unordered_map - -#elif defined(CMAKE_BUILD_WITH_CMAKE) - -#include "cmsys/hash_map.hxx" -#define CM_UNORDERED_MAP cmsys::hash_map - -#else - -#include <map> -#define CM_UNORDERED_MAP std::map - -#endif - -#endif diff --git a/Source/cm_unordered_set.hxx b/Source/cm_unordered_set.hxx deleted file mode 100644 index dd1a9a1..0000000 --- a/Source/cm_unordered_set.hxx +++ /dev/null @@ -1,25 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef CM_UNORDERED_SET_HXX -#define CM_UNORDERED_SET_HXX - -#include "cmConfigure.h" - -#if defined(CMake_HAVE_CXX_UNORDERED_SET) - -#include <unordered_set> -#define CM_UNORDERED_SET std::unordered_set - -#elif defined(CMAKE_BUILD_WITH_CMAKE) - -#include "cmsys/hash_set.hxx" -#define CM_UNORDERED_SET cmsys::hash_set - -#else - -#include <set> -#define CM_UNORDERED_SET std::set - -#endif - -#endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 6894393..4269a10 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -32,7 +32,7 @@ #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" -#include "cm_unordered_map.hxx" +#include <unordered_map> #endif // only build kdevelop generator on non-windows platforms @@ -120,7 +120,7 @@ namespace { #if defined(CMAKE_BUILD_WITH_CMAKE) -typedef CM_UNORDERED_MAP<std::string, Json::Value> JsonValueMapType; +typedef std::unordered_map<std::string, Json::Value> JsonValueMapType; #endif } // namespace diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 23ca091..349945a 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -68,18 +68,6 @@ { symbol: [ "std::__decay_and_strip<cmFindPackageCommand::PathLabel &>::__type", private, "\"cmConfigure.h\"", public ] }, { symbol: [ "std::__decay_and_strip<__gnu_cxx::__normal_iterator<const cmCTestTestHandler::cmCTestTestProperties *, std::vector<cmCTestTestHandler::cmCTestTestProperties, std::allocator<cmCTestTestHandler::cmCTestTestProperties> > > &>::__type", private, "\"cmConfigure.h\"", public ] }, - # Wrappers for headers added in TR1 / C++11 - # { include: [ "<array>", public, "\"cm_array.hxx\"", public ] }, - # { include: [ "<functional>", public, "\"cm_functional.hxx\"", public ] }, - # { include: [ "<memory>", public, "\"cm_memory.hxx\"", public ] }, - { include: [ "<unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] }, - { include: [ "<unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] }, - # { include: [ "<tr1/array>", public, "\"cm_array.hxx\"", public ] }, - # { include: [ "<tr1/functional>", public, "\"cm_functional.hxx\"", public ] }, - # { include: [ "<tr1/memory>", public, "\"cm_memory.hxx\"", public ] }, - { include: [ "<tr1/unordered_map>", public, "\"cm_unordered_map.hxx\"", public ] }, - { include: [ "<tr1/unordered_set>", public, "\"cm_unordered_set.hxx\"", public ] }, - # KWIML { include: [ "<stdint.h>", public, "\"cm_kwiml.h\"", public ] }, { include: [ "<inttypes.h>", public, "\"cm_kwiml.h\"", public ] }, @@ -88,14 +76,6 @@ { include: [ "<sys/stat.h>", public, "\"cm_sys_stat.h\"", public ] }, { symbol: [ "mode_t", private, "\"cm_sys_stat.h\"", public ] }, - # TODO: remove once TR1 / C++11 is required. - { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, - { include: [ "\"cmsys/hash_fun.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, - { include: [ "\"cmsys/hash_map.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, - { include: [ "\"cmsys/hash_set.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, - { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_map.hxx\"", public ] }, - { include: [ "\"cmsys/hashtable.hxx\"", private, "\"cm_unordered_set.hxx\"", public ] }, - # Wrappers for 3rd-party libraries used from the system. { include: [ "<archive.h>", private, "\"cm_libarchive.h\"", public ] }, { include: [ "<archive_entry.h>", private, "\"cm_libarchive.h\"", public ] }, |