summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add new flow-control commands for variables and policies scopes managementMarc Chevrier2022-08-221-0/+11
| | | | | | | Add block() and endblock() commands offering the capability to create new scopes for variables and/or policies. Fixes: #20171
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-2/+2
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* clang-tidy: address `modernize-use-default-member-init` lintsBen Boeckel2022-05-241-2/+1
|
* cmConstStack: Factor out of cmListFileBacktraceBrad King2022-04-021-48/+3
| | | | | | | This presents value semantics for a stack of constant values. Internally it shares ownership to avoid copies. Previously this was implemented by `cmListFileBacktrace` explicitly, but the approach can be re-used for other kinds of stacks.
* cmListFileBacktrace: Clarify call sites that only push a file pathBrad King2022-04-011-11/+0
| | | | | This removes the last part of the `cmListFileBacktrace` interface that needs to know the type of data in its stack.
* Trace: include `line_end` field in json-v1 formatBraulio Valdivielso Martinez2022-02-091-1/+3
| | | | | | | | | | | | | | | | | | | | After !6954 got merged, it has become easier for tools to get full stack-traces for runtime traces of a CMake program. The trace information already included in the JSON objects (line number, source file path) allows tools that display these stack traces to print the CMake source code associated to them. However, CMake commands may spawn multiple lines, and the JSON information associated to a trace only contains the line in which the command started, but not the one in which it ended. If tools want to print stack traces along the relevant source code, and they want to print the whole command associated to the stack frame, they will have to implement their own CMake language parser to know where the command ends. In order to simplify the life of those who want to write tooling for CMake, this commit adds a `line_end` field to the json-v1 trace format. If a given command spans multiple lines, the `line_end` field will contain the line of the last line spanned by the command (that of the closing parenthesis associated to the command).
* cmExpandListWithBacktrace: add handling of empty elements.Marc Chevrier2022-02-061-3/+3
|
* cmListFileCache: Rename FromCommandContext to FromListFileFunctionBrad King2022-01-251-14/+14
| | | | Accept a `cmListFileFunction` instead of a `cmCommandContext`.
* cmListFileBacktrace: Remove unused "Depth" methodBrad King2021-12-081-11/+0
|
* cmListFileBacktrace: Remove unused "bottom" entryBrad King2021-12-081-46/+4
| | | | | All uses of `GetBottom` by clients have been removed, so drop the method and its supporting infrastructure.
* cmMessenger: Adopt backtrace printing functionsBrad King2021-12-081-48/+0
| | | | | | Move backtrace printing functions from `cmListFileBacktrace` over to `cmMessenger`, their primary caller. Thread `cmMessenger` instances through APIs needed to update other call sites.
* cmake: Model normal and try-compile project kinds explicitlyBrad King2021-07-121-2/+2
| | | | | Construct with the project kind instead of mutating state after construction.
* cmListFileCache: Simplify relative path conversion in backtracesBrad King2021-05-171-3/+2
| | | | | | | | Printing paths to CMake input files does not need to use the generator-wide relative path conversion rules because we are not actually generating a relative path for the build system that needs to be consistent with anything else. Instead, simply print a relative path if it does not need to start in `../`, and otherwise an absolute path.
* cmStateDirectory: Rename ConvertToRelPathIf{Not => }ContainedBrad King2021-05-121-2/+2
| | | | The "Not" in the method name is backward from its logic.
* cmake: Fix loading CMake sources from long paths on WindowsMatt Jaeger2021-03-251-1/+11
| | | | Pass a Windows extended path to the lexer so it can open long paths.
* clang-tidy: fix `readability-make-member-function-const` warningsBen Boeckel2021-01-271-2/+2
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-2/+2
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmListFileCache: Enforce proper nesting of flow control statementsKyle Edwards2020-10-221-0/+118
| | | | Fixes: #19153
* cmListFileCache: Make cmListFileFunction a shared pointerOleksandr Koval2020-10-011-14/+9
| | | | | Passing cmListFileFunction everywhere by-value involves big overhead. Now cmListFileFunction stores std::shared_ptr to the underlying data.
* cmake_language: Add signature to DEFER calls to later timesBrad King2020-09-291-2/+5
| | | | Fixes: #19575
* cmake_command: Add command to EVAL a CMake script as a stringCristian Adam2020-03-031-8/+43
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-5/+5
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: Resolve performance-unnecessary-value-param diagnosticsBrad King2019-09-091-0/+1
| | | | | | Fix diagnostics that appear on macOS with clang-tidy-8. Suppress cases where we intentionally take an argument by value to let the caller choose whether to copy or move.
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+1
| | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-1/+2
|
* cmListFileCache: When missing ending ) print starting line instead of last oneBartosz Kosiorek2019-06-031-5/+2
| | | | Fixes: #19301
* Delete some default constructors and assignment operatorsAlbert Astals Cid2019-02-151-0/+2
| | | | | | They are unused, but if someone used them they would lead to problems since they would copy the internal raw pointers and the destructor would cause double delete
* Merge topic 'cmoutputconverter-simplify'Brad King2019-01-291-5/+3
|\ | | | | | | | | | | | | b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2831
| * cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.Bruno Manganelli2019-01-271-5/+3
| |
* | Silence -Wcomma warningBrad King2019-01-231-2/+3
| | | | | | | | | | | | | | We use a comma-in-paren expression to evaluate multiple statements in a condition. Clang warns that this may be incorrect. Follow its suggestion to cast all but the last expression to `void` to silence the warning.
* | clang-tidy: Pass by valueRegina Pfeifer2019-01-221-4/+3
|/
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-6/+7
| | | | Reduce the number of files relying on `cmake.h`.
* cmLocalGenerator::AppendDefines: Remove const char* overloadsVitaly Stakhovsky2018-10-261-1/+1
| | | | Accept const std::string& arguments only
* cmListFileCache: Add ExpandListWithBacktrace helperBrad King2018-10-171-0/+13
|
* cmListFileCache: Add wrapper template for values with a backtraceBrad King2018-10-171-1/+6
|
* cmListFileCache: Add missing assertion in backtrace Top methodBrad King2018-09-261-0/+1
| | | | | We can only get the top of a stack that has at least one call. Update the method's comment accordingly.
* cmListFileCache: Refactor cmListFileBacktrace internalsBrad King2018-09-241-89/+75
| | | | | | | | Replace use of raw pointers and explicit reference counting with `std::shared_ptr<>`. Use a discriminated union to store either the bottom level or a call/file context in each heap-allocated entry. This avoids storing a copy of the bottom in every `cmListFileBacktrace` instance and shrinks the structure to a single `shared_ptr`.
* Revise implementation of case-insensitive command namesFlorian Jacomme2018-05-221-0/+8
| | | | | | | | | | | | | | | | | | | | Store both the as-written and lower-case command names and use the latter to avoid case-insensitive string comparisons. With this I obtain 2-6% speed increase (on Windows) for the configure step with no significant changes in memory usage. A case-insensitive comparison is a lot slower than just calling `==` because the operator will use things like memcmp, so prefer the latter. The `cmSystemTools::LowerCase` function allocates a new string each time it is called, so before this change we were allocating in: * cmMakefile::Configure two times for each function (to look for `cmake_minimum_required` and `project`) * cmMakefile::ExecuteCommand twice by function by calling cmState::GetCommand and copying the name Now we are only allocating once by function instead of four.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* misc: Added utility method to allow working with stacksJustin Berger2017-11-011-0/+13
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+0
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-4/+4
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-3/+5
|
* clang-tidy: avoid copyDaniel Pfeifer2017-04-211-2/+3
|
* 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'
* cmListFileLexer: bail out on seek-errorsGregor Jasny2017-02-271-0/+7
| | | | | | | If we are given a FIFO, for example, we cannot seek back after trying to read a Byte-Order-Mark. Closes: #16607
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Port dependent code to new cmStateSnapshot nameStephen Kelly2016-10-191-3/+3
|
* 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.