[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

Yuxuan Chen via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 13:45:44 PDT 2024


================
@@ -523,6 +523,12 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
     NormalCleanupDest = Address::invalid();
   }
 
+  if (getLangOpts().Coroutines && isCoroutine()) {
+    auto *Record = FnRetTy->getAsCXXRecordDecl();
+    if (Record && Record->hasAttr<CoroAwaitElidableAttr>())
+      CurFn->addFnAttr(llvm::Attribute::CoroGenNoallocRamp);
+  }
----------------
yuxuanchen1997 wrote:

I will apply this suggestion in the next push. 

https://github.com/llvm/llvm-project/pull/99282


More information about the cfe-commits mailing list