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

Soumi Manna via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 21 07:45:46 PDT 2023


Manna marked an inline comment as done.
Manna added inline comments.


================
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:
> 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.
I missed that. Thanks @erichkeane.  Done


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

https://reviews.llvm.org/D148812



More information about the cfe-commits mailing list