ENH: change all maps of string to be maps of cmStdString, to reduce symbol length in object files.
This commit is contained in:
parent
032106c337
commit
ddd5a7d729
@ -90,7 +90,7 @@ public:
|
|||||||
* The set is stored internally as a map from class name to cmCableClass
|
* The set is stored internally as a map from class name to cmCableClass
|
||||||
* instance.
|
* instance.
|
||||||
*/
|
*/
|
||||||
typedef std::map<std::string, cmCableClass*> CableClassMap;
|
typedef std::map<cmStdString, cmCableClass*> CableClassMap;
|
||||||
|
|
||||||
void AddClass(const char*, cmCableClass*);
|
void AddClass(const char*, cmCableClass*);
|
||||||
void AddSource(const char* name);
|
void AddSource(const char* name);
|
||||||
|
@ -119,7 +119,7 @@ void cmCableWrapTclCommand::GenerateCableFiles() const
|
|||||||
// use the tags to make easy-to-read, unique file names for each
|
// 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.
|
// class's wrapper. Count the number of times each tag is used.
|
||||||
// Warn if a tag is used more than once.
|
// Warn if a tag is used more than once.
|
||||||
std::map<std::string, unsigned int> tagCounts;
|
std::map<cmStdString, unsigned int> tagCounts;
|
||||||
for(cmCableClassSet::CableClassMap::const_iterator
|
for(cmCableClassSet::CableClassMap::const_iterator
|
||||||
c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c)
|
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.
|
// 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
|
// Try to name the groups based on their class's tag, but use an
|
||||||
// index to disambiguate tag repeats (mostly used for empty tags).
|
// index to disambiguate tag repeats (mostly used for empty tags).
|
||||||
std::map<std::string, unsigned int> tagIndexes;
|
std::map<cmStdString, unsigned int> tagIndexes;
|
||||||
for(cmCableClassSet::CableClassMap::const_iterator
|
for(cmCableClassSet::CableClassMap::const_iterator
|
||||||
c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c)
|
c = m_CableClassSet->Begin(); c != m_CableClassSet->End(); ++c)
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,7 @@ void cmCacheManager::DefineCache(cmMakefile *mf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add definition to the makefile
|
// add definition to the makefile
|
||||||
for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin();
|
for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
|
||||||
i != m_Cache.end(); ++i)
|
i != m_Cache.end(); ++i)
|
||||||
{
|
{
|
||||||
const CacheEntry& ce = (*i).second;
|
const CacheEntry& ce = (*i).second;
|
||||||
@ -293,7 +293,7 @@ bool cmCacheManager::SaveCache(const char* path)
|
|||||||
fout << "########################\n";
|
fout << "########################\n";
|
||||||
fout << "\n";
|
fout << "\n";
|
||||||
|
|
||||||
for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin();
|
for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
|
||||||
i != m_Cache.end(); ++i)
|
i != m_Cache.end(); ++i)
|
||||||
{
|
{
|
||||||
const CacheEntry& ce = (*i).second;
|
const CacheEntry& ce = (*i).second;
|
||||||
@ -326,7 +326,7 @@ bool cmCacheManager::SaveCache(const char* path)
|
|||||||
fout << "########################\n";
|
fout << "########################\n";
|
||||||
fout << "\n";
|
fout << "\n";
|
||||||
|
|
||||||
for( std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin();
|
for( std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
|
||||||
i != m_Cache.end(); ++i)
|
i != m_Cache.end(); ++i)
|
||||||
{
|
{
|
||||||
const CacheEntry& ce = (*i).second;
|
const CacheEntry& ce = (*i).second;
|
||||||
@ -423,7 +423,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
|
|||||||
{
|
{
|
||||||
out << "=================================================" << std::endl;
|
out << "=================================================" << std::endl;
|
||||||
out << "CMakeCache Contents:" << std::endl;
|
out << "CMakeCache Contents:" << std::endl;
|
||||||
for(std::map<std::string, CacheEntry>::const_iterator i = m_Cache.begin();
|
for(std::map<cmStdString, CacheEntry>::const_iterator i = m_Cache.begin();
|
||||||
i != m_Cache.end(); ++i)
|
i != m_Cache.end(); ++i)
|
||||||
{
|
{
|
||||||
if((*i).second.m_Type != INTERNAL)
|
if((*i).second.m_Type != INTERNAL)
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
CacheEntryType m_Type;
|
CacheEntryType m_Type;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
typedef std::map<std::string, CacheEntry> CacheEntryMap;
|
typedef std::map<cmStdString, CacheEntry> CacheEntryMap;
|
||||||
/**
|
/**
|
||||||
* Types for the cache entries. These are useful as
|
* Types for the cache entries. These are useful as
|
||||||
* hints for a cache editor program. Path should bring
|
* hints for a cache editor program. Path should bring
|
||||||
|
@ -177,7 +177,7 @@ protected:
|
|||||||
cmRegularExpression m_IncludeFileRegularExpression;
|
cmRegularExpression m_IncludeFileRegularExpression;
|
||||||
cmRegularExpression m_ComplainFileRegularExpression;
|
cmRegularExpression m_ComplainFileRegularExpression;
|
||||||
std::vector<std::string> m_IncludeDirectories;
|
std::vector<std::string> m_IncludeDirectories;
|
||||||
typedef std::map<std::string, cmDependInformation*> DependInformationMap;
|
typedef std::map<cmStdString, cmDependInformation*> DependInformationMap;
|
||||||
DependInformationMap m_DependInformationMap;
|
DependInformationMap m_DependInformationMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get the subdirectory dependencies for the given subdirectory.
|
* Get the subdirectory dependencies for the given subdirectory.
|
||||||
*/
|
*/
|
||||||
const std::set<std::string>& GetSubdirDepends(const char* subdir)
|
const std::set<cmStdString>& GetSubdirDepends(const char* subdir)
|
||||||
{
|
{
|
||||||
return m_SubdirDepends[subdir];
|
return m_SubdirDepends[subdir];
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Return a list of source files in this makefile.
|
* Return a list of source files in this makefile.
|
||||||
*/
|
*/
|
||||||
typedef std::map<std::string,std::vector<cmSourceFile> > SourceMap;
|
typedef std::map<cmStdString,std::vector<cmSourceFile> > SourceMap;
|
||||||
const SourceMap &GetSources() const {return m_Sources;}
|
const SourceMap &GetSources() const {return m_Sources;}
|
||||||
SourceMap &GetSources() {return m_Sources;}
|
SourceMap &GetSources() {return m_Sources;}
|
||||||
cmSourceFile *GetSource(const char *srclist, const char *sourceName);
|
cmSourceFile *GetSource(const char *srclist, const char *sourceName);
|
||||||
@ -552,10 +552,11 @@ protected:
|
|||||||
SourceMap m_Sources;
|
SourceMap m_Sources;
|
||||||
|
|
||||||
std::vector<std::string> m_SubDirectories; // list of sub directories
|
std::vector<std::string> m_SubDirectories; // list of sub directories
|
||||||
struct StringSet : public std::set<std::string>
|
struct StringSet : public std::set<cmStdString>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
std::map<std::string, StringSet > m_SubdirDepends;
|
|
||||||
|
std::map<cmStdString, StringSet > m_SubdirDepends;
|
||||||
|
|
||||||
// The include and link-library paths. These may have order
|
// The include and link-library paths. These may have order
|
||||||
// dependency, so they must be vectors (not set).
|
// dependency, so they must be vectors (not set).
|
||||||
@ -573,8 +574,8 @@ protected:
|
|||||||
std::vector<std::string> m_HeaderFileExtensions;
|
std::vector<std::string> m_HeaderFileExtensions;
|
||||||
std::string m_DefineFlags;
|
std::string m_DefineFlags;
|
||||||
std::vector<cmSourceGroup> m_SourceGroups;
|
std::vector<cmSourceGroup> m_SourceGroups;
|
||||||
typedef std::map<std::string, cmCommand*> RegisteredCommandsMap;
|
typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
|
||||||
typedef std::map<std::string, std::string> DefinitionMap;
|
typedef std::map<cmStdString, cmStdString> DefinitionMap;
|
||||||
DefinitionMap m_Definitions;
|
DefinitionMap m_Definitions;
|
||||||
RegisteredCommandsMap m_Commands;
|
RegisteredCommandsMap m_Commands;
|
||||||
std::vector<cmCommand*> m_UsedCommands;
|
std::vector<cmCommand*> m_UsedCommands;
|
||||||
@ -596,7 +597,7 @@ private:
|
|||||||
void AddDefaultDefinitions();
|
void AddDefaultDefinitions();
|
||||||
std::set<cmFunctionBlocker *> m_FunctionBlockers;
|
std::set<cmFunctionBlocker *> m_FunctionBlockers;
|
||||||
|
|
||||||
typedef std::map<std::string, cmData*> DataMap;
|
typedef std::map<cmStdString, cmData*> DataMap;
|
||||||
DataMap m_DataMap;
|
DataMap m_DataMap;
|
||||||
bool m_Inheriting;
|
bool m_Inheriting;
|
||||||
};
|
};
|
||||||
|
@ -74,12 +74,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Map from command to its output/depends sets.
|
* Map from command to its output/depends sets.
|
||||||
*/
|
*/
|
||||||
typedef std::map<std::string, CommandFiles> Commands;
|
typedef std::map<cmStdString, CommandFiles> Commands;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map from source to command map.
|
* Map from source to command map.
|
||||||
*/
|
*/
|
||||||
typedef std::map<std::string, Commands> BuildRules;
|
typedef std::map<cmStdString, Commands> BuildRules;
|
||||||
|
|
||||||
bool Matches(const char* name);
|
bool Matches(const char* name);
|
||||||
void SetGroupRegex(const char* regex)
|
void SetGroupRegex(const char* regex)
|
||||||
|
@ -131,4 +131,16 @@ inline bool operator==(std::string const& a, const char* b)
|
|||||||
{ return (a==std::string(b)); }
|
{ return (a==std::string(b)); }
|
||||||
# endif // end CM_SGI_CC_720
|
# 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
|
#endif
|
||||||
|
@ -139,6 +139,6 @@ private:
|
|||||||
std::set<std::string> m_Utilities;
|
std::set<std::string> m_Utilities;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::map<std::string,cmTarget> cmTargets;
|
typedef std::map<cmStdString,cmTarget> cmTargets;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -730,8 +730,8 @@ OutputSubDirectoryVars(std::ostream& fout,
|
|||||||
{
|
{
|
||||||
std::string subdir = FixDirectoryName(SubDirectories[i].c_str());
|
std::string subdir = FixDirectoryName(SubDirectories[i].c_str());
|
||||||
fout << target << "_" << subdir.c_str() << ":";
|
fout << target << "_" << subdir.c_str() << ":";
|
||||||
const std::set<std::string>& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str());
|
const std::set<cmStdString>& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str());
|
||||||
for(std::set<std::string>::const_iterator d = subdirDepends.begin();
|
for(std::set<cmStdString>::const_iterator d = subdirDepends.begin();
|
||||||
d != subdirDepends.end(); ++d)
|
d != subdirDepends.end(); ++d)
|
||||||
{
|
{
|
||||||
std::string fixed_d = FixDirectoryName(d->c_str());
|
std::string fixed_d = FixDirectoryName(d->c_str());
|
||||||
@ -792,8 +792,8 @@ void cmUnixMakefileGenerator::OutputSubDirectoryRules(std::ostream& fout)
|
|||||||
void cmUnixMakefileGenerator::OutputObjectDepends(std::ostream& fout)
|
void cmUnixMakefileGenerator::OutputObjectDepends(std::ostream& fout)
|
||||||
{
|
{
|
||||||
// Iterate over every target.
|
// Iterate over every target.
|
||||||
std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets();
|
std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets();
|
||||||
for(std::map<std::string, cmTarget>::const_iterator target = targets.begin();
|
for(std::map<cmStdString, cmTarget>::const_iterator target = targets.begin();
|
||||||
target != targets.end(); ++target)
|
target != targets.end(); ++target)
|
||||||
{
|
{
|
||||||
// Iterate over every source for this 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
|
// see if there is already a target for a cmake executable in this
|
||||||
// makefile
|
// makefile
|
||||||
bool buildingCMake = false;
|
bool buildingCMake = false;
|
||||||
std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets();
|
std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets();
|
||||||
for(cmTargets::const_iterator l = targets.begin();
|
for(cmTargets::const_iterator l = targets.begin();
|
||||||
l != targets.end(); l++)
|
l != targets.end(); l++)
|
||||||
{
|
{
|
||||||
@ -1229,8 +1229,8 @@ void cmUnixMakefileGenerator::OutputSourceObjectBuildRules(std::ostream& fout)
|
|||||||
std::set<std::string> rules;
|
std::set<std::string> rules;
|
||||||
|
|
||||||
// Iterate over every target.
|
// Iterate over every target.
|
||||||
std::map<std::string, cmTarget>& targets = m_Makefile->GetTargets();
|
std::map<cmStdString, cmTarget>& targets = m_Makefile->GetTargets();
|
||||||
for(std::map<std::string, cmTarget>::const_iterator target = targets.begin();
|
for(std::map<cmStdString, cmTarget>::const_iterator target = targets.begin();
|
||||||
target != targets.end(); ++target)
|
target != targets.end(); ++target)
|
||||||
{
|
{
|
||||||
bool shared = (target->second.GetType() == cmTarget::SHARED_LIBRARY);
|
bool shared = (target->second.GetType() == cmTarget::SHARED_LIBRARY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user