40 Commits

Author SHA1 Message Date
Konstantinos Margaritis
689556d5f9
Various cppcheck fixes (#337) 2025-05-30 12:27:28 +03:00
gtsoul-tech
0f4369bf22
Bug fix/clang-tidy-performance (#300)
Various clang-tidy-performance fixes:
* noexcept
* performance-noexcept-swap
* performance
* performance-move-const-arg
* performance-unnecessary-value-param
* performance-inefficient-vector-operation
* performance-no-int-to-ptr
* add performance
* performance-inefficient-string-concatenation
* clang-analyzer-deadcode.DeadStores
* performance-inefficient-vector-operation
* clang-analyzer-core.NullDereference
* clang-analyzer-core.UndefinedBinaryOperatorResult
* clang-analyzer-core.CallAndMessage

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
2024-06-20 14:57:19 +03:00
g. economou
22c3e3da6e
Merge branch 'develop' into wip-cppcheck271-part2 2024-05-17 11:08:09 +03:00
G.E
f2cecfd0e2 next batch 2024-05-17 10:44:28 +03:00
Konstantinos Margaritis
a255600773
Merge pull request #277 from isildur-g/wip-cppcheck271
phase 1 of addressing cppcheck useStlAlgorithm warnings for fill and copy operations
2024-05-15 10:44:15 +03:00
G.E
4cefba5ced phase 1 of addressing cppcheck useStlAlgorithm warnings,
this set only includes fill and copy operations.
2024-05-14 17:37:38 +03:00
gtsoul-tech
fc272868b8 fixes left_id and suffix_id 2024-05-13 13:04:57 +03:00
gtsoul-tech
94b17ecaf2 noExplicitConstructor 2024-05-10 10:07:47 +03:00
G.E.
b0916df825 one more place to fix where clang in bsd is more picky than gcc in linux 2024-04-15 11:44:22 +03:00
Konstantinos Margaritis
0d2f9ccbaa Fix 'unqualified call to std::move' errors in clang 15+ 2023-10-03 20:24:39 +03:00
Robert Schulze
8f26c5e65f
Fix compilation with libcxx 16
After upgrading our (ClickHouse's) libcxx from 15 to 16, the compiler
started to complain about usage of an incomplete type "RoseInstruction"
in this (header) function:

  void RoseProgram::replace(Iter it, std::unique_ptr<RoseInstruction> ri) {
    ...

The reason is that libcxx 16 is the first version which implements C++23
constexpr std::unique_ptr (P2273R3, see (*)). RoseProgram::replace()
happens to be be const-evaluatable and the compiler tries to run
std::unique_ptr's ctor + dtor. This fails because at this point
RoseInstruction isn't defined yet.

There are two ways of fixing this:
1. Include rose_build_instruction.h (which contains RoseInstruction)
   into rose_build_program.h. Disadvantage: The new include will
   propagate transitively into all callers.
2. Move the function implementation into the source file which sees
   RoseInstruction's definition already. Disadvantage: Template
   instantiation is no longer automatic, instead there must be either a)
   explicit template instantiation (e.g. in rose_build_program.cpp) or
   b) all callers which instantiate the function must live in the same
   source file and do the instantiations by themselves. Fortunately, the
   latter is the case here, but potential future code outside
   rose_build_program.cpp will require ugly explicit instantiation.

(*) https://en.cppreference.com/w/cpp/23
2023-03-28 21:58:44 +00:00
Konstantinos Margaritis
e35b88f2c8 use STL make_unique, remove wrapper header, breaks C++17 compilation 2021-10-12 11:51:34 +03:00
Konstantinos Margaritis
556206f138 replace push_back by emplace_back where possible 2021-10-12 11:51:33 +03:00
Hong, Yang A
dea7c4dc2e lookaround:
add 64x8 and 64x16 shufti models
add mask64 model
expand entry quantity
2021-01-25 14:13:13 +02:00
Chang, Harry
1f4c10a58d Logical combination: support EOD match from purely negative case. 2019-08-13 14:50:07 +08:00
Chang, Harry
8a1c497f44 Logical Combination of patterns. 2018-06-27 14:04:57 +08:00
Justin Viiret
ce7cfbde82 misc: docs, typo fixes, small cleanups 2018-06-27 13:39:05 +08:00
Justin Viiret
9cf66b6ac9 util: switch from Boost to std::unordered set/map
This commit replaces the ue2::unordered_{set,map} types with their STL
versions, with some new hashing utilities in util/hash.h. The new types
ue2_unordered_set<T> and ue2_unordered_map<Key, T> default to using the
ue2_hasher.

The header util/ue2_containers.h has been removed, and the flat_set/map
containers moved to util/flat_containers.h.
2017-08-21 11:14:55 +10:00
Wang, Xiang W
86c5f7feb1 FDR: Squash buckets of included literals in FDR confirm
- Change the compile of literal matchers to two passes.
 - Reverse the bucket assignment in FDR, bucket with longer literals has
   smaller bucket id.
 - Squash the buckets of included literals and jump to the the program of
   included literals directly from parent literal program without going
   through FDR confirm for included iterals.
2017-08-21 11:12:36 +10:00
Justin Viiret
72387e0de4 lookarounds: don't reconfirm bytes in hwlm mask 2017-08-21 11:09:23 +10:00
Alex Coyte
2b1a7da188 deterministic assembleProgramBlocks() 2017-05-30 13:59:00 +10:00
Alex Coyte
15c8a7bd98 rose: rework storage of extra lookaround information
- remove explicit lookaround table from bytecode
- make the RoseInstr responsible for adding required info to blob
2017-05-30 13:59:00 +10:00
Alex Coyte
097d73c7ff pass roleStateIndices by reference 2017-05-30 13:58:59 +10:00
Justin Viiret
8b9328fe9e rose: replace RoseLiteralMap use of bimap
This apoproach is simpler and more efficient for cases with large
numbers of literals.
2017-05-30 13:58:59 +10:00
Alex Coyte
bb29aeb298 rose: shift program construction functions to rose_build_program 2017-05-30 13:58:32 +10:00
Alex Coyte
1287b70f4b split out instruction details to own files 2017-05-30 13:58:32 +10:00
Alex Coyte
f74f475189 rose_program: merge RECORD_ANCHORED instruction into ANCHORED_DELAY 2017-05-30 13:58:32 +10:00
Alex Coyte
e24c38a85c rose: minor improvements to avoid unneeded program instructions
- strip out lonely check handled instructions
- avoid producing programs for empty ghost roles
2017-05-30 13:58:32 +10:00
Alex Coyte
a810bac8f7 be more selective about generating CLEAR_WORK_DONE instructions 2017-05-30 13:58:32 +10:00
Justin Viiret
b6047ea5d4 rose: use bytecode_ptr for interpreter programs 2017-04-26 15:19:36 +10:00
Alex Coyte
37cb93e60f rose_build: reduce size/scope of context objects 2017-04-26 15:19:01 +10:00
Xu, Chi
ae3cb7de6f rose: add multi-path shufti 16x8, 32x8, 32x16, 64x8 and multi-path lookaround instructions. 2017-04-26 15:18:56 +10:00
Justin Viiret
18f843bcc1 rose: add CLEAR_WORK_DONE instruction
Preparatory work for allowing fragments to be shared between literals
that squash groups and those that don't.
2017-04-26 15:18:26 +10:00
Justin Viiret
eb14792a63 rose: group final ids by fragment 2017-04-26 14:41:29 +10:00
Justin Viiret
07a6b6510c rose/hwlm: limit literals to eight bytes
Rework HWLM to work over literals of eight bytes ("medium length"),
doing confirm in the Rose interpreter.
2017-04-26 14:41:29 +10:00
Justin Viiret
68bf473e2e fdr: move long literal handling into Rose
Move the hash table used for long literal support in streaming mode from
FDR to Rose, and introduce new instructions CHECK_LONG_LIT and
CHECK_LONG_LIT_NOCASE for doing literal confirm for long literals.

This simplifies FDR confirm, and guarantees that HWLM matchers will only
be used for literals < 256 bytes long.
2016-10-28 14:52:26 +11:00
Xu, Chi
997787bd4b rose: add CHECK_SINGLE_LOOKAROUND instruction
This specialisation is cheaper than the shufti-based variants, so we
prefer it for single character class tests.
2016-10-28 14:47:04 +11:00
Xu, Chi
04d79629de rose: add shufti-based lookaround instructions
More lookaround specialisations that use the shufti approach.
2016-10-28 14:46:27 +11:00
Justin Viiret
9139123642 rose: move sparse iter cache to RoseEngineBlob
This enables its use for iterators written by instructions.
2016-10-28 14:45:32 +11:00
Justin Viiret
13af3bfb74 rose: decouple build-time program representation
This commit replaces the build-time representation of the Rose
interpreter programs, from a class containing a discriminated union of
the bytecode structures to a class hierarchy of build-time prototypes.

This makes it easier to reason about and manipulate Rose programs during
compilation.
2016-10-28 14:45:15 +11:00