summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Convert: Remove last uses of HOME enum valueStephen Kelly2016-09-191-4/+4
|
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+5
|
* Improve error message on unexpected end of fileBrad King2016-08-301-2/+1
| | | | Suggested-by: Stephen Kelly <steveire@gmail.com>
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-2/+4
|
* Parser: Port away from cmMakefileStephen Kelly2016-08-251-15/+16
| | | | It is an unneeded dependency.
* Parser: Issue messages through cmake, not cmSystemToolsStephen Kelly2016-08-251-30/+40
| | | | | Make these messages uniform with regard to other messages issued by cmake.
* Parser: Store the Backtrace for use in issuing messagesStephen Kelly2016-08-241-0/+2
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-6/+4
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-3/+3
|
* Parser: Out-of-line conditional code to cmMakefileStephen Kelly2016-06-131-71/+1
| | | | Simplify parser API.
* Parser: Issue file open error messages through dedicated APIStephen Kelly2016-06-131-6/+9
|
* Parser: Merge identical conditionsStephen Kelly2016-06-081-3/+0
|