Definition at line 65 of file clang_tidy_rules.py.
68 for i
in range(0, len(lines)):
71 if "/arm_conv/" in line:
74 if "/arm_gemm/" in line:
77 if "compute_kernel_writer/" in line:
80 if "/convolution/" in line:
83 if "/validate_examples/" in line:
87 if ((
"Version.cpp" in line
and "arm_compute_version.embed" in line
and "file not found" in line)
or
88 (
"arm_fp16.h" in line)
or
90 (
"cast from pointer to smaller type 'uintptr_t' (aka 'unsigned int') loses information" in line)
or
91 (
"cast from pointer to smaller type 'cl_context_properties' (aka 'int') loses information" in line)
or
92 (
"cast from pointer to smaller type 'std::uintptr_t' (aka 'unsigned int') loses information" in line)
or
93 (
"NEMath.inl" in line
and "statement expression not allowed at file scope" in line)
or
94 (
"Utils.h" in line
and "no member named 'unmap' in 'arm_compute::Tensor'" in line)
or
95 (
"Utils.h" in line
and "no member named 'map' in 'arm_compute::Tensor'" in line)
or
96 (
"CPUUtils.cpp" in line
and "'asm/hwcap.h' file not found" in line)
or
97 (
"CPUUtils.cpp" in line
and "use of undeclared identifier 'HWCAP_SVE'" in line)
or
99 (
"'arm_compute_version.embed' file not found" in line) ):
105 elif "warning:" in line:
106 if (
"uninitialized record type: '__ret'" in line
or
107 "local variable '__bound_functor' is still referred to by the global variable '__once_callable'" in line
or
108 "assigning newly created 'gsl::owner<>'" in line
or
109 "calling legacy resource function without passing a 'gsl::owner<>'" in line
or
110 "deleting a pointer through a type that is not marked 'gsl::owner<>'" in line
or
111 (any(f
in line
for f
in [
"Error.cpp",
"Error.h"])
and "thrown exception type is not nothrow copy constructible" in line)
or
112 (any(f
in line
for f
in [
"Error.cpp",
"Error.h"])
and "uninitialized record type: 'args'" in line)
or
113 (any(f
in line
for f
in [
"Error.cpp",
"Error.h"])
and "do not call c-style vararg functions" in line)
or
114 (any(f
in line
for f
in [
"Error.cpp",
"Error.h"])
and "do not define a C-style variadic function" in line)
or
115 (
"TensorAllocator.cpp" in line
and "warning: pointer parameter 'ptr' can be pointer to const" in line)
or
116 (
"TensorAllocator.cpp" in line
and "warning: do not declare C-style arrays" in line)
or
117 (
"RawTensor.cpp" in line
and "warning: pointer parameter 'ptr' can be pointer to const" in line)
or
118 (
"RawTensor.cpp" in line
and "warning: do not declare C-style arrays" in line)
or
119 (
"NEMinMaxLocationKernel.cpp" in line
and "move constructors should be marked noexcept" in line)
or
120 (
"NEMinMaxLocationKernel.cpp" in line
and "move assignment operators should be marked noexcept" in line)
or
121 (
"CLMinMaxLocationKernel.cpp" in line
and "Forming reference to null pointer" in line)
or
122 (
"PMUCounter.cpp" in line
and "consider replacing 'long long' with 'int64'" in line)
or
123 (
"Validation.cpp" in line
and "parameter 'classified_labels' is unused" in line)
or
124 (
"Validation.cpp" in line
and "parameter 'expected_labels' is unused" in line)
or
125 (
"Reference.cpp" in line
and "parameter 'rois' is unused" in line)
or
126 (
"Reference.cpp" in line
and "parameter 'shapes' is unused" in line)
or
127 (
"Reference.cpp" in line
and re.search(
r"parameter '[^']+' is unused", line))
or
128 (
"ReferenceCPP.cpp" in line
and "parameter 'rois' is unused" in line)
or
129 (
"ReferenceCPP.cpp" in line
and "parameter 'srcs' is unused" in line)
or
130 (
"ReferenceCPP.cpp" in line
and re.search(
r"parameter '[^']+' is unused", line))
or
131 (
"NEGEMMMatrixMultiplyKernel.cpp" in line
and "do not use C-style cast to convert between unrelated types" in line)
or
132 (
"NEPoolingLayerKernel.cpp" in line
and "do not use C-style cast to convert between unrelated types" in line)
or
133 (
"NESoftmaxLayerKernel.cpp" in line
and "macro argument should be enclosed in parentheses" in line)
or
134 (
"GraphUtils.cpp" in line
and "consider replacing 'unsigned long' with 'uint32'" in line)
or
135 (
"GraphUtils.cpp" in line
and "consider replacing 'unsigned long' with 'uint64'" in line)
or
136 (
"ConvolutionLayer.cpp" in line
and "move assignment operators should be marked noexcept" in line)
or
137 (
"ConvolutionLayer.cpp" in line
and "move constructors should be marked noexcept" in line)
or
138 (
"parameter 'memory_manager' is unused" in line)
or
139 (
"parameter 'memory_manager' is copied for each invocation but only used as a const reference" in line)
or
140 (
"DeconvolutionLayer.cpp" in line
and "casting (double + 0.5) to integer leads to incorrect rounding; consider using lround" in line)
or
141 (
"NEWinogradLayerKernel.cpp" in line
and "use '= default' to define a trivial destructor" in line)
or
142 (
"NEGEMMLowpMatrixMultiplyCore.cpp" in line
and "constructor does not initialize these fields" in line)
or
143 (
"NEGEMMLowpAssemblyMatrixMultiplyCore" in line
and "constructor does not initialize these fields" in line)
or
144 (
"CpuDepthwiseConv2dNativeKernel" in line
and re.search(
r"parameter '[^']+' is unused", line))
or
145 (
"CpuDepthwiseConv2dAssemblyDispatch" in line
and re.search(
r"parameter '[^']+' is unused", line))
or
146 (
"CpuDepthwiseConv2dAssemblyDispatch" in line
and "modernize-use-equals-default" in line)
or
147 (
"CPUUtils.cpp" in line
and "consider replacing 'unsigned long' with 'uint64'" in line)
or
148 (
"CPUUtils.cpp" in line
and "parameter 'cpusv' is unused" in line)
or
149 (
"CPUUtils.cpp" in line
and "warning: uninitialized record type" in line)
or
150 (
"Utils.h" in line
and "warning: Use of zero-allocated memory" in line)
or
152 (
"CpuDepthwiseConv2dNativeKernel.cpp" in line
and "misc-non-private-member-variables-in-classes" in line)):
156 if "do not use C-style cast to convert between unrelated types" in line:
157 if i + 1 < len(lines)
and "vgetq_lane_f16" in lines[i + 1]:
161 if "use 'using' instead of 'typedef'" in line:
162 if i + 1 < len(lines)
and "BOOST_FIXTURE_TEST_SUITE" in lines[i + 1]:
166 if "do not call c-style vararg functions" in line:
167 if (i + 1 < len(lines)
and
168 (
"BOOST_TEST" in lines[i + 1]
or
169 "BOOST_FAIL" in lines[i + 1]
or
170 "BOOST_CHECK_THROW" in lines[i + 1]
or
171 "ARM_COMPUTE_ERROR_VAR" in lines[i + 1]
or
172 "ARM_COMPUTE_RETURN_ON" in lines[i + 1]
or
173 "syscall" in lines[i + 1])):
179 elif ((
"CLMinMaxLocationKernel.cpp" in line
and "'?' condition is false" in line)
or
180 (
"CLMinMaxLocationKernel.cpp" in line
and "Assuming the condition is false" in line)
or
181 (
"CLMinMaxLocationKernel.cpp" in line
and "Assuming pointer value is null" in line)
or
182 (
"CLMinMaxLocationKernel.cpp" in line
and "Forming reference to null pointer" in line)):
References update_supported_ops.format, and arm_compute::test::validation::reference.range().