summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.h
Commit message (Collapse)AuthorAgeFilesLines
* LICENSE: Replace references to Copyright.txt with LICENSE.rstKitware Robot2025-03-031-1/+1
| | | | | | | | | | ``` git grep -lz 'Copyright.txt or https://cmake.org/licensing ' | while IFS= read -r -d $'\0' f ; do sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / { s/Copyright.txt/LICENSE.rst/ }' "$f" ; done ```
* Revise C++ coding style using clang-format with "east const"Kitware Robot2025-01-231-7/+7
| | | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`, now with "east const" enforcement. Use `clang-format` version 18. * 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. Issue: #26123
* PrintCallStack: "Fix" entry suppressionMatthew Woehlke2024-12-071-4/+4
| | | | | | | | | | | | | | | | | | | Backtraces may contain non-specific entries (n.b. FromListFilePath in cmListFileContext). Our prior expectation is that these will ALWAYS replaced by more specific entries. However, with the previous change to allow users to create arbitrary stack entries, this is no longer the case. Modify PrintCallStack to only skip printing these non-specific entries if they were in fact preceded by a more specific entry. This, and the functionality of the preceding commit, is intended to be used for CPS dependency resolution. Because said resolution may fail at a non-trivial depth, it is important to be able to provide the user with the path of packages that led to the failure. However, because this happens through parsing JSON, there is no listfile function to associate with the stack entries, nor do we attempt to keep track of line numbers from the JSON. As a result, these entries will never be more specific than the name of the CPS file whose dependencies we are trying to locate.
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-1/+2
|
* clang-tidy: fix `bugprone-exception-escape` lintsBen Boeckel2022-05-241-3/+9
|
* cmConstStack: Factor out of cmListFileBacktraceBrad King2022-04-021-26/+8
| | | | | | | 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-3/+11
| | | | | 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-3/+6
| | | | | | | | | | | | | | | | | | | | 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-2/+3
|
* cmListFileCache: Remove cmCommandContextBrad King2022-01-251-31/+12
| | | | Subsume it inside `cmListFileFunction`.
* cmListFileCache: Rename FromCommandContext to FromListFileFunctionBrad King2022-01-251-2/+3
| | | | Accept a `cmListFileFunction` instead of a `cmCommandContext`.
* cmListFileCache: Move cmListFileFunction earlierBrad King2022-01-251-44/+44
|
* cmListFileContext: Simplify explicit rule-of-five membersBrad King2021-12-081-8/+12
|
* cmListFileBacktrace: Remove unused "Depth" methodBrad King2021-12-081-4/+0
|
* cmListFileBacktrace: Remove unused "bottom" entryBrad King2021-12-081-12/+1
| | | | | 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-6/+0
| | | | | | Move backtrace printing functions from `cmListFileBacktrace` over to `cmMessenger`, their primary caller. Thread `cmMessenger` instances through APIs needed to update other call sites.
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+1
| | | | | 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/+8
| | | | Fixes: #19153
* cmListFileCache: Make cmListFileFunction a shared pointerOleksandr Koval2020-10-011-7/+50
| | | | | 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/+8
| | | | Fixes: #19575
* cmListFileCache: Add explicit constructorsBrad King2020-09-281-0/+8
| | | | | In order to construct with an initializer list in pure C++11, add the explicit constructors.
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Add BTs helper to support multiple backtracesJustin Goshi2020-07-061-0/+26
|
* cmake_command: Add command to EVAL a CMake script as a stringCristian Adam2020-03-031-0/+3
|
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-10/+0
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-4/+4
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* clang-tidy: Pass by valueRegina Pfeifer2019-01-221-2/+2
|
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-17/+7
|
* clang-tidy: Remove redundant member initializationsRegina Pfeifer2018-12-151-5/+2
|
* cmLocalGenerator::AppendDefines: Remove const char* overloadsVitaly Stakhovsky2018-10-261-1/+2
| | | | Accept const std::string& arguments only
* cmListFileCache: Add ExpandListWithBacktrace helperBrad King2018-10-171-0/+3
|
* cmListFileCache: Add wrapper template for values with a backtraceBrad King2018-10-171-0/+29
|
* clang-tidy: restore 'misc-noexcept-move-constructor'Brad King2018-09-261-2/+4
| | | | | | We disabled this in commit 1fe0d72eb6 (clang-tidy: exclude 'misc-noexcept-move-constructor', 2018-09-24) due to false positives. Restore it and use a NOLINT comment to suppress them instead.
* cmListFileCache: Add missing assertion in backtrace Top methodBrad King2018-09-261-1/+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-11/+15
| | | | | | | | 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-4/+15
| | | | | | | | | | | | | | | | | | | | 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.
* misc: Added utility method to allow working with stacksJustin Berger2017-11-011-0/+4
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-3/+3
|
* cmListFileArgument: remove custom copy ctorDaniel Pfeifer2017-04-211-6/+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'
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-1/+0
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Split auxiliary classes into separate filesStephen Kelly2016-10-191-0/+1
| | | | | | | 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: Port dependent code to new cmStateSnapshot nameStephen Kelly2016-10-191-5/+5
|
* cmListFileBacktrace: Add a method to retrieve the Bottom of a snapshotStephen Kelly2016-10-151-0/+2
|
* 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.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+5
|
* make sure to include cmConfigure.h before cmStandardIncludes.hDaniel Pfeifer2016-09-031-0/+2
|
* Parser: Port away from cmMakefileStephen Kelly2016-08-251-2/+3
| | | | It is an unneeded dependency.