Bug fix/clang tidy warnings part3 (#298)

* clang-analyzer-deadcode.DeadStores

* clang-analyzer-optin.performance.Padding

---------

Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
This commit is contained in:
gtsoul-tech 2024-06-10 10:08:54 +03:00 committed by GitHub
parent 834a329daa
commit a68845c82b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 10 deletions

View File

@ -206,8 +206,7 @@ bytecode_ptr<FDR> FDRCompiler::setupFDR() {
assert(ISALIGNED_CL(ptr)); assert(ISALIGNED_CL(ptr));
fdr->floodOffset = verify_u32(ptr - fdr_base); fdr->floodOffset = verify_u32(ptr - fdr_base);
memcpy(ptr, floodTable.get(), floodTable.size()); memcpy(ptr, floodTable.get(), floodTable.size());
ptr += floodTable.size(); // last write, no need to round up
return fdr; return fdr;
} }

View File

@ -597,7 +597,7 @@ bytecode_ptr<FDR> TeddyCompiler::build() {
assert(ISALIGNED_CL(ptr)); assert(ISALIGNED_CL(ptr));
teddy->floodOffset = verify_u32(ptr - teddy_base); teddy->floodOffset = verify_u32(ptr - teddy_base);
memcpy(ptr, floodTable.get(), floodTable.size()); memcpy(ptr, floodTable.get(), floodTable.size());
ptr += floodTable.size();
// Write teddy masks. // Write teddy masks.
u8 *baseMsk = teddy_base + ROUNDUP_CL(headerSize); u8 *baseMsk = teddy_base + ROUNDUP_CL(headerSize);

View File

@ -39,7 +39,7 @@ namespace ue2 {
#define TEDDY_BUCKET_LOAD 6 #define TEDDY_BUCKET_LOAD 6
struct TeddyEngineDef { struct TeddyEngineDef { //NOLINT (clang-analyzer-optin.performance.Padding)
u32 id; u32 id;
u64a cpu_features; u64a cpu_features;
u32 numMasks; u32 numMasks;

View File

@ -163,12 +163,12 @@ struct LimExNFA##size { \
m512 exceptionAndMask; /**< exception and mask */ \ m512 exceptionAndMask; /**< exception and mask */ \
}; };
CREATE_NFA_LIMEX(32) CREATE_NFA_LIMEX(32) //NOLINT (clang-analyzer-optin.performance.Padding)
CREATE_NFA_LIMEX(64) CREATE_NFA_LIMEX(64) //NOLINT (clang-analyzer-optin.performance.Padding)
CREATE_NFA_LIMEX(128) CREATE_NFA_LIMEX(128) //NOLINT (clang-analyzer-optin.performance.Padding)
CREATE_NFA_LIMEX(256) CREATE_NFA_LIMEX(256) //NOLINT (clang-analyzer-optin.performance.Padding)
CREATE_NFA_LIMEX(384) CREATE_NFA_LIMEX(384) //NOLINT (clang-analyzer-optin.performance.Padding)
CREATE_NFA_LIMEX(512) CREATE_NFA_LIMEX(512) //NOLINT (clang-analyzer-optin.performance.Padding)
/** \brief Structure describing a bounded repeat within the LimEx NFA. /** \brief Structure describing a bounded repeat within the LimEx NFA.
* *