================
@@ -391,19 +390,24 @@ void CIRGenModule::constructAttributeList(
 
     assert(!cir::MissingFeatures::opCallAttrs());
 
-    // 'const', 'pure' and 'noalias' attributed functions are also nounwind.
-    if (targetDecl->hasAttr<ConstAttr>()) {
-      // gcc specifies that 'const' functions have greater restrictions than
-      // 'pure' functions, so they also cannot have infinite loops.
-      sideEffect = cir::SideEffect::Const;
-    } else if (targetDecl->hasAttr<PureAttr>()) {
-      // gcc specifies that 'pure' functions cannot have infinite loops.
-      sideEffect = cir::SideEffect::Pure;
+    std::optional<cir::ModRefInfo> access;
+    if (targetDecl->hasAttr<ConstAttr>())
+      access = cir::ModRefInfo::NoModRef;
+    else if (targetDecl->hasAttr<PureAttr>())
+      access = cir::ModRefInfo::Ref;
+
----------------
adams381 wrote:

Added, using `inaccessibleOrArgMemOnly`.  It was missing because the old 
`side_effect` enum had no way to say it, `all`/`pure`/`const` can't express a 
non-uniform value.  Checked it against classic and the attribute groups match.

https://github.com/llvm/llvm-project/pull/223890
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to