summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-10 05:21:34 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:35 (GMT)
commit270eb96df05b93023cdd3d3a186b44b4ece1d655 (patch)
tree25d3037b5412b24242c631cccfe36e16a0fa8e1c /Source/cmGlobalXCodeGenerator.cxx
parent215b1addf09359507281359cd7d478c61c01a9f2 (diff)
downloadCMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.zip
CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.gz
CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.bz2
strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx82
1 files changed, 41 insertions, 41 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a1255a0..08e9adf 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -337,7 +337,7 @@ cmLocalGenerator *cmGlobalXCodeGenerator::CreateLocalGenerator()
//----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::Generate()
{
- std::map<cmStdString, std::vector<cmLocalGenerator*> >::iterator it;
+ std::map<std::string, std::vector<cmLocalGenerator*> >::iterator it;
// make sure extra targets are added before calling
// the parent generate which will call trace depends
for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it)
@@ -570,7 +570,7 @@ void cmGlobalXCodeGenerator::addObject(cmXCodeObject *obj)
{
if(obj->GetType() == cmXCodeObject::OBJECT)
{
- cmStdString id = obj->GetId();
+ std::string id = obj->GetId();
// If this is a duplicate id, it's an error:
//
@@ -631,17 +631,17 @@ cmXCodeObject* cmGlobalXCodeGenerator
}
//----------------------------------------------------------------------------
-cmStdString
+std::string
GetGroupMapKeyFromPath(cmTarget& cmtarget, const std::string& fullpath)
{
- cmStdString key(cmtarget.GetName());
+ std::string key(cmtarget.GetName());
key += "-";
key += fullpath;
return key;
}
//----------------------------------------------------------------------------
-cmStdString
+std::string
GetGroupMapKey(cmTarget& cmtarget, cmSourceFile* sf)
{
return GetGroupMapKeyFromPath(cmtarget, sf->GetFullPath());
@@ -844,7 +844,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
fileRef->SetComment(fname.c_str());
this->FileRefs[fname] = fileRef;
}
- cmStdString key = GetGroupMapKeyFromPath(cmtarget, fullpath);
+ std::string key = GetGroupMapKeyFromPath(cmtarget, fullpath);
cmXCodeObject* group = this->GroupMap[key];
cmXCodeObject* children = group->GetObject("children");
if (!children->HasObject(fileRef))
@@ -1127,7 +1127,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*> contentBuildPhases;
if (isFrameworkTarget || isBundleTarget || isCFBundleTarget)
{
- typedef std::map<cmStdString, std::vector<cmSourceFile*> >
+ typedef std::map<std::string, std::vector<cmSourceFile*> >
mapOfVectorOfSourceFiles;
mapOfVectorOfSourceFiles bundleFiles;
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
@@ -1216,7 +1216,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
void cmGlobalXCodeGenerator::ForceLinkerLanguages()
{
// This makes sure all targets link using the proper language.
- for(std::map<cmStdString, cmTarget*>::const_iterator
+ for(std::map<std::string, cmTarget*>::const_iterator
ti = this->TotalTargets.begin(); ti != this->TotalTargets.end(); ++ti)
{
this->ForceLinkerLanguage(*ti->second);
@@ -1477,7 +1477,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
// collect multiple outputs of custom commands into a set
// which will be used for every configuration
- std::map<cmStdString, cmStdString> multipleOutputPairs;
+ std::map<std::string, std::string> multipleOutputPairs;
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
{
@@ -1548,8 +1548,8 @@ void cmGlobalXCodeGenerator
std::vector<cmCustomCommand>
const & commands,
const char* configName,
- const std::map<cmStdString,
- cmStdString>& multipleOutputPairs
+ const std::map<std::string,
+ std::string>& multipleOutputPairs
)
{
std::string makefileName=makefileBasename;
@@ -1571,7 +1571,7 @@ void cmGlobalXCodeGenerator
// have all depend on all outputs
makefileStream << "all: ";
- std::map<const cmCustomCommand*, cmStdString> tname;
+ std::map<const cmCustomCommand*, std::string> tname;
int count = 0;
for(std::vector<cmCustomCommand>::const_iterator i = commands.begin();
i != commands.end(); ++i)
@@ -1669,7 +1669,7 @@ void cmGlobalXCodeGenerator
makefileStream <<
"\n# Dependencies of multiple outputs to their primary outputs \n";
- for(std::map<cmStdString, cmStdString>::const_iterator o =
+ for(std::map<std::string, std::string>::const_iterator o =
multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
{
makefileStream << o->first << ": " << o->second << "\n";
@@ -1678,7 +1678,7 @@ void cmGlobalXCodeGenerator
makefileStream <<
"\n"
"cmake_check_multiple_outputs:\n";
- for(std::map<cmStdString, cmStdString>::const_iterator o =
+ for(std::map<std::string, std::string>::const_iterator o =
multipleOutputPairs.begin(); o != multipleOutputPairs.end(); ++o)
{
makefileStream << "\t@if [ ! -f "
@@ -2088,7 +2088,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::vector<std::string> includes;
this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt,
"C", configName);
- std::set<cmStdString> emitted;
+ std::set<std::string> emitted;
emitted.insert("/System/Library/Frameworks");
for(std::vector<std::string>::iterator i = includes.begin();
i != includes.end(); ++i)
@@ -2357,18 +2357,18 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{
if(i->first.find("XCODE_ATTRIBUTE_") == 0)
{
- cmStdString attribute = i->first.substr(16);
+ std::string attribute = i->first.substr(16);
// Handle [variant=<config>] condition explicitly here.
- cmStdString::size_type beginVariant =
+ std::string::size_type beginVariant =
attribute.find("[variant=");
- if (beginVariant != cmStdString::npos)
+ if (beginVariant != std::string::npos)
{
- cmStdString::size_type endVariant =
+ std::string::size_type endVariant =
attribute.find("]", beginVariant+9);
- if (endVariant != cmStdString::npos)
+ if (endVariant != std::string::npos)
{
// Compare the variant to the configuration.
- cmStdString variant =
+ std::string variant =
attribute.substr(beginVariant+9, endVariant-beginVariant-9);
if (variant == configName)
{
@@ -2969,7 +2969,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
mf->FindSourceGroup(source.c_str(), sourceGroups);
cmXCodeObject* pbxgroup =
this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
- cmStdString key = GetGroupMapKey(cmtarget, sf);
+ std::string key = GetGroupMapKey(cmtarget, sf);
this->GroupMap[key] = pbxgroup;
}
@@ -2984,7 +2984,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
mf->FindSourceGroup(source.c_str(), sourceGroups);
cmXCodeObject* pbxgroup =
this->CreateOrGetPBXGroup(cmtarget, sourceGroup);
- cmStdString key = GetGroupMapKeyFromPath(cmtarget, source);
+ std::string key = GetGroupMapKeyFromPath(cmtarget, source);
this->GroupMap[key] = pbxgroup;
}
}
@@ -2992,7 +2992,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
}
cmXCodeObject *cmGlobalXCodeGenerator
-::CreatePBXGroup(cmXCodeObject *parent, cmStdString name)
+::CreatePBXGroup(cmXCodeObject *parent, std::string name)
{
cmXCodeObject* parentChildren = NULL;
if(parent)
@@ -3016,8 +3016,8 @@ cmXCodeObject *cmGlobalXCodeGenerator
cmXCodeObject* cmGlobalXCodeGenerator
::CreateOrGetPBXGroup(cmTarget& cmtarget, cmSourceGroup* sg)
{
- cmStdString s;
- cmStdString target;
+ std::string s;
+ std::string target;
const char *targetFolder= cmtarget.GetProperty("FOLDER");
if(targetFolder) {
target = targetFolder;
@@ -3026,7 +3026,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
target += cmtarget.GetName();
s = target + "/";
s += sg->GetFullName();
- std::map<cmStdString, cmXCodeObject* >::iterator it =
+ std::map<std::string, cmXCodeObject* >::iterator it =
this->GroupNameMap.find(s);
if(it != this->GroupNameMap.end())
{
@@ -3043,7 +3043,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
{
std::vector<std::string> tgt_folders =
cmSystemTools::tokenize(target, "/");
- cmStdString curr_tgt_folder;
+ std::string curr_tgt_folder;
for(std::vector<std::string>::size_type i = 0; i < tgt_folders.size();i++)
{
if (i != 0)
@@ -3070,7 +3070,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
// If it's the default source group (empty name) then put the source file
// directly in the tgroup...
//
- if (cmStdString(sg->GetFullName()) == "")
+ if (std::string(sg->GetFullName()) == "")
{
this->GroupNameMap[s] = tgroup;
return tgroup;
@@ -3081,12 +3081,12 @@ cmXCodeObject* cmGlobalXCodeGenerator
{
std::vector<std::string> folders =
cmSystemTools::tokenize(sg->GetFullName(), "\\");
- cmStdString curr_folder = target;
+ std::string curr_folder = target;
curr_folder += "/";
for(std::vector<std::string>::size_type i = 0; i < folders.size();i++)
{
curr_folder += folders[i];
- std::map<cmStdString, cmXCodeObject* >::iterator i_folder =
+ std::map<std::string, cmXCodeObject* >::iterator i_folder =
this->GroupNameMap.find(curr_folder);
//Create new folder
if(i_folder == this->GroupNameMap.end())
@@ -3466,14 +3466,14 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
makefileStream
<< "# For each target create a dummy rule "
"so the target does not have to exist\n";
- std::set<cmStdString> emitted;
+ std::set<std::string> emitted;
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
i != targets.end(); ++i)
{
cmXCodeObject* target = *i;
- std::map<cmStdString, cmXCodeObject::StringVec> const& deplibs =
+ std::map<std::string, cmXCodeObject::StringVec> const& deplibs =
target->GetDependLibraries();
- for(std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator ci
+ for(std::map<std::string, cmXCodeObject::StringVec>::const_iterator ci
= deplibs.begin(); ci != deplibs.end(); ++ci)
{
for(cmXCodeObject::StringVec::const_iterator d = ci->second.begin();
@@ -3529,12 +3529,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
std::string trel = this->ConvertToRelativeForMake(tfull.c_str());
// Add this target to the post-build phases of its dependencies.
- std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator
+ std::map<std::string, cmXCodeObject::StringVec>::const_iterator
y = target->GetDependTargets().find(*ct);
if(y != target->GetDependTargets().end())
{
- std::vector<cmStdString> const& deptgts = y->second;
- for(std::vector<cmStdString>::const_iterator d = deptgts.begin();
+ std::vector<std::string> const& deptgts = y->second;
+ for(std::vector<std::string>::const_iterator d = deptgts.begin();
d != deptgts.end(); ++d)
{
makefileStream << this->PostBuildMakeTarget(*d, *ct) << ": "
@@ -3546,12 +3546,12 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
makefileStream << trel << ":";
// List dependencies if any exist.
- std::map<cmStdString, cmXCodeObject::StringVec>::const_iterator
+ std::map<std::string, cmXCodeObject::StringVec>::const_iterator
x = target->GetDependLibraries().find(*ct);
if(x != target->GetDependLibraries().end())
{
- std::vector<cmStdString> const& deplibs = x->second;
- for(std::vector<cmStdString>::const_iterator d = deplibs.begin();
+ std::vector<std::string> const& deplibs = x->second;
+ for(std::vector<std::string>::const_iterator d = deplibs.begin();
d != deplibs.end(); ++d)
{
makefileStream << "\\\n\t" <<
@@ -3960,7 +3960,7 @@ cmGlobalXCodeGenerator
// names since Xcode names them uniquely automatically with a numeric suffix
// to avoid exact duplicate file names. Note that Mac file names are not
// typically case sensitive, hence the LowerCase.
- std::map<cmStdString, int> counts;
+ std::map<std::string, int> counts;
std::vector<cmSourceFile*> objectSources;
gt->GetObjectSources(objectSources);
for(std::vector<cmSourceFile*>::const_iterator