[clang] [CIR][ABI] Add restrict, nonnull, and ReturnsNonNull attributes (PR #188281)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 25 15:46:45 PDT 2026
================
@@ -398,8 +398,13 @@ void CIRGenModule::constructAttributeList(
attrs.set(cir::CIRDialect::getSideEffectAttrName(),
cir::SideEffectAttr::get(&getMLIRContext(), sideEffect));
- // TODO(cir): When doing 'return attrs' we need to cover the Restrict and
- // ReturnsNonNull attributes here.
+ if (targetDecl->hasAttr<ReturnsNonNullAttr>())
----------------
andykaylor wrote:
```suggestion
if (targetDecl->hasAttr<ReturnsNonNullAttr>() && !codeGenOpts.NullPointerIsValid)
```
https://github.com/llvm/llvm-project/pull/188281
More information about the cfe-commits
mailing list