summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmDefinitions: Implement in terms of cmLinkedTree.Stephen Kelly2015-08-231-7/+7
| | | | | | | Store the definitions in a cmLinkedTree in the cmMakefile. This can be moved to cmState and then the tree will provide snapshotting possibilities. It will also make the Closure copy created at the start of each cmMakefile unnecesarry.
* cmMakefile: Remove VarUsageStack.Stephen Kelly2015-05-191-3/+4
| | | | | | Store usage information in the cmDefintions value instead. We already pay for the memory as padding in the Def struct, so we might as well use it.
* cmMakefile: Remove VarInitStack.Stephen Kelly2015-05-191-0/+14
| | | | | | | | | | | | | | | In cmMakefile::PushScope, a copy of the closure of keys initialized in the parent scope is made. In PopScope, essentially the same copy is inserted back into the parent. That means a lot of duplication of strings and a lot of string comparisons. None of it is needed, because the cmDefinitions keys already provide a canonical representation of what is initialized. The removal of the separate container also makes the variable handling code more easy to reason about in general. Before this patch, configuring llvm uses 200 KiB for the VarInitStack. Overall peak memory consumption goes from 35.5 MiB to 35.1 MiB.
* cmMakefile: Mark definitions explicitly erased, even at top level.Stephen Kelly2015-05-191-5/+0
| | | | | | | | | | Presumably the intention here is to attempt to optimize memory by not storing what is not needed. However, all keys need to be tracked anyway to implement initialization tracking, and this special case gets in the way of simplifying the implementation of that. This doesn't change any observable effects because values set to 0 are considered not to exist by the cmDefinitions API.
* cmMakefile: Raise variable in scope explicitly when needed.Stephen Kelly2015-05-191-3/+13
| | | | | The Get method implicitly pulls a copy of all variables into a local scope. This is not necessary.
* cmDefinitions: Make the ClosureKeys method static.Stephen Kelly2015-05-171-7/+13
| | | | For consistency with all other closure-related methods.
* cmDefinitions: Centralize knowledge of iterator type.Stephen Kelly2015-05-171-19/+14
| | | | Currently we process a list of definitions, but that will change.
* cmDefinitions: Remove internal MakeClosure method.Stephen Kelly2015-05-171-13/+4
| | | | | There is no need to have a separate method, or to pass an external set to it.
* cmDefinitions: Make GetInternal method static.Stephen Kelly2015-05-011-9/+9
| | | | | | | | For some reason, using recursion here is faster to configure ParaView than using a loop. Probably some compiler optimization is inhibited by using a loop. Co-Author: Brad King <brad.king@kitware.com>
* cmDefinitions: Use static member without this->.Stephen Kelly2015-05-011-1/+1
|
* cmDefinitions: Remove Parent pointer.Stephen Kelly2015-05-011-6/+0
| | | | All structural knowledge of the stack of scopes is now external.
* cmDefinitions: Accept varStack iterators in Get API.Stephen Kelly2015-05-011-7/+14
|
* cmDefinitions: Invert conditional code.Stephen Kelly2015-04-291-5/+6
| | | | Return the simple case first.
* cmDefinitions: Externalize looping for ClosureKeys.Stephen Kelly2015-04-291-15/+8
|
* cmDefinitions: Implement MakeClosure in terms of reverse iterators.Stephen Kelly2015-04-291-9/+9
| | | | Iterate directly over the parent content provided by cmMakefile.
* cmDefinitions: Convert MakeClosure into a static method.Stephen Kelly2015-04-291-9/+4
| | | | Accept a range of cmDefinitions*.
* cmDefinitions: Implement MakeClosure in terms of a list of ancestors.Stephen Kelly2015-04-291-12/+13
|
* cmDefinitions: Use list of cmDefinitions* to create closure.Stephen Kelly2015-04-291-3/+11
|
* cmDefinitions: Replace recursion with loop.Stephen Kelly2015-04-291-18/+16
|
* cmDefinitions: Replace private constructor with MakeClosure.Stephen Kelly2015-04-291-11/+6
|
* cmDefinitions: Make ClosureKeys API vector-based.Stephen Kelly2015-04-291-7/+5
| | | | | | | Construct the final list directly in a named return value. Use a single set to track bindings already found. Co-Author: Brad King <brad.king@kitware.com>
* cmDefinitions: Inline GetClosureKeys implementation.Stephen Kelly2015-04-291-7/+1
|
* cmDefinitions: Replace ClosureKeys recursion with looping.Stephen Kelly2015-04-291-14/+14
|
* cmDefinitions: Change LocalKeys to return a vector.Stephen Kelly2015-04-291-3/+4
| | | | This is more efficient and we lose nothing.
* cmDefinitions: Externalize the Set logic.Stephen Kelly2015-04-291-10/+1
|
* cmDefinitions: Add an Erase method.Stephen Kelly2015-04-291-0/+5
|
* cmDefinitions: Inline SetInternal method.Stephen Kelly2015-04-281-15/+9
|
* cmDefinitions: Remove unused Set return value.Stephen Kelly2015-04-281-5/+3
|
* cmDefinitions: Remove unused method.Stephen Kelly2015-04-281-7/+0
|
* Merge topic 'revert-definition-map-lookup'Brad King2014-10-271-17/+5
|\ | | | | | | | | | | | | | | d1b62185 Merge branch 'parent-scope-tests' into variable-pull-failure 5f414cef Revert "cmDefinitions: Don't store parent lookups" e0c0b1ac test: add a test for PARENT_SCOPE with multiple scopes 064c415d test: add test for PARENT_SCOPE behavior
| * Revert "cmDefinitions: Don't store parent lookups"Ben Boeckel2014-10-241-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5abfde6cb8a1ae0b2825797eab6c2e9842eb7c49. The behaviors associated with implicit pulldown on variable lookup seriously conflict with the optimizations made in these commits. Basically, since values were copied upon variable lookup, not just on PARENT_SCOPE, coupled with PARENT_SCOPE's behavior based on whether the variable is in the current scope or not causes serious problems with not storing a value for every variable at every scope. The commit changed behavior of the following example, among other cases: function(test_set) set(blah "value2") message("before PARENT_SCOPE blah=${blah}") set(blah ${blah} PARENT_SCOPE) message("after PARENT_SCOPE blah=${blah}") endfunction() set(blah value1) test_set() message("in parent scope, blah=${blah}") Reported-by: Alex Merry <alex.merry@kde.org> Reported-by: Ben Cooksley <bcooksley@kde.org>
* | cmDefinitions: Use a hashmap for faster checksBen Boeckel2014-06-091-2/+3
| | | | | | | | | | The hash map is much faster at checking that the map won't have what we're looking for so that we can just go to the parent scope instead.
* | cmDefinitions: Avoid a find-then-insert when setting variablesBen Boeckel2014-06-091-10/+1
|/ | | | Searching the map is not necessary.
* cmDefinitions: Don't store parent lookupsBen Boeckel2014-06-091-5/+17
| | | | | When looking up scopes, it is faster to not store the lookup locally to keep the maps smaller and avoid extra allocations and rebalancing.
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-10/+10
| | | | | | | | | | | 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.
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-4/+4
| | | | Variable names are always generated by CMake and should never be NULL.
* Only return local keys that are definedBen Boeckel2010-09-161-1/+4
|
* Add method to get the local scope variablesBen Boeckel2010-09-011-0/+13
|
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* ENH: Improve dynamic variable scope implementationBrad King2009-07-221-0/+167
Previously each new variable scope (subdirectory or function call) in the CMake language created a complete copy of the key->value definition map. This avoids the copy using transitive lookups up the scope stack. Results of queries answered by parents are stored locally to maintain locality of reference. The class cmDefinitions replaces cmMakefile::DefinitionsMap, and is aware of its enclosing scope. Each scope stores only the definitions set (or unset!) inside it relative to the enclosing scope.