[PATCH] D79624: [NFC][DwarfDebug] Prefer explicit to auto type deduction
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 12 01:02:35 PDT 2020
djtodoro added a comment.
In D79624#2030876 <https://reviews.llvm.org/D79624#2030876>, @dblaikie wrote:
> > We should use explicit type instead of auto type deduction when the type is so obvious.
>
> This seems like it goes against the LLVM Style Guide, which says "Don’t “almost always” use auto, but **do use auto with** initializers like cast<Foo>(...) or other **places where the type is already obvious from the context**."
Oh, I see... My intuition went in wrong direction.
> I don't think it's super necessary (I wouldn't advocate for someone changing this code to use auto alone, anymore than I advocate for the change to remove auto here), but equally I'm not sure this change was warranted - please revert it.
I wanted to remove ambiguity, but this may not be the best way.
I reverted this. Thanks for the comment.
> If you like, you can keep these things as references, rather than pointers, I think that's generally good - I'm all for more references/fewer pointers. And certainly the old code was misleading in that it unnecessarily used reference lifetime extension, and should've instead use ```const auto *``` if it was going to have these as pointer typed variables.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79624/new/
https://reviews.llvm.org/D79624
More information about the llvm-commits
mailing list