diff options
author | Brad King <brad.king@kitware.com> | 2015-02-23 15:26:42 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-02-23 15:26:42 (GMT) |
commit | 6dc9a627b635617870945677b4868e212f4184ed (patch) | |
tree | 347d9d2da7d3ce7aff132273cefc68cd7d3e3f78 /Source | |
parent | 88aeb64ddfb129701b6709f27531da0a885593eb (diff) | |
parent | c021f59c1f2f3d892b621a9ba163b069f2a2f0a9 (diff) | |
download | CMake-6dc9a627b635617870945677b4868e212f4184ed.zip CMake-6dc9a627b635617870945677b4868e212f4184ed.tar.gz CMake-6dc9a627b635617870945677b4868e212f4184ed.tar.bz2 |
Merge topic 'minor-cleanups'
c021f59c cmMakefile: Store macro list in a vector not in a map.
2d130896 cmMakefile: Fix list of macros generation.
f1969234 cmFunctionCommand: Remove ineffectual code.
1116698a cmTarget: Don't needlessly clear vectors in the destructor.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFunctionCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmGetCMakePropertyCommand.cxx | 1 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 10 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 22 | ||||
-rw-r--r-- | Source/cmMakefile.h | 5 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 10 |
6 files changed, 15 insertions, 38 deletions
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index a4d9357..9297688 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -175,11 +175,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, // if this is the endfunction for this function then execute if (!this->Depth) { - std::string name = this->Args[0]; - name += "( "; - name += cmJoin(this->Args, " "); - name += " )"; - // create a new command and add it to cmake cmFunctionHelperCommand *f = new cmFunctionHelperCommand(); f->Args = this->Args; diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index 84c00ba..fd18596 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -39,6 +39,7 @@ bool cmGetCMakePropertyCommand } else if ( args[1] == "MACROS" ) { + output.clear(); this->Makefile->GetListOfMacros(output); } else if ( args[1] == "COMPONENTS" ) diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 29e8cb1..12c8576 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -224,15 +224,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, // if this is the endmacro for this macro then execute if (!this->Depth) { - std::string name = this->Args[0]; - name += "("; - if (!this->Args.empty()) - { - name += " "; - name += cmJoin(this->Args, " "); - } - name += " )"; - mf.AddMacro(this->Args[0].c_str(), name.c_str()); + mf.AddMacro(this->Args[0].c_str()); // create a new command and add it to cmake cmMacroHelperCommand *f = new cmMacroHelperCommand(); f->Args = this->Args; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3c92fca..ccfe2b1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -143,7 +143,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals) this->LocalGenerator = mf.LocalGenerator; this->FunctionBlockers = mf.FunctionBlockers; - this->MacrosMap = mf.MacrosMap; + this->MacrosList = mf.MacrosList; this->SubDirectoryOrder = mf.SubDirectoryOrder; this->Properties = mf.Properties; this->PreOrder = mf.PreOrder; @@ -3715,26 +3715,16 @@ cmVariableWatch *cmMakefile::GetVariableWatch() const } #endif -void cmMakefile::AddMacro(const char* name, const char* signature) +void cmMakefile::AddMacro(const char* name) { - if ( !name || !signature ) - { - return; - } - this->MacrosMap[name] = signature; + assert(name); + this->MacrosList.push_back(name); } void cmMakefile::GetListOfMacros(std::string& macros) const { - StringStringMap::const_iterator it; - macros = ""; - const char* sep = ""; - for ( it = this->MacrosMap.begin(); it != this->MacrosMap.end(); ++it ) - { - macros += sep; - macros += it->first; - sep = ""; - } + assert(macros.empty()); + macros = cmJoin(this->MacrosList, ";"); } cmCacheManager *cmMakefile::GetCacheManager() const diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 895a2fc..e98f1d9 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -841,7 +841,7 @@ public: * Add a macro to the list of macros. The arguments should be name of the * macro and a documentation signature of it */ - void AddMacro(const char* name, const char* signature); + void AddMacro(const char* name); ///! Add a new cmTest to the list of tests for this makefile. cmTest* CreateTest(const std::string& testName); @@ -1065,8 +1065,7 @@ private: std::stack<int> LoopBlockCounter; - typedef std::map<std::string, std::string> StringStringMap; - StringStringMap MacrosMap; + std::vector<std::string> MacrosList; std::map<std::string, bool> SubDirectoryOrder; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ebcd810..e046bef 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6872,11 +6872,11 @@ cmTargetInternalPointer //---------------------------------------------------------------------------- cmTargetInternalPointer::~cmTargetInternalPointer() { - deleteAndClear(this->Pointer->IncludeDirectoriesEntries); - deleteAndClear(this->Pointer->CompileOptionsEntries); - deleteAndClear(this->Pointer->CompileFeaturesEntries); - deleteAndClear(this->Pointer->CompileDefinitionsEntries); - deleteAndClear(this->Pointer->SourceEntries); + cmDeleteAll(this->Pointer->IncludeDirectoriesEntries); + cmDeleteAll(this->Pointer->CompileOptionsEntries); + cmDeleteAll(this->Pointer->CompileFeaturesEntries); + cmDeleteAll(this->Pointer->CompileDefinitionsEntries); + cmDeleteAll(this->Pointer->SourceEntries); delete this->Pointer; } |