[Lldb-commits] [PATCH] D65122: [Symbol] Use llvm::Expected when getting TypeSystems

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 29 15:22:13 PDT 2019


JDevlieghere added inline comments.


================
Comment at: source/API/SBModule.cpp:525
           module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
-      if (type_system) {
-        CompilerType compiler_type = type_system->GetBuiltinTypeByName(name);
+      if (auto err = type_system_or_err.takeError()) {
+        llvm::consumeError(std::move(err));
----------------
xiaobai wrote:
> JDevlieghere wrote:
> > Any reason you do this instead of
> > 
> > ```if (!type_system_or_err) {
> >   llvm::consumeError(type_system_or_err.takeError());
> > ...
> > ```
> No reason in particular. Is there a benefit in doing so or something I'm misunderstanding?
I like it because it's shorter and a bit easier to read. Probably it doesn't matter. If this works I don't want to hold up your change because of it. 


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

https://reviews.llvm.org/D65122





More information about the lldb-commits mailing list