[Lldb-commits] [PATCH] D143215: Separate Process::GetWatchpointSupportInfo into two methods to get the two separate pieces of information

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 8 01:44:29 PST 2023


DavidSpickett added a subscriber: Emmmer.
DavidSpickett added inline comments.


================
Comment at: lldb/source/Target/Process.cpp:2373
+    reported_after = false;
+  return reported_after;
+}
----------------
DavidSpickett wrote:
> Would this be any clearer with multiple returns? Or one giant return, but the logic is a bit cryptic then.
> 
> ```
>   const ArchSpec &arch = GetTarget().GetArchitecture();
>   if (!arch.IsValid())
>     return true;
> 
>   llvm::Triple triple = arch.GetTriple();
>   return !(triple.isMIPS() || triple.isPPC64() || triple.isAArch64() || triple.isArmMClass() || triple.isARM());
> ```
> 
> Better as:
> ```
>   const ArchSpec &arch = GetTarget().GetArchitecture();
>   if (!arch.IsValid())
>     return false;
> 
>   llvm::Triple triple = arch.GetTriple();
>   if (triple.isMIPS() || triple.isPPC64() || triple.isAArch64() || triple.isArmMClass() || triple.isARM())
>     return false;
> 
>   return true;
> ```
> 
> Also, do we know what RISC-V does?
@Emmmer any idea?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143215



More information about the lldb-commits mailing list