diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-06-02 19:01:01 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-06-03 22:48:21 (GMT) |
commit | b1ec5deaf15be459658b8fb0392e4d4a4ec1a0dd (patch) | |
tree | 3954dea8257e82f7be83a53519c43a7e9418526c /Source | |
parent | 3216c2178cfcc75d48f383a76ccff4aa052b5fdc (diff) | |
download | CMake-b1ec5deaf15be459658b8fb0392e4d4a4ec1a0dd.zip CMake-b1ec5deaf15be459658b8fb0392e4d4a4ec1a0dd.tar.gz CMake-b1ec5deaf15be459658b8fb0392e4d4a4ec1a0dd.tar.bz2 |
Pass large types by const&, small types by value
Diffstat (limited to 'Source')
37 files changed, 82 insertions, 80 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 224cf47..0b025ab 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -205,8 +205,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey, return false; } -void cmCacheManager::WritePropertyEntries(std::ostream& os, - CacheIterator const& i) +void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i) { for (const char** p = this->PersistentProperties; *p; ++p) { if (const char* value = i.GetProperty(*p)) { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index a72d6cb..c464311 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -228,7 +228,7 @@ private: static const char* PersistentProperties[]; bool ReadPropertyEntry(std::string const& key, CacheEntry& e); - void WritePropertyEntries(std::ostream& os, CacheIterator const& i); + void WritePropertyEntries(std::ostream& os, CacheIterator i); CacheEntryMap Cache; // Only cmake and cmState should be able to add cache values diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 3e2cf18..9c516ee 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -333,7 +333,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item) return index; } -void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe) +void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe) { // Get this entry representation. int depender_index = qe.Index; diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index 195b544..84ee916 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -93,7 +93,7 @@ private: const char* LibDepends; }; std::queue<BFSEntry> BFSQueue; - void FollowLinkEntry(BFSEntry const&); + void FollowLinkEntry(BFSEntry qe); // Shared libraries that are included only because they are // dependencies of other shared libraries, not because they are part diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index f530ba7..7fbe75c 100644 --- a/Source/cmDynamicLoader.cxx +++ b/Source/cmDynamicLoader.cxx @@ -10,8 +10,7 @@ class cmDynamicLoaderCache { public: ~cmDynamicLoaderCache(); - void CacheFile(const char* path, - const cmsys::DynamicLoader::LibraryHandle& /*p*/); + void CacheFile(const char* path, cmsys::DynamicLoader::LibraryHandle /*p*/); bool GetCacheFile(const char* path, cmsys::DynamicLoader::LibraryHandle& /*p*/); bool FlushCache(const char* path); @@ -29,8 +28,8 @@ cmDynamicLoaderCache::~cmDynamicLoaderCache() { } -void cmDynamicLoaderCache::CacheFile( - const char* path, const cmsys::DynamicLoader::LibraryHandle& p) +void cmDynamicLoaderCache::CacheFile(const char* path, + cmsys::DynamicLoader::LibraryHandle p) { cmsys::DynamicLoader::LibraryHandle h; if (this->GetCacheFile(path, h)) { diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index d23abec..fc97bf3 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -53,17 +53,17 @@ template <size_t s> struct cmELFByteSwapSize { }; -void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> const& /*unused*/) +void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> /*unused*/) { } -void cmELFByteSwap(char* data, cmELFByteSwapSize<2> const& /*unused*/) +void cmELFByteSwap(char* data, cmELFByteSwapSize<2> /*unused*/) { char one_byte; one_byte = data[0]; data[0] = data[1]; data[1] = one_byte; } -void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/) +void cmELFByteSwap(char* data, cmELFByteSwapSize<4> /*unused*/) { char one_byte; one_byte = data[0]; @@ -73,7 +73,7 @@ void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/) data[1] = data[2]; data[2] = one_byte; } -void cmELFByteSwap(char* data, cmELFByteSwapSize<8> const& /*unused*/) +void cmELFByteSwap(char* data, cmELFByteSwapSize<8> /*unused*/) { char one_byte; one_byte = data[0]; diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 32a539c..77b0d13 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1121,9 +1121,9 @@ protected: bool InstallSymlink(const char* fromFile, const char* toFile); bool InstallFile(const char* fromFile, const char* toFile, - MatchProperties const& match_properties); + MatchProperties match_properties); bool InstallDirectory(const char* source, const char* destination, - MatchProperties const& match_properties); + MatchProperties match_properties); virtual bool Install(const char* fromFile, const char* toFile); virtual std::string const& ToName(std::string const& fromName) { @@ -1542,7 +1542,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) } bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, - MatchProperties const& match_properties) + MatchProperties match_properties) { // Determine whether we will copy the file. bool copy = true; @@ -1596,7 +1596,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, bool cmFileCopier::InstallDirectory(const char* source, const char* destination, - MatchProperties const& match_properties) + MatchProperties match_properties) { // Inform the user about this directory installation. this->ReportCopy(destination, TypeDir, diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index ea031cf..9327c18 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -212,7 +212,8 @@ std::string cmFindProgramCommand::FindAppBundle() return ""; } -std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath) +std::string cmFindProgramCommand::GetBundleExecutable( + std::string const& bundlePath) { std::string executable; (void)bundlePath; diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index a0d6af9..b0cd420 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -43,7 +43,7 @@ private: std::string FindNormalProgramDirsPerName(); std::string FindNormalProgramNamesPerDir(); std::string FindAppBundle(); - std::string GetBundleExecutable(std::string bundlePath); + std::string GetBundleExecutable(std::string const& bundlePath); }; #endif diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9a33bec..24decea 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -76,7 +76,7 @@ public: cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem; void CreatePropertyGeneratorExpressions( - cmStringRange const& entries, cmBacktraceRange const& backtraces, + cmStringRange entries, cmBacktraceRange backtraces, std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items, bool evaluateForBuildsystem = false) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 67e272d..b32f4e4 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1482,13 +1482,13 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets() } cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) const + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const { return new cmLinkLineComputer(outputConverter, stateDir); } cmLinkLineComputer* cmGlobalGenerator::CreateMSVC60LinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) const + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const { return new cmMSVC60LinkLineComputer(outputConverter, stateDir); } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index cc7ffed..871178b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -105,10 +105,12 @@ public: virtual void Generate(); virtual cmLinkLineComputer* CreateLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) const; + cmOutputConverter* outputConverter, + cmStateDirectory const& stateDir) const; cmLinkLineComputer* CreateMSVC60LinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) const; + cmOutputConverter* outputConverter, + cmStateDirectory const& stateDir) const; /** * Set/Get and Clear the enabled languages. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index bb0b83a..2eef9e4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -77,7 +77,8 @@ void cmGlobalNinjaGenerator::WriteComment(std::ostream& os, } cmLinkLineComputer* cmGlobalNinjaGenerator::CreateLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory /* stateDir */) const + cmOutputConverter* outputConverter, + cmStateDirectory const& /* stateDir */) const { return new cmNinjaLinkLineComputer( outputConverter, diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index 41c5175..b0008f7 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -78,7 +78,7 @@ public: cmLinkLineComputer* CreateLinkLineComputer( cmOutputConverter* outputConverter, - cmStateDirectory stateDir) const CM_OVERRIDE; + cmStateDirectory const& stateDir) const CM_OVERRIDE; /** * Write the given @a comment to the output stream @a os. It diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 120d1b3..13b588e 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -27,7 +27,7 @@ void cmInstallGenerator::AddInstallRule( std::vector<std::string> const& files, bool optional /* = false */, const char* permissions_file /* = 0 */, const char* permissions_dir /* = 0 */, const char* rename /* = 0 */, - const char* literal_args /* = 0 */, Indent const& indent) + const char* literal_args /* = 0 */, Indent indent) { // Use the FILE command to install the file. std::string stype; diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index de19f98..8f8701f 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -43,7 +43,7 @@ public: std::vector<std::string> const& files, bool optional = false, const char* permissions_file = CM_NULLPTR, const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR, - const char* literal_args = CM_NULLPTR, Indent const& indent = Indent()); + const char* literal_args = CM_NULLPTR, Indent indent = Indent()); /** Get the install destination as it should appear in the installation script. */ diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx index e728632..c0f702e 100644 --- a/Source/cmLinkLineComputer.cxx +++ b/Source/cmLinkLineComputer.cxx @@ -13,7 +13,7 @@ #include "cmStateTypes.h" cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir) + cmStateDirectory const& stateDir) : StateDir(stateDir) , OutputConverter(outputConverter) , ForResponse(false) diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index 27b8adb..d33e8d1 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -20,7 +20,7 @@ class cmLinkLineComputer public: cmLinkLineComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir); + cmStateDirectory const& stateDir); virtual ~cmLinkLineComputer(); void SetUseWatcomQuote(bool useWatcomQuote); diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx index bf30b39..942e9b9 100644 --- a/Source/cmLinkLineDeviceComputer.cxx +++ b/Source/cmLinkLineDeviceComputer.cxx @@ -10,13 +10,12 @@ #include "cmComputeLinkInformation.h" #include "cmGeneratorTarget.h" #include "cmGlobalNinjaGenerator.h" -#include "cmStateDirectory.h" #include "cmStateTypes.h" class cmOutputConverter; cmLinkLineDeviceComputer::cmLinkLineDeviceComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) : cmLinkLineComputer(outputConverter, stateDir) { } @@ -89,7 +88,7 @@ std::string cmLinkLineDeviceComputer::GetLinkerLanguage(cmGeneratorTarget*, } cmNinjaLinkLineDeviceComputer::cmNinjaLinkLineDeviceComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir, + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir, cmGlobalNinjaGenerator const* gg) : cmLinkLineDeviceComputer(outputConverter, stateDir) , GG(gg) diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h index e9e98ac..c3fac61 100644 --- a/Source/cmLinkLineDeviceComputer.h +++ b/Source/cmLinkLineDeviceComputer.h @@ -22,7 +22,7 @@ class cmLinkLineDeviceComputer : public cmLinkLineComputer public: cmLinkLineDeviceComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir); + cmStateDirectory const& stateDir); ~cmLinkLineDeviceComputer() CM_OVERRIDE; std::string ComputeLinkLibraries(cmComputeLinkInformation& cli, @@ -39,7 +39,7 @@ class cmNinjaLinkLineDeviceComputer : public cmLinkLineDeviceComputer public: cmNinjaLinkLineDeviceComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir, + cmStateDirectory const& stateDir, cmGlobalNinjaGenerator const* gg); std::string ConvertToLinkReference(std::string const& input) const diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 929b1cd..0c73cd7 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -307,7 +307,8 @@ struct cmListFileBacktrace::Entry : public cmListFileContext unsigned int RefCount; }; -cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* up, +cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom, + Entry* up, cmListFileContext const& lfc) : Bottom(bottom) , Cur(new Entry(lfc, up)) @@ -316,7 +317,8 @@ cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* up, this->Cur->Ref(); } -cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* cur) +cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom, + Entry* cur) : Bottom(bottom) , Cur(cur) { @@ -332,7 +334,7 @@ cmListFileBacktrace::cmListFileBacktrace() { } -cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot snapshot) +cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& snapshot) : Bottom(snapshot.GetCallStackBottom()) , Cur(CM_NULLPTR) { diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index aa11ba7..349ddef 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -107,7 +107,7 @@ public: // Construct an empty backtrace whose bottom sits in the directory // indicated by the given valid snapshot. - cmListFileBacktrace(cmStateSnapshot snapshot); + cmListFileBacktrace(cmStateSnapshot const& snapshot); // Backtraces may be copied and assigned as values. cmListFileBacktrace(cmListFileBacktrace const& r); @@ -143,9 +143,9 @@ private: cmStateSnapshot Bottom; Entry* Cur; - cmListFileBacktrace(cmStateSnapshot bottom, Entry* up, + cmListFileBacktrace(cmStateSnapshot const& bottom, Entry* up, cmListFileContext const& lfc); - cmListFileBacktrace(cmStateSnapshot bottom, Entry* cur); + cmListFileBacktrace(cmStateSnapshot const& bottom, Entry* cur); }; struct cmListFile diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx index b5e8511..5298d1a 100644 --- a/Source/cmMSVC60LinkLineComputer.cxx +++ b/Source/cmMSVC60LinkLineComputer.cxx @@ -3,8 +3,6 @@ #include "cmMSVC60LinkLineComputer.h" -#include "cmStateDirectory.h" - #if defined(_WIN32) && !defined(__CYGWIN__) #include "cmSystemTools.h" #endif @@ -12,7 +10,7 @@ class cmOutputConverter; cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) : cmLinkLineComputer(outputConverter, stateDir) { } diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h index e494060..f2892d5 100644 --- a/Source/cmMSVC60LinkLineComputer.h +++ b/Source/cmMSVC60LinkLineComputer.h @@ -19,7 +19,7 @@ class cmMSVC60LinkLineComputer : public cmLinkLineComputer public: cmMSVC60LinkLineComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir); + cmStateDirectory const& stateDir); std::string ConvertToLinkReference(std::string const& input) const CM_OVERRIDE; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 51d8980..11814b0 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3463,7 +3463,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output, int cmMakefile::ConfigureFile(const char* infile, const char* outfile, bool copyonly, bool atOnly, bool escapeQuotes, - const cmNewLineStyle& newLine) + cmNewLineStyle newLine) { int res = 1; if (!this->CanIWriteThisFile(outfile)) { diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 6dc30ce..e65ba46 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -548,7 +548,7 @@ public: */ int ConfigureFile(const char* infile, const char* outfile, bool copyonly, bool atOnly, bool escapeQuotes, - const cmNewLineStyle& = cmNewLineStyle()); + cmNewLineStyle = cmNewLineStyle()); #if defined(CMAKE_BUILD_WITH_CMAKE) /** diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1aeeb7d..a4511b6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1255,7 +1255,7 @@ class cmMakefileTargetGeneratorObjectStrings public: cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings, cmOutputConverter* outputConverter, - cmStateDirectory stateDir, + cmStateDirectory const& stateDir, std::string::size_type limit) : Strings(strings) , OutputConverter(outputConverter) @@ -1574,7 +1574,7 @@ std::string cmMakefileTargetGenerator::CreateResponseFile( } cmLinkLineComputer* cmMakefileTargetGenerator::CreateLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir) + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) { if (this->Makefile->IsOn("MSVC60")) { return this->GlobalGenerator->CreateMSVC60LinkLineComputer(outputConverter, diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 32b1fee..92c9f60 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -143,7 +143,7 @@ protected: std::vector<std::string>& makefile_depends); cmLinkLineComputer* CreateLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir); + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir); /** Create a response file with the given set of options. Returns the relative path from the target build working directory to the diff --git a/Source/cmNinjaLinkLineComputer.cxx b/Source/cmNinjaLinkLineComputer.cxx index 2546b55..7fbeeea 100644 --- a/Source/cmNinjaLinkLineComputer.cxx +++ b/Source/cmNinjaLinkLineComputer.cxx @@ -4,12 +4,11 @@ #include "cmNinjaLinkLineComputer.h" #include "cmGlobalNinjaGenerator.h" -#include "cmStateDirectory.h" class cmOutputConverter; cmNinjaLinkLineComputer::cmNinjaLinkLineComputer( - cmOutputConverter* outputConverter, cmStateDirectory stateDir, + cmOutputConverter* outputConverter, cmStateDirectory const& stateDir, cmGlobalNinjaGenerator const* gg) : cmLinkLineComputer(outputConverter, stateDir) , GG(gg) diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h index e612e88..13f05a8 100644 --- a/Source/cmNinjaLinkLineComputer.h +++ b/Source/cmNinjaLinkLineComputer.h @@ -20,7 +20,7 @@ class cmNinjaLinkLineComputer : public cmLinkLineComputer public: cmNinjaLinkLineComputer(cmOutputConverter* outputConverter, - cmStateDirectory stateDir, + cmStateDirectory const& stateDir, cmGlobalNinjaGenerator const* gg); std::string ConvertToLinkReference(std::string const& input) const diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index d48eb53..333e313 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -424,7 +424,7 @@ struct cmOrderDirectoriesCompare // The conflict pair is unique based on just the directory // (first). The second element is only used for displaying // information about why the entry is present. - bool operator()(ConflictPair const& l, ConflictPair const& r) + bool operator()(ConflictPair l, ConflictPair r) { return l.first == r.first; } diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index d6864a6..14c986d 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -14,7 +14,7 @@ #include "cmStateDirectory.h" #include "cmSystemTools.h" -cmOutputConverter::cmOutputConverter(cmStateSnapshot snapshot) +cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot) : StateSnapshot(snapshot) , LinkScriptShell(false) { @@ -81,7 +81,7 @@ static bool cmOutputConverterNotAbove(const char* a, const char* b) bool cmOutputConverter::ContainedInDirectory(std::string const& local_path, std::string const& remote_path, - cmStateDirectory directory) + cmStateDirectory const& directory) { const std::string relativePathTopBinary = directory.GetRelativePathTopBinary(); diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h index 12a1773..ae15055 100644 --- a/Source/cmOutputConverter.h +++ b/Source/cmOutputConverter.h @@ -15,7 +15,7 @@ class cmStateDirectory; class cmOutputConverter { public: - cmOutputConverter(cmStateSnapshot snapshot); + cmOutputConverter(cmStateSnapshot const& snapshot); enum OutputFormat { @@ -94,7 +94,7 @@ public: static bool ContainedInDirectory(std::string const& local_path, std::string const& remote_path, - cmStateDirectory directory); + cmStateDirectory const& directory); /** * Convert the given remote path to a relative path with respect to diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ce9f470..92e47f7 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -633,7 +633,7 @@ cmStateSnapshot cmState::CreateBaseSnapshot() } cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot( - cmStateSnapshot originSnapshot) + cmStateSnapshot const& originSnapshot) { assert(originSnapshot.IsValid()); cmStateDetail::PositionType pos = @@ -667,7 +667,7 @@ cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot( } cmStateSnapshot cmState::CreateFunctionCallSnapshot( - cmStateSnapshot originSnapshot, std::string const& fileName) + cmStateSnapshot const& originSnapshot, std::string const& fileName) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -686,7 +686,7 @@ cmStateSnapshot cmState::CreateFunctionCallSnapshot( } cmStateSnapshot cmState::CreateMacroCallSnapshot( - cmStateSnapshot originSnapshot, std::string const& fileName) + cmStateSnapshot const& originSnapshot, std::string const& fileName) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -701,7 +701,7 @@ cmStateSnapshot cmState::CreateMacroCallSnapshot( } cmStateSnapshot cmState::CreateIncludeFileSnapshot( - cmStateSnapshot originSnapshot, const std::string& fileName) + cmStateSnapshot const& originSnapshot, std::string const& fileName) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -716,7 +716,7 @@ cmStateSnapshot cmState::CreateIncludeFileSnapshot( } cmStateSnapshot cmState::CreateVariableScopeSnapshot( - cmStateSnapshot originSnapshot) + cmStateSnapshot const& originSnapshot) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -734,7 +734,7 @@ cmStateSnapshot cmState::CreateVariableScopeSnapshot( } cmStateSnapshot cmState::CreateInlineListFileSnapshot( - cmStateSnapshot originSnapshot, const std::string& fileName) + cmStateSnapshot const& originSnapshot, std::string const& fileName) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -748,7 +748,7 @@ cmStateSnapshot cmState::CreateInlineListFileSnapshot( } cmStateSnapshot cmState::CreatePolicyScopeSnapshot( - cmStateSnapshot originSnapshot) + cmStateSnapshot const& originSnapshot) { cmStateDetail::PositionType pos = this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position); @@ -759,7 +759,7 @@ cmStateSnapshot cmState::CreatePolicyScopeSnapshot( return cmStateSnapshot(this, pos); } -cmStateSnapshot cmState::Pop(cmStateSnapshot originSnapshot) +cmStateSnapshot cmState::Pop(cmStateSnapshot const& originSnapshot) { cmStateDetail::PositionType pos = originSnapshot.Position; cmStateDetail::PositionType prevPos = pos; diff --git a/Source/cmState.h b/Source/cmState.h index 1a5738f..e03ad89 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -36,18 +36,20 @@ public: cmStateSnapshot CreateBaseSnapshot(); cmStateSnapshot CreateBuildsystemDirectorySnapshot( - cmStateSnapshot originSnapshot); - cmStateSnapshot CreateFunctionCallSnapshot(cmStateSnapshot originSnapshot, - std::string const& fileName); - cmStateSnapshot CreateMacroCallSnapshot(cmStateSnapshot originSnapshot, - std::string const& fileName); - cmStateSnapshot CreateIncludeFileSnapshot(cmStateSnapshot originSnapshot, - std::string const& fileName); - cmStateSnapshot CreateVariableScopeSnapshot(cmStateSnapshot originSnapshot); - cmStateSnapshot CreateInlineListFileSnapshot(cmStateSnapshot originSnapshot, - std::string const& fileName); - cmStateSnapshot CreatePolicyScopeSnapshot(cmStateSnapshot originSnapshot); - cmStateSnapshot Pop(cmStateSnapshot originSnapshot); + cmStateSnapshot const& originSnapshot); + cmStateSnapshot CreateFunctionCallSnapshot( + cmStateSnapshot const& originSnapshot, std::string const& fileName); + cmStateSnapshot CreateMacroCallSnapshot( + cmStateSnapshot const& originSnapshot, std::string const& fileName); + cmStateSnapshot CreateIncludeFileSnapshot( + cmStateSnapshot const& originSnapshot, std::string const& fileName); + cmStateSnapshot CreateVariableScopeSnapshot( + cmStateSnapshot const& originSnapshot); + cmStateSnapshot CreateInlineListFileSnapshot( + cmStateSnapshot const& originSnapshot, std::string const& fileName); + cmStateSnapshot CreatePolicyScopeSnapshot( + cmStateSnapshot const& originSnapshot); + cmStateSnapshot Pop(cmStateSnapshot const& originSnapshot); static cmStateEnums::CacheEntryType StringToCacheEntryType(const char*); static const char* CacheEntryTypeToString(cmStateEnums::CacheEntryType); diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index d2c9d73..77413c7 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -125,7 +125,7 @@ cmStateSnapshot cmStateSnapshot::GetCallStackBottom() const return cmStateSnapshot(this->State, pos); } -void cmStateSnapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak) +void cmStateSnapshot::PushPolicy(cmPolicies::PolicyMap const& entry, bool weak) { cmStateDetail::PositionType pos = this->Position; pos->Policies = this->State->PolicyStack.Push( diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h index 2e82ef4..6293803 100644 --- a/Source/cmStateSnapshot.h +++ b/Source/cmStateSnapshot.h @@ -45,7 +45,7 @@ public: void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status); cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const; bool HasDefinedPolicyCMP0011(); - void PushPolicy(cmPolicies::PolicyMap entry, bool weak); + void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak); bool PopPolicy(); bool CanPopPolicyScope(); |