[PATCH] D148812: [NFC][clang] Fix static analyzer concerns

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 21 07:36:39 PDT 2023


erichkeane added a comment.

Still had this convo which wasn't resolved.



================
Comment at: clang/lib/Lex/Pragma.cpp:1110
       Module *M = nullptr;
-      for (auto IIAndLoc : ModuleName) {
+      for (const auto &IIAndLoc : ModuleName) {
         M = MM.lookupModuleQualified(IIAndLoc.first->getName(), M);
----------------
erichkeane wrote:
> Manna wrote:
> > This returns a std::pair<IdentifierInfo *, SourceLocation> which is not particularly expensive to copy
> In that case, I'd skip the change here and leave it as a copy.
This seems like it should be a copy.  About a pointer-and-a-half with a cheap ctor.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148812/new/

https://reviews.llvm.org/D148812



More information about the cfe-commits mailing list