summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-8/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-7/+7
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-8/+8
|
* cmCommand: remove unused methods from interface and all implementationsDaniel Pfeifer2017-05-111-1/+0
|
* cmState: separate builtin and scripted commandsDaniel Pfeifer2017-05-111-67/+50
|
* cmState: introduce method for adding scripted commandsDaniel Pfeifer2017-05-111-0/+6
|
* cmState: introduce methods for adding builtin commandsDaniel Pfeifer2017-05-111-0/+23
|
* cmState: remove RemoveUnscriptableCommandsDaniel Pfeifer2017-05-081-15/+0
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Add GENERATOR_IS_MULTI_CONFIG global propertyBastien Schatt2017-04-041-0/+14
| | | | Fixes: #16768
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-1/+1
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-9/+7
|
* Remove cmObject.h and cmTypeMacro.hDaniel Pfeifer2016-10-241-1/+0
|
* Make cmCommand not inherit from cmObjectDaniel Pfeifer2016-10-221-2/+1
|
* cmState: Split auxiliary classes into separate filesStephen Kelly2016-10-191-992/+2
| | | | | | | Port dependents to the new locations as needed. Leave behind a cmState.h include in cmListFileCache to reduce noise. It is removed in a following commit.
* cmState: Move Snapshot type to separate namespaceStephen Kelly2016-10-191-87/+85
| | | | Leave behind a typedef to avoid porting dependent code in this commit.
* cmState: Move Directory class to separate namespaceStephen Kelly2016-10-191-47/+45
| | | | Leave behind a typedef to avoid porting dependent code in this commit.
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-7/+8
| | | | Port dependent code to the change.
* cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-10/+10
|
* cmState: Move SnapshotType enum to separate namespaceStephen Kelly2016-10-181-18/+18
|
* cmState: Move PositionType to separate namespaceStephen Kelly2016-10-181-23/+26
| | | | Remove friend declarations supporting it being a nested type.
* cmState: Move PolicyStackEntry to separate namespaceStephen Kelly2016-10-181-9/+10
|
* cmState: Move SnapshotDataType to separate namespaceStephen Kelly2016-10-181-1/+1
|
* cmState: Move nested struct into separate top-level namespaceStephen Kelly2016-10-181-5/+5
| | | | | | Add a friend declaration to give the struct access to cmState::PositionType. This will be removed when that type is also extracted.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Add directory properties to get source and binary directoriesBrad King2016-09-191-0/+10
| | | | | | Add SOURCE_DIR and BINARY_DIR directory properties that return the absolute paths to the corresponding directories. These correspond to the target properties of the same names that we already have.
* Add directory property to list buildsystem targetsBrad King2016-09-191-0/+5
| | | | | Add a BUILDSYSTEM_TARGETS property to allow project code to traverse the list of its own targets in a given directory.
* Add a directory property to list subdirectoriesBrad King2016-09-191-0/+14
| | | | | Add a SUBDIRECTORIES directory property to allow project code to traverse the directory structure of itself as CMake sees it.
* cmState: Record buildsystem target names in each directoryBrad King2016-09-191-0/+8
| | | | | | Maintain in the directory state the list of target names added to be built. These are normal, non-imported targets (but do include INTERFACE libraries).
* cmState: remove unused codeDaniel Pfeifer2016-09-171-36/+0
| | | | Remove the code that was used by cmOutputConverter exclusively.
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-6/+12
|
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-161-0/+9
|
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-2/+3
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-8/+8
|
* cmState: Expose list of properties of values in the cacheTobias Hunger2016-06-101-0/+8
|
* Merge topic 'remove-needless-copies'Brad King2016-05-271-2/+2
|\ | | | | | | | | | | 27ead963 Remove unnecessary local copies. 618fb23f Pass arguments that are not modified as const&.
| * Pass arguments that are not modified as const&.Daniel Pfeifer2016-05-261-2/+2
| | | | | | | | | | | | | | Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.
* | Remove redundant c_str() calls.Daniel Pfeifer2016-05-261-4/+4
|/ | | | | Run clang-tidy's readability-redundant-string-cstr checker. Ignore findings in kwsys.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-685/+520
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Merge topic 'refactor-cmListFileBacktrace'Brad King2016-04-181-43/+17
|\ | | | | | | | | | | | | | | | | 0f96ef00 Remove unused cmake::IssueMessage overload 563bf9dd cmState: Remove unused entry point fields from snapshot data 7c36d206 cmListFileBacktrace: Refactor storage to provide efficient value semantics 1f6bd8a9 cmState: Avoid accumulating snapshot storage for backtraces 18b6676b cmState: Add Snapshot method to get bottom of call stack
| * cmState: Remove unused entry point fields from snapshot dataBrad King2016-04-181-12/+0
| | | | | | | | This information is now kept in cmMakefile::Backtrace.
| * cmListFileBacktrace: Refactor storage to provide efficient value semanticsBrad King2016-04-181-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer to one, 2015-07-08) we treat cmListFileBacktrace instances as lightweight values. This was true at the time only because the backtrace information was kept in the cmState snapshot hierarchy. However, that forced us to accumulate a lot of otherwise short-lived snapshots just to have the backtrace fields available for reference by cmListFileBacktrace instances. Recent refactoring made backtrace instances independent of the snapshot hierarchy to avoid accumulating short-lived snapshots. This came at the cost of making backtrace values heavy again, leading to lots of string coying and slower execution. Fix this by refactoring cmListFileBacktrace to provide value semantics with efficient shared storage underneath. Teach cmMakefile to maintain its call stack using an instance of cmListFileBacktrace. This approach allows the current backtrace to be efficiently saved whenever it is needed. Also teach cmListFileBacktrace the notion of a file-level scope. This is useful for messages about the whole file (e.g. during parsing) that are not specific to any line within it. Push the CMakeLists.txt scope for each directory and never pop it. This ensures that we always have some context information and simplifies cmMakefile::IssueMessage. Push/pop a file-level scope as each included file is processed. This supersedes cmParseFileScope and improves diagnostic message context information in a few places. Fix the corresponding test cases to expect the improved output.
| * cmState: Avoid accumulating snapshot storage for backtracesBrad King2016-04-151-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes during post-3.3/pre-3.4 development refactored storage of most configure-time information, including variable bindings and function scopes. All scopes (even short-lived) were kept persistently for possible future debugging features, causing huge accumulated memory usage. This was mostly addressed by commit v3.4.1~4^2 (cmState: Avoid accumulating snapshot storage for short-lived scopes, 2015-11-24). Since then we still keep short-lived scopes when they are needed for a backtrace. This is because since commit v3.4.0-rc1~378^2 (cmListFileBacktrace: Implement in terms of cmState::Snapshot, 2015-05-29) backtraces have been lightweight objects that simply point into the snapshot tree. While the intention of this approach was to avoid duplicating the call stack file path strings, the cost turned out to be holding on to the entire call stack worth of scope snapshots, which is much worse. Furthermore, since commit v3.4.0-rc2~1^2 (cmIfCommand: Issue CMP0054 warning with appropriate context, 2015-10-20) all conditions used in `if()` commands hold a backtrace for use in diagnostic messages. Even though the backtrace is short-lived it still causes the scope snapshot to be kept. This means that code like function(foo) if(0) endif() endfunction() foreach(i RANGE 1000000) foo() endforeach() accumulates storage for the function call scope snapshots. Fix this by partially reverting commit v3.4.0-rc1~378^2 and saving the entire call stack during cmListFileBacktrace construction. This way we can avoid keeping short-lived scope snapshot storage in all cases.
| * cmState: Add Snapshot method to get bottom of call stackBrad King2016-04-151-0/+15
| | | | | | | | | | The bottom of the call stack is always a long-lived snapshot and can be saved for later use with cmOutputConverter.
* | Solaris: Add a CMAKE_HOST_SOLARIS variable (#16061)Stafen Teleman2016-04-151-0/+3
|/
* cmState: Rename CallStack snapshots to IncludeFileBrad King2016-04-121-5/+5
|
* Merge branch 'reduce-cmState-accumulation' into ↵Brad King2015-11-251-30/+60
|\ | | | | | | reduce-cmState-accumulation-for-master
| * cmState: Avoid accumulating snapshot storage for short-lived scopesBrad King2015-11-251-0/+29
| | | | | | | | | | We need to keep only certain snapshot types and their ancestors. Also keep those needed for backtraces.