[NFC][clang] Fix Coverity static analyzer tool concerns about auto_causes_copy
authorManna, Soumi <soumi.manna@intel.com>
Wed, 5 Apr 2023 19:41:54 +0000 (15:41 -0400)
committerManna, Soumi <soumi.manna@intel.com>
Wed, 5 Apr 2023 20:00:45 +0000 (16:00 -0400)
commit59cb47015a184862f3709a7ab084ccd086816176
tree574761c8f123ae7010026c7434b8777d9ab95b52
parentc37b95b515a5c69b2050c8fd50f076368742c6cb
[NFC][clang] Fix Coverity static analyzer tool concerns about auto_causes_copy

    Reported by Coverity:

    AUTO_CAUSES_COPY
    Unnecessary object copies can affect performance

    Inside FrontendActions.cpp file,
    In clang::DumpModuleInfoAction::ExecuteAction(): Using the auto keyword without an & causes the copy of an object of type pair.

    Inside ComputeDependence.cpp file,
    In clang::computeDependence(clang::OverloadExpr *, bool, bool, bool): Using the auto keyword without an & causes the copy of an object of type TemplateArgumentLoc.

    Reviewed By: erichkeane, aaron.ballman

    Differential Revision: https://reviews.llvm.org/D147574
clang/lib/AST/ComputeDependence.cpp
clang/lib/Frontend/FrontendActions.cpp