Cleanup/includes#289
Conversation
⚡ Performance (instruction count) — ✅ no regressionsper-benchmark breakdown
Deterministic callgrind instruction counts vs the base branch; gated at ±2%. Not wall-clock. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #289 +/- ##
==========================================
+ Coverage 88.26% 88.44% +0.17%
==========================================
Files 284 284
Lines 10983 11013 +30
Branches 3421 3435 +14
==========================================
+ Hits 9694 9740 +46
+ Misses 1249 1233 -16
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
make a decl of the destructor in this file and its impl in the .cpp file to get rid of the pragma: keep
There was a problem hiding this comment.
Only of interest for molecularVirial.hpp and potentialBruteForce.hpp, because all other includes are participating in return types. Furthermore, the two mentioned includes need to be seen due to the conversion to their base class...
There was a problem hiding this comment.
I dont get this comment? the pragma keep definitely indocates somewhere a bug.
Why exactly do we need this here?
There was a problem hiding this comment.
okay, lets consider PotentialBruteForce as example: when I remove the line
#include "potentialBruteForce.hpp" // IWYU pragma: keep
The following error is flagged on line 71:
No viable conversion from 'shared_ptr<_NonArray<potential::PotentialBruteForce>>' to 'shared_ptr<potential::Potential>'clang(typecheck_nonviable_condition)
so the include is needed. However, also the // IWYU pragma: keep is needed, otherwise clangd complains. Why? Because the alias pq::BruteForcePot defined in typeAliases.hpp is used and not potential::PotentialBruteForce, which would be defined in potentialBruteForce.hpp
| } // namespace forceField | ||
|
|
||
| #include "forcefield.tpp.hpp" // DO NOT MOVE THIS LINE | ||
| #include "forcefield.tpp.hpp" // IWYU pragma: keep - DO NOT MOVE THIS LINE |
There was a problem hiding this comment.
#ifndef _FORCE_FIELD_TPP_
#include "forcefield.tpp.hpp" // IWYU pragma: keep - DO NOT MOVE THIS LINE
#endif // _FORCE_FIELD_TPP_
There was a problem hiding this comment.
@97gamjak does not work on my end, clangd keeps flagging that the include is not directly used...
There was a problem hiding this comment.
try using a .clang-tidy file to handle this
| - typecheck_expression_not_modifiable_lvalue No newline at end of file | ||
| Suppress: | ||
| - pp_including_mainfile_in_preamble | ||
| - typecheck_expression_not_modifiable_lvalue |
There was a problem hiding this comment.
i think none of these suppressions should be needed... why are they here?
There was a problem hiding this comment.
- typecheck_expression_not_modifiable_lvalue is needed to suppress an error that occurs in unicode.h, which is used indirectly by the chrono header, which is in turn used by typeAliases.hpp, which is everywhere...
the error that is flagged:
In included file: expression is not assignableclang(typecheck_expression_not_modifiable_lvalue)
unicode.h(807, 4): Error occurred here
- pp_file_not_found is needed to suppress this error:
In included file: 'Eigen/Dense' file not found
matrixClass.hpp(29, 10): Error occurred here
- pp_including_mainfile_in_preamble enables us to add an .hpp file into the associated .tpp.hpp file without this kind of error being flagged:
In included file: main file cannot be included recursively when building a preamble
vector3dClass.hpp(150, 10): Error occurred here
There was a problem hiding this comment.
first error should je suppressed by suppressibg external dependencies
There was a problem hiding this comment.
second error leans we have a problem in our cmake
There was a problem hiding this comment.
third error needs to be investigated
There was a problem hiding this comment.
first error should je suppressed by suppressibg external dependencies
I haven't found a way to easily do this. However, I found the root cause, which is a bug in gcc/14 and lower. Using gcc/15.2.0 resolved the error flagged by clangd and I will remove the associated line in the .clangd file.
There was a problem hiding this comment.
I dont get this comment? the pragma keep definitely indocates somewhere a bug.
Why exactly do we need this here?
This PR solves issue #285