[PATCH] D60642: [dsymutil] Collect parseable Swift interfaces in the .dSYM bundle.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 09:36:46 PDT 2019


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


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:169
+                             StringRef Default = {}) {
+  if (V)
+    if (auto S = V->getAsCString())
----------------
JDevlieghere wrote:
> aprantl wrote:
> > JDevlieghere wrote:
> > > Early return?
> > I'm not convinced that this is much better. What do you think?
> > 
> > ```
> > if (!V)
> >   return Default;
> > 
> > const char *Str = V->getAsCString()
> > if (!Str)
> >   return Default;
> > 
> > return Str;
> > ```
> I would do the following, but doesn't really matter that much :-) 
> 
> ```
> if (!V)
>   return Default;
> 
> 
> if (const char *Str = V->getAsCString())
>   return Str;
> 
> return Default;
> ```
Seems like this is longer and not any easier to read, IMHO.


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

https://reviews.llvm.org/D60642





More information about the llvm-commits mailing list