[all-commits] [llvm/llvm-project] ff4d22: [NFC][clang] Fix static analyzer concerns

smanna12 via All-commits all-commits at lists.llvm.org
Sun Apr 23 15:40:16 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff4d2207db00032b8c1fff7093b0407564518855
      https://github.com/llvm/llvm-project/commit/ff4d2207db00032b8c1fff7093b0407564518855
  Author: Manna, Soumi <soumi.manna at intel.com>
  Date:   2023-04-23 (Sun, 23 Apr 2023)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ComputeDependence.cpp
    M clang/lib/ASTMatchers/Dynamic/Marshallers.h
    M clang/lib/CodeGen/CGVTables.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/utils/TableGen/ClangAttrEmitter.cpp

  Log Message:
  -----------
  [NFC][clang] Fix static analyzer concerns

Reported by Coverity:

AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

1. Inside "SemaDeclCXX.cpp" file, in <unnamed>::DiagnoseUninitializedFields(clang::Sema &, clang::CXXConstructorDecl const *): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

2. Inside "ClangAttrEmitter.cpp" file, in clang::EmitClangAttrParsedAttrImpl(llvm::RecordKeeper &, llvm::raw_ostream &): Using the auto keyword without an & causes the copy of an object of type pair.

3. Inside "Marshallers.h" file, in clang::ast_matchers::dynamic::internal::MapAnyOfBuilderDescriptor::buildMatcherCtor(clang::ast_matchers::dynamic::SourceRange, llvm::ArrayRef<clang::ast_matchers::dynamic::ParserValue>, clang::ast_matchers::dynamic::Diagnostics *): Using the auto keyword without an & causes the copy of an object of type ParserValue.

4. Inside "CGVTables.cpp" file, in clang::CodeGen::CodeGenModule::GetVCallVisibilityLevel(clang::CXXRecordDecl const *, llvm::DenseSet<clang::CXXRecordDecl const *, llvm::DenseMapInfo<clang::CXXRecordDecl const *, void>> &): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

5. Inside "ASTContext.cpp" file, in hasTemplateSpecializationInEncodedString(clang::Type const *, bool): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

6. Inside "ComputeDependence.cpp" file, in clang::computeDependence(clang::DependentScopeDeclRefExpr *): Using the auto keyword without an & causes the copy of an object of type TemplateArgumentLoc.

Reviewed By: tahonermann, erichkeane

Differential Revision: https://reviews.llvm.org/D148812




More information about the All-commits mailing list