This is an archive of the discontinued LLVM Phabricator instance.

[NFC][clang] Fix coverity static analyzer concerns about AUTO_CAUSES_COPY
AcceptedPublic

Authored by Manna on Apr 4 2023, 9:45 AM.

Details

Summary

AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

[NFC] Fix auto keyword use without an & causes the copy of an object of type SimpleRegistryEntry in clang::​getAttributePluginInstances()
[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 &)
[NFC] Fix auto keyword use without an & causes the copy of an object of type QualType in <unnamed>::​SystemZTargetCodeGenInfo::​isVectorTypeBased(clang::​Type const *, bool)
[NFC] Fix auto keyword use without an & causes the copy of an object of type Policy in <unnamed>::​RISCVIntrinsicManagerImpl::​InitIntrinsicList()
[NFC] Fix auto keyword use without an & causes the copy of an object of type pair in checkUndefinedButUsed(clang::​Sema &)

Diff Detail

Event Timeline

Manna created this revision.Apr 4 2023, 9:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 4 2023, 9:45 AM
Manna requested review of this revision.Apr 4 2023, 9:45 AM
tahonermann accepted this revision.Apr 14 2023, 1:21 PM

These changes all seem reasonable to me. Some of them look like clear wins (e.g., ParsedAttrInfo).

This revision is now accepted and ready to land.Apr 14 2023, 1:21 PM
Manna added a comment.Apr 17 2023, 6:27 PM

Thank you @tahonermann for reviews!