[llvm] Add the 'initializes' attribute langref and support (PR #84803)
Haopeng Liu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 12:33:48 PDT 2024
================
@@ -2350,12 +2361,42 @@ Error BitcodeReader::parseAttributeGroupBlock() {
if (!Attribute::isConstantRangeAttrKind(Kind))
return error("Not a ConstantRange attribute");
- Expected<ConstantRange> MaybeCR = readConstantRange(Record, i);
+ Expected<ConstantRange> MaybeCR =
+ readBitWidthAndConstantRange(Record, i);
if (!MaybeCR)
return MaybeCR.takeError();
i--;
B.addConstantRangeAttr(Kind, MaybeCR.get());
+ } else if (Record[i] == 8) {
+ Attribute::AttrKind Kind;
+
+ i++;
+ if (Error Err = parseAttrKind(Record[i++], &Kind))
+ return Err;
+ if (!Attribute::isConstantRangeListAttrKind(Kind))
+ return error("Not a constant range list attribute");
+
+ SmallVector<ConstantRange, 2> Val;
+ if (i + 2 > e)
+ return error("Too few records for constant range list");
+ unsigned RangeSize = Record[i++];
+ unsigned BitWidth = Record[i++];
+ if (i + 2 * RangeSize > e)
----------------
haopliu wrote:
Ah, done!
https://github.com/llvm/llvm-project/pull/84803
More information about the llvm-commits
mailing list