Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:38

0001 //===- CoroAnnotationElide.h - Elide attributed safe coroutine calls ------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // \file
0010 // This pass transforms all Call or Invoke instructions that are annotated
0011 // "coro_elide_safe" to call the `.noalloc` variant of coroutine instead.
0012 // The frame of the callee coroutine is allocated inside the caller. A pointer
0013 // to the allocated frame will be passed into the `.noalloc` ramp function.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_TRANSFORMS_COROUTINES_COROANNOTATIONELIDE_H
0018 #define LLVM_TRANSFORMS_COROUTINES_COROANNOTATIONELIDE_H
0019 
0020 #include "llvm/Analysis/CGSCCPassManager.h"
0021 #include "llvm/Analysis/LazyCallGraph.h"
0022 #include "llvm/IR/PassManager.h"
0023 
0024 namespace llvm {
0025 
0026 struct CoroAnnotationElidePass : PassInfoMixin<CoroAnnotationElidePass> {
0027   CoroAnnotationElidePass() {}
0028 
0029   PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
0030                         LazyCallGraph &CG, CGSCCUpdateResult &UR);
0031 
0032   static bool isRequired() { return false; }
0033 };
0034 } // end namespace llvm
0035 
0036 #endif // LLVM_TRANSFORMS_COROUTINES_COROANNOTATIONELIDE_H