From ddd5a7d7290390771dbe8d41ea9ef737ce4d0c62 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 22 Aug 2001 11:58:17 -0400 Subject: ENH: change all maps of string to be maps of cmStdString, to reduce symbol length in object files. --- Source/cmCableClassSet.h | 2 +- Source/cmCableWrapTclCommand.cxx | 4 ++-- Source/cmCacheManager.cxx | 8 ++++---- Source/cmCacheManager.h | 2 +- Source/cmMakeDepend.h | 2 +- Source/cmMakefile.h | 15 ++++++++------- Source/cmSourceGroup.h | 4 ++-- Source/cmStandardIncludes.h | 12 ++++++++++++ Source/cmTarget.h | 2 +- Source/cmUnixMakefileGenerator.cxx | 14 +++++++------- 10 files changed, 39 insertions(+), 26 deletions(-) diff --git a/Source/cmCableClassSet.h b/Source/cmCableClassSet.h index a21fa83..3ecb4ca 100644 --- a/Source/cmCableClassSet.h +++ b/Source/cmCableClassSet.h @@ -90,7 +90,7 @@ public: * The set is stored internally as a map from class name to cmCableClass * instance. */ - typedef std::map CableClassMap; + typedef std::map CableClassMap; void AddClass(const char*, cmCableClass*); void AddSource(const char* name); diff --git a/Source/cmCableWrapTclCommand.cxx b/Source/cmCableWrapTclCommand.cxx index b77825f..720fa07 100644 --- a/Source/cmCableWrapTclCommand.cxx +++ b/Source/cmCableWrapTclCommand.cxx @@ -119,7 +119,7 @@ void cmCableWrapTclCommand::GenerateCableFiles() const // use the tags to make easy-to-read, unique file names for each // class's wrapper. Count the number of times each tag is used. // Warn if a tag is used more than once. - std::map tagCounts; + std::map tagCounts; for(cmCableClassSet::CableClassMap::const_iterator c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c) { @@ -146,7 +146,7 @@ void cmCableWrapTclCommand::GenerateCableFiles() const // Write out the cable configuration files with one class per group. // Try to name the groups based on their class's tag, but use an // index to disambiguate tag repeats (mostly used for empty tags). - std::map tagIndexes; + std::map tagIndexes; for(cmCableClassSet::CableClassMap::const_iterator c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c) { diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 46e0ea2..3adb3c8 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -239,7 +239,7 @@ void cmCacheManager::DefineCache(cmMakefile *mf) } // add definition to the makefile - for( std::map::const_iterator i = m_Cache.begin(); + for( std::map::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -293,7 +293,7 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map::const_iterator i = m_Cache.begin(); + for( std::map::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -326,7 +326,7 @@ bool cmCacheManager::SaveCache(const char* path) fout << "########################\n"; fout << "\n"; - for( std::map::const_iterator i = m_Cache.begin(); + for( std::map::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { const CacheEntry& ce = (*i).second; @@ -423,7 +423,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const { out << "=================================================" << std::endl; out << "CMakeCache Contents:" << std::endl; - for(std::map::const_iterator i = m_Cache.begin(); + for(std::map::const_iterator i = m_Cache.begin(); i != m_Cache.end(); ++i) { if((*i).second.m_Type != INTERNAL) diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index d1b6c21..59e776c 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -61,7 +61,7 @@ public: CacheEntryType m_Type; }; public: - typedef std::map CacheEntryMap; + typedef std::map CacheEntryMap; /** * Types for the cache entries. These are useful as * hints for a cache editor program. Path should bring diff --git a/Source/cmMakeDepend.h b/Source/cmMakeDepend.h index fabb47f..27853b2 100644 --- a/Source/cmMakeDepend.h +++ b/Source/cmMakeDepend.h @@ -177,7 +177,7 @@ protected: cmRegularExpression m_IncludeFileRegularExpression; cmRegularExpression m_ComplainFileRegularExpression; std::vector m_IncludeDirectories; - typedef std::map DependInformationMap; + typedef std::map DependInformationMap; DependInformationMap m_DependInformationMap; }; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index d55e8c2..c5363d6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -397,7 +397,7 @@ public: /** * Get the subdirectory dependencies for the given subdirectory. */ - const std::set& GetSubdirDepends(const char* subdir) + const std::set& GetSubdirDepends(const char* subdir) { return m_SubdirDepends[subdir]; } @@ -425,7 +425,7 @@ public: /** * Return a list of source files in this makefile. */ - typedef std::map > SourceMap; + typedef std::map > SourceMap; const SourceMap &GetSources() const {return m_Sources;} SourceMap &GetSources() {return m_Sources;} cmSourceFile *GetSource(const char *srclist, const char *sourceName); @@ -552,10 +552,11 @@ protected: SourceMap m_Sources; std::vector m_SubDirectories; // list of sub directories - struct StringSet : public std::set + struct StringSet : public std::set { }; - std::map m_SubdirDepends; + + std::map m_SubdirDepends; // The include and link-library paths. These may have order // dependency, so they must be vectors (not set). @@ -573,8 +574,8 @@ protected: std::vector m_HeaderFileExtensions; std::string m_DefineFlags; std::vector m_SourceGroups; - typedef std::map RegisteredCommandsMap; - typedef std::map DefinitionMap; + typedef std::map RegisteredCommandsMap; + typedef std::map DefinitionMap; DefinitionMap m_Definitions; RegisteredCommandsMap m_Commands; std::vector m_UsedCommands; @@ -596,7 +597,7 @@ private: void AddDefaultDefinitions(); std::set m_FunctionBlockers; - typedef std::map DataMap; + typedef std::map DataMap; DataMap m_DataMap; bool m_Inheriting; }; diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h index 86a7b19..d5627ee 100644 --- a/Source/cmSourceGroup.h +++ b/Source/cmSourceGroup.h @@ -74,12 +74,12 @@ public: /** * Map from command to its output/depends sets. */ - typedef std::map Commands; + typedef std::map Commands; /** * Map from source to command map. */ - typedef std::map BuildRules; + typedef std::map BuildRules; bool Matches(const char* name); void SetGroupRegex(const char* regex) diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 70c280a..ffae33a 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -131,4 +131,16 @@ inline bool operator==(std::string const& a, const char* b) { return (a==std::string(b)); } # endif // end CM_SGI_CC_720 + +struct cmStdString : public std::string +{ + typedef std::string Parent; + cmStdString(const char* s) : Parent(s) + { + } + cmStdString(std::string const&s) : Parent(s) + { + } +}; + #endif diff --git a/Source/cmTarget.h b/Source/cmTarget.h index e7946a6..d556fbc 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -139,6 +139,6 @@ private: std::set m_Utilities; }; -typedef std::map cmTargets; +typedef std::map cmTargets; #endif diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index ad6b774..9df4254 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -730,8 +730,8 @@ OutputSubDirectoryVars(std::ostream& fout, { std::string subdir = FixDirectoryName(SubDirectories[i].c_str()); fout << target << "_" << subdir.c_str() << ":"; - const std::set& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str()); - for(std::set::const_iterator d = subdirDepends.begin(); + const std::set& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str()); + for(std::set::const_iterator d = subdirDepends.begin(); d != subdirDepends.end(); ++d) { std::string fixed_d = FixDirectoryName(d->c_str()); @@ -792,8 +792,8 @@ void cmUnixMakefileGenerator::OutputSubDirectoryRules(std::ostream& fout) void cmUnixMakefileGenerator::OutputObjectDepends(std::ostream& fout) { // Iterate over every target. - std::map& targets = m_Makefile->GetTargets(); - for(std::map::const_iterator target = targets.begin(); + std::map& targets = m_Makefile->GetTargets(); + for(std::map::const_iterator target = targets.begin(); target != targets.end(); ++target) { // Iterate over every source for this target. @@ -1196,7 +1196,7 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) // see if there is already a target for a cmake executable in this // makefile bool buildingCMake = false; - std::map& targets = m_Makefile->GetTargets(); + std::map& targets = m_Makefile->GetTargets(); for(cmTargets::const_iterator l = targets.begin(); l != targets.end(); l++) { @@ -1229,8 +1229,8 @@ void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout) std::set rules; // Iterate over every target. - std::map& targets = m_Makefile->GetTargets(); - for(std::map::const_iterator target = targets.begin(); + std::map& targets = m_Makefile->GetTargets(); + for(std::map::const_iterator target = targets.begin(); target != targets.end(); ++target) { bool shared = (target->second.GetType() == cmTarget::SHARED_LIBRARY); -- cgit v0.12