MLIR  19.0.0git
RequestCWrappers.cpp
Go to the documentation of this file.
1 //===- RequestCWrappers.cpp - Annotate funcs with wrap attributes ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
12 #include "mlir/Pass/Pass.h"
13 
14 namespace mlir {
15 namespace LLVM {
16 #define GEN_PASS_DEF_LLVMREQUESTCWRAPPERS
17 #include "mlir/Dialect/LLVMIR/Transforms/Passes.h.inc"
18 } // namespace LLVM
19 } // namespace mlir
20 
21 using namespace mlir;
22 
23 namespace {
24 class RequestCWrappersPass
25  : public LLVM::impl::LLVMRequestCWrappersBase<RequestCWrappersPass> {
26 public:
27  void runOnOperation() override {
28  getOperation()->setAttr(LLVM::LLVMDialect::getEmitCWrapperAttrName(),
30  }
31 };
32 } // namespace
33 
34 std::unique_ptr<Pass> mlir::LLVM::createRequestCWrappersPass() {
35  return std::make_unique<RequestCWrappersPass>();
36 }
static MLIRContext * getContext(OpFoldResult val)
std::unique_ptr< Pass > createRequestCWrappersPass()
Include the generated interface declarations.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...