[PATCH] D113063: [lld-macho] Cache discovered framework paths

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 07:36:51 PDT 2021


oontvoo added inline comments.


================
Comment at: lld/MachO/Driver.cpp:117-119
+          auto saved = saver.save(suffixed.str());
+          resolvedPaths[key] = saved;
+          return saved;
----------------
keith wrote:
> int3 wrote:
> > code style is to use explicit type names instead of `auto` unless the type is something complicated like an iterator
> > 
> > also I would personally prefer `return resolvedPaths[key] = second;`, but up to you
> Thanks for the feedback! Updated accordingly.
> 
> Is it possible for us to setup some automation here to flag these?
> Is it possible for us to setup some automation here to flag these?

I suspect it's hard because the rules can be ambiguous and sometimes opinion-based :) 
The usual "rules of thumb" I'd use is that if it's hard to tell at the callsite what the type is, then it should be spelled out. (even then there're exceptions like the iterator's types and lambda, etc)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113063



More information about the llvm-commits mailing list