[Lldb-commits] [PATCH] D86220: [lldb/Utility] Simplify Scalar handling of float types

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 20 07:18:46 PDT 2020


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


================
Comment at: lldb/source/Utility/Scalar.cpp:68
+Scalar::PromotionKey Scalar::GetFloatPromoKey(const llvm::fltSemantics &sem) {
+  static const llvm::fltSemantics *order[] = {&APFloat::IEEEsingle(),
+                                              &APFloat::IEEEdouble(),
----------------
JDevlieghere wrote:
> `std::array` or `ArrayRef` maybe?
With a std::array, I'd have to explicitly specify the size, and I'm _really_ not sure what would happen with an ArrayRef (I think it would end up as a dangling pointer).

Given that it has just one usage, I don't think this is an issue. Even with multiple usages, I think it'd be fine to declare the variable this way, but that have an accessor which would wrap it in an ArrayRef for easier manipulation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86220



More information about the lldb-commits mailing list