================
@@ -390,19 +389,22 @@ 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;
+ // 'const' and 'pure' imply more than memory effects: the callee also
----------------
erichkeane wrote:
not a particularly useful comment? Split it up on the individual 'add unit
attr' below as something like:
"const and pure both imply no-unwind and will-return" or something.
https://github.com/llvm/llvm-project/pull/223890
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits