Martin Hořeňovský
cb6d713774
Add lifetimebound annotation to StringRef
2025-10-04 16:12:17 +02:00
Martin Jeřábek
cde3509664
Fix various useful clang-tidy warnings
...
* bugprone-branch-clone
* bugprone-copy-constructor-init
* bugprone-empty-catch
* bugprone-sizeof-expression
* bugprone-switch-missing-default-case
* bugprone-unused-local-non-trivial-variable
* clang-analyzer-core.uninitialized.Assign
* clang-analyzer-cplusplus.Move
* clang-analyzer-optin.cplusplus.VirtualCall
* modernize-loop-convert
* modernize-raw-string-literal
* modernize-use-equals-default
* modernize-use-override
* modernize-use-using
* performance-avoid-endl
* performance-inefficient-string-concatenation
* performance-inefficient-vector-operation
* performance-noexcept-move-constructor
* performance-unnecessary-value-param (and improve generator example)
* readability-duplicate-include
* readability-inconsistent-declaration-parameter-name
* readability-non-const-parameter
* readability-redundant-casting
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-static-accessed-through-instance
* unused variable in amalgamted tests
2024-03-01 21:24:45 +01:00
Martin Hořeňovský
5d637d4c6b
Args and TokenStream use StringRefs instead of std::strings
...
Because TokenStream is copied around a lot, moving it to use
`StringRef` removes _a lot_ of allocations per `Opt` in the parser.
Args are not copied around much, but changing them as well makes it
obvious that they do not participate in the ownership.
The changes add up to removing ~180 allocations for "empty"
invocation of the test binary.
(`./tests/ExtraTests/NoTests --allow-running-no-tests -o /dev/null`
is down to 317 allocs)
2023-12-27 16:24:33 +01:00
Martin Hořeňovský
cd3c7ebe87
Use StringRef for Opt's optNames
...
Removes another ~70 allocations.
2023-12-26 16:03:22 +01:00
Martin Hořeňovský
e1dbad4c9e
Inline StringRef::operator==
...
This enables its inlining even without LTO, which in turns enables
callers to determine that two StringRefs are unequals with simple
comparison of two numbers, without any function calls.
2023-02-20 15:05:09 +01:00
Lars Toenning
f1084fb309
Fix references to license file
...
The license file was renamed with 6a502cc2f5
2022-10-28 11:30:15 +02:00
Martin Hořeňovský
b9baae6d93
Cleanup StringRef impl a bit
2021-11-23 23:16:46 +01:00
Martin Hořeňovský
21b99d6f58
Add StringRef::compare for three way comparison
2021-09-27 18:41:17 +02:00
Martin Hořeňovský
4113a12c69
Fix Wreserved-identifier for UDLs in Catch2
...
See #578
2021-08-19 19:15:46 +02:00
Martin Hořeňovský
f1d7a10e06
Remove StringRef::isNullTerminated and StringRef::c_str
...
Both of them were fundamentally unsafe to use and shouldn't be used
at all.
2021-03-26 21:11:44 +01:00
Martin Hořeňovský
90aeffb97d
Add standardized copyright notice + SPDX identifier to source files
...
This should also be done for test files, but that has lower priority.
2020-08-30 15:43:45 +02:00
Martin Hořeňovský
a822cb9717
Standardize include guard patterns to FILE_NAME_EXTENSION_INCLUDED
...
This commit also strips the old copyright comment header in touched
files, as those will also be replaced with a more standardized and
machine-friendly version.
2020-08-30 14:09:27 +02:00
Martin Hořeňovský
317145514f
Add op+(StringRef, StringRef) -> std::string
2020-05-31 22:30:41 +02:00
Martin Hořeňovský
9e498278be
Move StringRef header to internals
2020-05-10 10:09:01 +02:00