Skip to content

Commit 90dc653

Browse files
authored
[CPU] Remove empty catch blocks in jit_kernel.h (#29413)
### Details: Remove bugprone suppression of any kinds of exceptions in `if_expression` destructor and `make_shared` call for registers in jit_kernel.h ### Tickets: - N/A
1 parent b24f8de commit 90dc653

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/plugins/intel_cpu/src/.clang-tidy

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
### Checks that are turned off but better be enabled later:
2323
# -bugprone-narrowing-conversions
2424
# -bugprone-easily-swappable-parameters
25-
# -bugprone-empty-catch. Better to fix, potentially hides some errors.
2625
# -bugprone-exception-escape. There are a lot of legacy code which does not handle exceptions properly and just catches them all. Major refactoring is required to correct this.
2726
# -bugprone-implicit-widening-of-multiplication-result
2827
# -bugprone-incorrect-roundings. There are explicit ways to perform rounding (i.e. std::floor(), std::round(), etc). Requires careful updates case by case
@@ -49,7 +48,6 @@ Checks: >
4948
cppcoreguidelines-prefer-member-initializer,
5049
readability-else-after-return,
5150
-bugprone-easily-swappable-parameters,
52-
-bugprone-empty-catch,
5351
-bugprone-exception-escape,
5452
-bugprone-implicit-widening-of-multiplication-result,
5553
-bugprone-incorrect-roundings,

src/plugins/intel_cpu/src/nodes/kernels/x64/jit_kernel.hpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,8 @@ class if_expression {
185185
if_expression(const boolean_expression<T>& expr) : _expr(expr) {}
186186

187187
~if_expression() {
188-
try {
189-
if (!_is_exit_valid) {
190-
_expr._kernel.assignL(_exit, _else);
191-
}
192-
} catch (...) {
188+
if (!_is_exit_valid) {
189+
_expr._kernel.assignL(_exit, _else);
193190
}
194191
}
195192

@@ -862,10 +859,7 @@ namespace internal {
862859
template <typename Reg>
863860
shared_reg<Reg> make_shared(Reg& reg, jit_kernel& kernel) {
864861
std::shared_ptr<Reg> ptr(&reg, [&kernel](Reg* preg) {
865-
try {
866-
kernel.free(*preg);
867-
} catch (...) {
868-
}
862+
kernel.free(*preg);
869863
});
870864
return ptr;
871865
}

0 commit comments

Comments
 (0)