[llvm] [NFC] CoroElide: Refactor `Lowerer` into `CoroIdElider` (PR #91539)

Chuanqi Xu via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 18:51:11 PDT 2024


================
@@ -33,24 +33,46 @@ static cl::opt<std::string> CoroElideInfoOutputFilename(
 
 namespace {
 // Created on demand if the coro-elide pass has work to do.
-struct Lowerer : coro::LowererBase {
+class FunctionElideManager {
+public:
+  FunctionElideManager(Function *F) : ContainingFunction(F) {
+    this->collectPostSplitCoroIds();
+  }
+
+  bool isElideNecessary() const { return !CoroIds.empty(); }
----------------
ChuanqiXu9 wrote:

```suggestion
  bool hasCoroIds() const { return !CoroIds.empty(); }
```

nit

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


More information about the llvm-commits mailing list