================
@@ -2468,31 +2482,38 @@ bool LLParser::parseOptionalCodeModel(CodeModel::Model
&model) {
return false;
}
-/// parseOptionalDerefAttrBytes
+/// parseOptionalAttrBytes
/// ::= /* empty */
/// ::= AttrKind '(' 4 ')'
///
-/// where AttrKind is either 'dereferenceable' or 'dereferenceable_or_null'.
-bool LLParser::parseOptionalDerefAttrBytes(lltok::Kind AttrKind,
- uint64_t &Bytes) {
+/// where AttrKind is either 'dereferenceable', 'dereferenceable_or_null', or
+/// 'dead_on_return'
+bool LLParser::parseOptionalAttrBytes(lltok::Kind AttrKind,
+ std::optional<uint64_t> &Bytes,
+ bool ErrorNoBytes) {
assert((AttrKind == lltok::kw_dereferenceable ||
- AttrKind == lltok::kw_dereferenceable_or_null) &&
+ AttrKind == lltok::kw_dereferenceable_or_null ||
+ AttrKind == lltok::kw_dead_on_return) &&
"contract!");
Bytes = 0;
if (!EatIfPresent(AttrKind))
return false;
LocTy ParenLoc = Lex.getLoc();
- if (!EatIfPresent(lltok::lparen))
- return error(ParenLoc, "expected '('");
+ if (!EatIfPresent(lltok::lparen)) {
+ if (ErrorNoBytes)
----------------
antoniofrighetto wrote:
```suggestion
if (!ErrorNoBytes)
```
Or meant to pass ErrorNoBytes true as default?
https://github.com/llvm/llvm-project/pull/171712
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits