[PATCH] D99299: Normalize interaction with boolean attributes

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 13:53:45 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/IR/Attributes.cpp:660-663
+bool AttributeImpl::getValueAsBool() const {
+  assert(getValueAsString().empty() || getValueAsString() == "false" || getValueAsString() == "true");
+  return getValueAsString() == "true";
+}
----------------
Is it maybe worth using named constants rather than string literals, so this true and false matches up with the true/false in StrBoolAttr? (I assume that's where these strings are produced?)



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99299



More information about the llvm-commits mailing list