[llvm] [IR] Add Attribute::getValueAsParsedInteger helper (PR #194713)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 00:58:22 PDT 2026


================
@@ -409,6 +409,16 @@ StringRef Attribute::getValueAsString() const {
   return pImpl->getValueAsString();
 }
 
+uint64_t Attribute::getValueAsParsedInteger(uint64_t Default) const {
+  if (!isStringAttribute())
----------------
nikic wrote:

Can we make this an assert instead? It looks like this should hold as a precondition for all the uses in this patch.

https://github.com/llvm/llvm-project/pull/194713


More information about the llvm-commits mailing list