[llvm] [IR] Add assertions for unchecked getAsInteger() calls in atrib merging (PR #194713)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 06:25:15 PDT 2026
================
@@ -409,6 +409,14 @@ StringRef Attribute::getValueAsString() const {
return pImpl->getValueAsString();
}
+uint64_t Attribute::getValueAsParsedInteger(uint64_t Default) const {
+ if (!isStringAttribute())
+ return Default;
+ uint64_t Result = Default;
+ getValueAsString().getAsInteger(0, Result);
----------------
nikic wrote:
Should we be erroring on failure instead, like the Function API?
https://github.com/llvm/llvm-project/pull/194713
More information about the llvm-commits
mailing list