1 //===- CoroCleanup.cpp - Coroutine Cleanup Pass ---------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // This pass lowers all remaining coroutine intrinsics.
10 //===----------------------------------------------------------------------===//
11 
12 #include "CoroInternal.h"
13 #include "llvm/Pass.h"
14 
15 using namespace llvm;
16 
17 #define DEBUG_TYPE "coro-cleanup"
18 
19 //===----------------------------------------------------------------------===//
20 //                              Top Level Driver
21 //===----------------------------------------------------------------------===//
22 
23 namespace {
24 
25 struct CoroCleanup : FunctionPass {
26   static char ID; // Pass identification, replacement for typeid
27 
28   CoroCleanup() : FunctionPass(ID) {}
29 
30   bool runOnFunction(Function &F) override { return false; }
31   void getAnalysisUsage(AnalysisUsage &AU) const override {
32     AU.setPreservesAll();
33   }
34 };
35 
36 }
37 
38 char CoroCleanup::ID = 0;
39 INITIALIZE_PASS(CoroCleanup, "coro-cleanup",
40                 "Lower all coroutine related intrinsics", false, false)
41 
42 Pass *llvm::createCoroCleanupPass() { return new CoroCleanup(); }
43