[NFC][clang] Fix coverity static analyzer concerns about AUTO_CAUSES_COPY
authorManna, Soumi <soumi.manna@intel.com>
Tue, 18 Apr 2023 00:50:41 +0000 (20:50 -0400)
committerManna, Soumi <soumi.manna@intel.com>
Tue, 18 Apr 2023 01:33:21 +0000 (21:33 -0400)
commit18a3d9e5b318133611ebc88bbe82ca9a2ca56f1d
tree2a8e6826603a2a860ef9cc5aa64e817811379b27
parenta2e1257589bccbd9ec65a5c9e4245e31058647d4
[NFC][clang] Fix coverity static analyzer concerns about AUTO_CAUSES_COPY

Reported by Coverity:

AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

1. [NFC] Fix auto keyword use without an & causes the copy of an object of type SimpleRegistryEntry in clang::getAttributePluginInstances()

2. [NFC] Fix auto keyword use without an & causes the copy of an object of type tuple in CheckStmtInlineAttr<clang::NoInlineAttr, 2>(clang::Sema &, clang::Stmt const *, clang::Stmt const *, clang::AttributeCommonInfo const &)

3. [NFC] Fix auto keyword use without an & causes the copy of an object of type QualType in <unnamed>::SystemZTargetCodeGenInfo::isVectorTypeBased(clang::Type const *, bool)

4. [NFC] Fix auto keyword use without an & causes the copy of an object of type Policy in <unnamed>::RISCVIntrinsicManagerImpl::InitIntrinsicList()

5. [NFC] Fix auto keyword use without an & causes the copy of an object of type pair in checkUndefinedButUsed(clang::Sema &)

Reviewed By: tahonermann

Differential Revision: <https://reviews.llvm.org/D147543>
clang/lib/Basic/ParsedAttrInfo.cpp
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaRISCVVectorLookup.cpp
clang/lib/Sema/SemaStmtAttr.cpp