Merge topic 'minor-cleanups'

c37cf7fa cmCacheManager: Remove unused method
64556e3d cmCacheManager: Remove unused overloads.
23bb5d22 cmCacheManager: Remove use of intermediate overload.
510562e3 cmGlobalGenerator: Don't fetch the cache manager in a loop.
629e9489 cmake: Clear member rather than explicit erase.
d280bae9 cmake: Be clear that there is no chaining after global properties.
364c7ea1 cmake: Remove unused method.
47acfe1d cmake: Remove unused member.
a469bf7b cmMakefile: Remove one wrong and one insufficiently helpful comment.
257c1649 cmListFile: Remove unused member.
fe17092c cmMakefile: Remove bogus comment.
199b28ac Remove duplicate tag name.
This commit is contained in:
Brad King 2015-04-06 09:19:34 -04:00 committed by CMake Topic Stage
commit 9b7213dc47
10 changed files with 7 additions and 81 deletions

View File

@ -76,22 +76,10 @@ bool cmCacheManager::IsType(const char* s)
return false; return false;
} }
bool cmCacheManager::LoadCache(cmMakefile* mf)
{
return this->LoadCache(mf->GetHomeOutputDirectory());
}
bool cmCacheManager::LoadCache(const std::string& path) bool cmCacheManager::LoadCache(const std::string& path)
{
return this->LoadCache(path,true);
}
bool cmCacheManager::LoadCache(const std::string& path,
bool internal)
{ {
std::set<std::string> emptySet; std::set<std::string> emptySet;
return this->LoadCache(path, internal, emptySet, emptySet); return this->LoadCache(path, true, emptySet, emptySet);
} }
static bool ParseEntryWithoutType(const std::string& entry, static bool ParseEntryWithoutType(const std::string& entry,
@ -418,12 +406,6 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os,
} }
} }
bool cmCacheManager::SaveCache(cmMakefile* mf)
{
return this->SaveCache(mf->GetHomeOutputDirectory());
}
bool cmCacheManager::SaveCache(const std::string& path) bool cmCacheManager::SaveCache(const std::string& path)
{ {
std::string cacheFile = path; std::string cacheFile = path;
@ -914,21 +896,3 @@ bool cmCacheManager::CacheIterator::PropertyExists(
{ {
return this->GetProperty(prop)? true:false; return this->GetProperty(prop)? true:false;
} }
//----------------------------------------------------------------------------
bool cmCacheManager::NeedCacheCompatibility(int major, int minor)
{
// Compatibility is not needed if the cache version is zero because
// the cache was created or modified by the user.
if(this->CacheMajorVersion == 0)
{
return false;
}
// Compatibility is needed if the cache version is equal to or lower
// than the given version.
cmIML_INT_uint64_t actual_compat =
CMake_VERSION_ENCODE(this->CacheMajorVersion, this->CacheMinorVersion, 0);
return (actual_compat &&
actual_compat <= CMake_VERSION_ENCODE(major, minor, 0));
}

View File

@ -105,17 +105,12 @@ public:
static const char* TypeToString(CacheEntryType); static const char* TypeToString(CacheEntryType);
static bool IsType(const char*); static bool IsType(const char*);
///! Load a cache for given makefile. Loads from ouput home.
bool LoadCache(cmMakefile*);
///! Load a cache for given makefile. Loads from path/CMakeCache.txt. ///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const std::string& path); bool LoadCache(const std::string& path);
bool LoadCache(const std::string& path, bool internal);
bool LoadCache(const std::string& path, bool internal, bool LoadCache(const std::string& path, bool internal,
std::set<std::string>& excludes, std::set<std::string>& excludes,
std::set<std::string>& includes); std::set<std::string>& includes);
///! Save cache for given makefile. Saves to ouput home CMakeCache.txt.
bool SaveCache(cmMakefile*) ;
///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt ///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt
bool SaveCache(const std::string& path) ; bool SaveCache(const std::string& path) ;
@ -149,7 +144,6 @@ public:
{ return this->CacheMajorVersion; } { return this->CacheMajorVersion; }
unsigned int GetCacheMinorVersion() const unsigned int GetCacheMinorVersion() const
{ return this->CacheMinorVersion; } { return this->CacheMinorVersion; }
bool NeedCacheCompatibility(int major, int minor);
protected: protected:
///! Add an entry into the cache ///! Add an entry into the cache

View File

@ -1554,7 +1554,6 @@ class ArtifactPdbTag;
class ArtifactPathTag; class ArtifactPathTag;
class ArtifactDirTag; class ArtifactDirTag;
class ArtifactNameTag;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
template<typename ArtifactT> template<typename ArtifactT>

View File

@ -1537,10 +1537,9 @@ void cmGlobalGenerator::CheckLocalGenerators()
std::map<std::string, std::string> notFoundMap; std::map<std::string, std::string> notFoundMap;
// std::set<std::string> notFoundMap; // std::set<std::string> notFoundMap;
// after it is all done do a ConfigureFinalPass // after it is all done do a ConfigureFinalPass
cmCacheManager* manager = 0; cmCacheManager* manager = this->GetCMakeInstance()->GetCacheManager();
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
{ {
manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager();
this->LocalGenerators[i]->ConfigureFinalPass(); this->LocalGenerators[i]->ConfigureFinalPass();
cmTargets &targets = cmTargets &targets =
this->LocalGenerators[i]->GetMakefile()->GetTargets(); this->LocalGenerators[i]->GetMakefile()->GetTargets();

View File

@ -146,18 +146,12 @@ bool cmListFile::ParseFile(const char* filename,
} }
bool parseError = false; bool parseError = false;
this->ModifiedTime = cmSystemTools::ModifiedTime(filename);
{ {
cmListFileParser parser(this, mf, filename); cmListFileParser parser(this, mf, filename);
parseError = !parser.ParseFile(); parseError = !parser.ParseFile();
} }
if(parseError)
{
this->ModifiedTime = 0;
}
// do we need a cmake_policy(VERSION call? // do we need a cmake_policy(VERSION call?
if(topLevel) if(topLevel)
{ {

View File

@ -85,15 +85,10 @@ class cmListFileBacktrace: public std::vector<cmListFileContext>
struct cmListFile struct cmListFile
{ {
cmListFile()
:ModifiedTime(0)
{
}
bool ParseFile(const char* path, bool ParseFile(const char* path,
bool topLevel, bool topLevel,
cmMakefile *mf); cmMakefile *mf);
long int ModifiedTime;
std::vector<cmListFileFunction> Functions; std::vector<cmListFileFunction> Functions;
}; };

View File

@ -184,11 +184,6 @@ unsigned int cmMakefile::GetCacheMinorVersion() const
return this->GetCacheManager()->GetCacheMinorVersion(); return this->GetCacheManager()->GetCacheMinorVersion();
} }
bool cmMakefile::NeedCacheCompatibility(int major, int minor) const
{
return this->GetCacheManager()->NeedCacheCompatibility(major, minor);
}
cmMakefile::~cmMakefile() cmMakefile::~cmMakefile()
{ {
cmDeleteAll(this->InstallGenerators); cmDeleteAll(this->InstallGenerators);

View File

@ -78,9 +78,6 @@ public:
bool VariableInitialized(const std::string& ) const; bool VariableInitialized(const std::string& ) const;
/* return true if a variable has been used */ /* return true if a variable has been used */
bool VariableUsed(const std::string& ) const; bool VariableUsed(const std::string& ) const;
/** Return whether compatibility features needed for a version of
the cache or lower should be enabled. */
bool NeedCacheCompatibility(int major, int minor) const;
/** /**
* Construct an empty makefile. * Construct an empty makefile.
@ -776,10 +773,6 @@ public:
///enabled. ///enabled.
void EnableLanguage(std::vector<std::string>const& languages, bool optional); void EnableLanguage(std::vector<std::string>const& languages, bool optional);
/**
* Set/Get the name of the parent directories CMakeLists file
* given a current CMakeLists file name
*/
cmCacheManager *GetCacheManager() const; cmCacheManager *GetCacheManager() const;
/** /**
@ -985,9 +978,8 @@ protected:
// directories. // directories.
std::set<std::string> SystemIncludeDirectories; std::set<std::string> SystemIncludeDirectories;
std::vector<std::string> ListFiles; // list of command files loaded std::vector<std::string> ListFiles;
std::vector<std::string> OutputFiles; // list of command files loaded std::vector<std::string> OutputFiles;
cmTarget::LinkLibraryVectorType LinkLibraries; cmTarget::LinkLibraryVectorType LinkLibraries;

View File

@ -188,7 +188,6 @@ void cmake::InitializeProperties()
{ {
this->Properties.clear(); this->Properties.clear();
this->Properties.SetCMakeInstance(this); this->Properties.SetCMakeInstance(this);
this->AccessedProperties.clear();
this->PropertyDefinitions.clear(); this->PropertyDefinitions.clear();
// initialize properties // initialize properties
@ -213,7 +212,7 @@ void cmake::CleanupCommandsAndMacros()
delete j->second; delete j->second;
} }
} }
this->Commands.erase(this->Commands.begin(), this->Commands.end()); this->Commands.clear();
std::vector<cmCommand*>::iterator it; std::vector<cmCommand*>::iterator it;
for ( it = commands.begin(); it != commands.end(); for ( it = commands.begin(); it != commands.end();
++ it ) ++ it )
@ -2274,8 +2273,6 @@ const char *cmake::GetProperty(const std::string& prop)
const char *cmake::GetProperty(const std::string& prop, const char *cmake::GetProperty(const std::string& prop,
cmProperty::ScopeType scope) cmProperty::ScopeType scope)
{ {
bool chain = false;
// watch for special properties // watch for special properties
std::string output = ""; std::string output = "";
if ( prop == "CACHE_VARIABLES" ) if ( prop == "CACHE_VARIABLES" )
@ -2333,7 +2330,8 @@ const char *cmake::GetProperty(const std::string& prop,
return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
} }
#undef STRING_LIST_ELEMENT #undef STRING_LIST_ELEMENT
return this->Properties.GetPropertyValue(prop, scope, chain); bool dummy = false;
return this->Properties.GetPropertyValue(prop, scope, dummy);
} }
bool cmake::GetPropertyAsBool(const std::string& prop) bool cmake::GetPropertyAsBool(const std::string& prop)

View File

@ -287,9 +287,6 @@ class cmake
cmProperty::ScopeType scope); cmProperty::ScopeType scope);
bool GetPropertyAsBool(const std::string& prop); bool GetPropertyAsBool(const std::string& prop);
// Get the properties
cmPropertyMap &GetProperties() { return this->Properties; }
///! Get or create an cmInstalledFile instance and return a pointer to it ///! Get or create an cmInstalledFile instance and return a pointer to it
cmInstalledFile *GetOrCreateInstalledFile( cmInstalledFile *GetOrCreateInstalledFile(
cmMakefile* mf, const std::string& name); cmMakefile* mf, const std::string& name);
@ -383,7 +380,6 @@ protected:
void InitializeProperties(); void InitializeProperties();
int HandleDeleteCacheVariables(const std::string& var); int HandleDeleteCacheVariables(const std::string& var);
cmPropertyMap Properties; cmPropertyMap Properties;
std::set<std::pair<std::string,cmProperty::ScopeType> > AccessedProperties;
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>
PropertyDefinitions; PropertyDefinitions;