diff options
author | Manna, Soumi <soumi.manna@intel.com> | 2023-04-07 16:37:56 -0400 |
---|---|---|
committer | Manna, Soumi <soumi.manna@intel.com> | 2023-04-07 16:38:07 -0400 |
commit | 33cf2a39cb11681068b1abaa20ffe1d4d732ae38 (patch) | |
tree | 9fa521ef20fa7e65026d19075ffdac467c11618a /llvm/docs/CommandGuide/llvm-remarkutil.rst | |
parent | 85327f307bd7cdc476e0d078c13f9c7c47341122 (diff) | |
download | llvm-33cf2a39cb11681068b1abaa20ffe1d4d732ae38.zip llvm-33cf2a39cb11681068b1abaa20ffe1d4d732ae38.tar.gz llvm-33cf2a39cb11681068b1abaa20ffe1d4d732ae38.tar.bz2 |
[NFC][clang] Fix static analyzer tool remarks about large copies by values
Reported by Coverity:
Big parameter passed by value
Copying large values is inefficient, consider passing by reference; Low, medium, and high size thresholds for detection can be adjusted.
1. Inside "SemaConcept.cpp" file, in subsumes<clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(clang::NamedDecl *, llvm::ArrayRef<clang::Expr const *>, clang::NamedDecl *, llvm::ArrayRef<clang::Expr const *>)::[lambda(clang::AtomicConstraint const &, clang::AtomicConstraint const &) (instance 2)]>(llvm::SmallVector<llvm::SmallVector<clang::AtomicConstraint *, 2u>, 4u>, llvm::SmallVector<llvm::SmallVector<clang::AtomicConstraint *, 2u>, 4u>, T1): A large function call parameter exceeding the low threshold is passed by value.
i. pass_by_value: Passing parameter PDNF of type NormalForm (size 144 bytes) by value, which exceeds the low threshold of 128 bytes.
ii. pass_by_value: Passing parameter QCNF of type NormalForm (size 144 bytes) by value, which exceeds the low threshold of 128 bytes.
2. Inside "CodeGenAction.cpp" file, in clang::reportOptRecordError(llvm::Error, clang::DiagnosticsEngine &, clang::CodeGenOptions): A very large function call parameter exceeding the high threshold is passed by value.
i. pass_by_value: Passing parameter CodeGenOpts of type clang::CodeGenOptions const (size 1560 bytes) by value, which exceeds the high threshold of 512 bytes.
3. Inside "SemaCodeComplete.cpp" file, in HandleCodeCompleteResults(clang::Sema *, clang::CodeCompleteConsumer *, clang::CodeCompletionContext, clang::CodeCompletionResult *, unsigned int): A large function call parameter exceeding the low threshold is passed by value.
i. pass_by_value: Passing parameter Context of type clang::CodeCompletionContext (size 200 bytes) by value, which exceeds the low threshold of 128 bytes.
4. Inside "SemaConcept.cpp" file, in <unnamed>::SatisfactionStackRAII::SatisfactionStackRAII(clang::Sema &, clang::NamedDecl const *, llvm::FoldingSetNodeID): A large function call parameter exceeding the low threshold is passed by value.
i. pass_by_value: Passing parameter FSNID of type llvm::FoldingSetNodeID (size 144 bytes) by value, which exceeds the low threshold of 128 bytes.
Reviewed By: erichkeane, aaron.ballman
Differential Revision: https://reviews.llvm.org/D147708
Diffstat (limited to 'llvm/docs/CommandGuide/llvm-remarkutil.rst')
0 files changed, 0 insertions, 0 deletions