diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-18 08:52:09 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-22 18:25:48 (GMT) |
commit | 8d336875b3cea99e5c458d3e299d8caf8bc84b75 (patch) | |
tree | f6f861a28e22c7bbe068b9004ac924be1ca4d842 /Source | |
parent | 514a1dff5b532c94dca2f77ed6d8742f45c48ddc (diff) | |
download | CMake-8d336875b3cea99e5c458d3e299d8caf8bc84b75.zip CMake-8d336875b3cea99e5c458d3e299d8caf8bc84b75.tar.gz CMake-8d336875b3cea99e5c458d3e299d8caf8bc84b75.tar.bz2 |
cmMakefile: Use Ranges for buildsystem property access.
Don't return vector copies.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 28 | ||||
-rw-r--r-- | Source/cmMakefile.h | 13 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 15 |
4 files changed, 30 insertions, 34 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 2c5ed4f..40a8586 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1417,9 +1417,9 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() { cmMakefile *mf = this->LocalGenerators[i]->GetMakefile(); - const std::vector<std::string> noconfig_compile_definitions = + const cmStringRange noconfig_compile_definitions = mf->GetCompileDefinitionsEntries(); - const std::vector<cmListFileBacktrace> noconfig_compile_definitions_bts = + const cmBacktraceRange noconfig_compile_definitions_bts = mf->GetCompileDefinitionsBacktraces(); cmTargets& targets = mf->GetTargets(); @@ -1435,9 +1435,9 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo() continue; } - std::vector<cmListFileBacktrace>::const_iterator btIt + cmBacktraceRange::const_iterator btIt = noconfig_compile_definitions_bts.begin(); - for (std::vector<std::string>::const_iterator it + for (cmStringRange::const_iterator it = noconfig_compile_definitions.begin(); it != noconfig_compile_definitions.end(); ++it, ++btIt) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 58d9d73..81c8831 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -273,38 +273,34 @@ void cmMakefile::IssueMessage(cmake::MessageType t, } } -std::vector<std::string> cmMakefile::GetIncludeDirectoriesEntries() const +cmStringRange cmMakefile::GetIncludeDirectoriesEntries() const { - return this->IncludeDirectoriesEntries; + return cmMakeRange(this->IncludeDirectoriesEntries); } -std::vector<cmListFileBacktrace> -cmMakefile::GetIncludeDirectoriesBacktraces() const +cmBacktraceRange cmMakefile::GetIncludeDirectoriesBacktraces() const { - return this->IncludeDirectoriesEntryBacktraces; + return cmMakeRange(this->IncludeDirectoriesEntryBacktraces); } - -std::vector<std::string> cmMakefile::GetCompileOptionsEntries() const +cmStringRange cmMakefile::GetCompileOptionsEntries() const { - return this->CompileOptionsEntries; + return cmMakeRange(this->CompileOptionsEntries); } -std::vector<cmListFileBacktrace> -cmMakefile::GetCompileOptionsBacktraces() const +cmBacktraceRange cmMakefile::GetCompileOptionsBacktraces() const { - return this->CompileOptionsEntryBacktraces; + return cmMakeRange(this->CompileOptionsEntryBacktraces); } -std::vector<std::string> cmMakefile::GetCompileDefinitionsEntries() const +cmStringRange cmMakefile::GetCompileDefinitionsEntries() const { - return this->CompileDefinitionsEntries; + return cmMakeRange(this->CompileDefinitionsEntries); } -std::vector<cmListFileBacktrace> -cmMakefile::GetCompileDefinitionsBacktraces() const +cmBacktraceRange cmMakefile::GetCompileDefinitionsBacktraces() const { - return this->CompileDefinitionsEntryBacktraces; + return cmMakeRange(this->CompileDefinitionsEntryBacktraces); } //---------------------------------------------------------------------------- diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8f236af..27911a9 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -22,6 +22,7 @@ #include "cmExpandedCommandArgument.h" #include "cmake.h" #include "cmState.h" +#include "cmAlgorithms.h" #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmSourceGroup.h" @@ -746,12 +747,12 @@ public: /** Set whether or not to report a CMP0000 violation. */ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; } - std::vector<std::string> GetIncludeDirectoriesEntries() const; - std::vector<cmListFileBacktrace> GetIncludeDirectoriesBacktraces() const; - std::vector<std::string> GetCompileOptionsEntries() const; - std::vector<cmListFileBacktrace> GetCompileOptionsBacktraces() const; - std::vector<std::string> GetCompileDefinitionsEntries() const; - std::vector<cmListFileBacktrace> GetCompileDefinitionsBacktraces() const; + cmStringRange GetIncludeDirectoriesEntries() const; + cmBacktraceRange GetIncludeDirectoriesBacktraces() const; + cmStringRange GetCompileOptionsEntries() const; + cmBacktraceRange GetCompileOptionsBacktraces() const; + cmStringRange GetCompileDefinitionsEntries() const; + cmBacktraceRange GetCompileDefinitionsBacktraces() const; bool IsConfigured() const { return this->Configured; } void SetConfigured(){ this->Configured = true; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ac453e2..22114fd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -402,14 +402,13 @@ void cmTarget::SetMakefile(cmMakefile* mf) { // Initialize the INCLUDE_DIRECTORIES property based on the current value // of the same directory property: - const std::vector<std::string> parentIncludes = + const cmStringRange parentIncludes = this->Makefile->GetIncludeDirectoriesEntries(); - const std::vector<cmListFileBacktrace> parentIncludesBts = + const cmBacktraceRange parentIncludesBts = this->Makefile->GetIncludeDirectoriesBacktraces(); - std::vector<cmListFileBacktrace>::const_iterator btIt = - parentIncludesBts.begin(); - for (std::vector<std::string>::const_iterator it + cmBacktraceRange::const_iterator btIt = parentIncludesBts.begin(); + for (cmStringRange::const_iterator it = parentIncludes.begin(); it != parentIncludes.end(); ++it, ++btIt) { @@ -421,13 +420,13 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(), parentSystemIncludes.end()); - const std::vector<std::string> parentOptions = + const cmStringRange parentOptions = this->Makefile->GetCompileOptionsEntries(); - const std::vector<cmListFileBacktrace> parentOptionsBts = + const cmBacktraceRange parentOptionsBts = this->Makefile->GetCompileOptionsBacktraces(); btIt = parentOptionsBts.begin(); - for (std::vector<std::string>::const_iterator it + for (cmStringRange::const_iterator it = parentOptions.begin(); it != parentOptions.end(); ++it, ++btIt) { |