Skip to content

Commit

Permalink
[CAPI] disambiguate mlirRegisterConversionPasses
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Jan 12, 2025
1 parent bf9f0dc commit e9e8397
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 9 deletions.
1 change: 1 addition & 0 deletions include/circt-c/Conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "mlir-c/Support.h"

#include "circt/Conversion/Conversion.capi.h.inc"
#include "mlir/Conversion/Passes.capi.h.inc"

#endif // CIRCT_C_CONVERSION_H
12 changes: 12 additions & 0 deletions include/circt-c/Transforms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//===-- circt-c/Transform.h - C API for dialect transforms --------*- C -*-===//
//
//===----------------------------------------------------------------------===//

#ifndef CIRCT_C_TRANSFORMS_H
#define CIRCT_C_TRANSFORMS_H

#include "mlir-c/Support.h"

#include "circt/Transforms/Transforms.capi.h.inc"

#endif // CIRCT_C_TRANSFORMS_H
6 changes: 3 additions & 3 deletions include/circt/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name Conversion)
mlir_tablegen(Conversion.capi.h.inc -gen-pass-capi-header --prefix Conversion)
mlir_tablegen(Conversion.capi.cpp.inc -gen-pass-capi-impl --prefix Conversion)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name CIRCTConversion)
mlir_tablegen(Conversion.capi.h.inc -gen-pass-capi-header --prefix CIRCTConversion)
mlir_tablegen(Conversion.capi.cpp.inc -gen-pass-capi-impl --prefix CIRCTConversion)
add_public_tablegen_target(CIRCTConversionPassIncGen)

add_circt_doc(Passes CIRCTConversionPasses -gen-pass-doc)
4 changes: 2 additions & 2 deletions include/circt/InitAllPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ namespace circt {

inline void registerAllPasses() {
// Conversion Passes
registerConversionPasses();
registerCIRCTConversionPasses();

// Transformation passes
registerTransformsPasses();
registerCIRCTTransformsPasses();

// LEC transformation passes
registerLECTransformsPasses();
Expand Down
6 changes: 3 additions & 3 deletions include/circt/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name Transforms)
mlir_tablegen(Transforms.capi.h.inc -gen-pass-capi-header --prefix Transforms)
mlir_tablegen(Transforms.capi.cpp.inc -gen-pass-capi-impl --prefix Transforms)
mlir_tablegen(Passes.h.inc -gen-pass-decls -name CIRCTTransforms)
mlir_tablegen(Transforms.capi.h.inc -gen-pass-capi-header --prefix CIRCTTransforms)
mlir_tablegen(Transforms.capi.cpp.inc -gen-pass-capi-impl --prefix CIRCTTransforms)
add_public_tablegen_target(CIRCTTransformsPassIncGen)

add_mlir_doc(Passes CIRCTGeneralPasses ./ -gen-pass-doc)
4 changes: 3 additions & 1 deletion lib/Bindings/Python/CIRCTModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "circt-c/Dialect/MSFT.h"
#include "circt-c/Dialect/OM.h"
#include "circt-c/Dialect/RTG.h"
#include "circt-c/Transforms.h"
#ifdef CIRCT_INCLUDE_TESTS
#include "circt-c/Dialect/RTGTest.h"
#endif
Expand Down Expand Up @@ -52,7 +53,8 @@ static void registerPasses() {
registerHWArithPasses();
registerHWPasses();
registerHandshakePasses();
mlirRegisterConversionPasses();
mlirRegisterCIRCTConversionPasses();
mlirRegisterCIRCTTransformsPasses();
mlirRegisterTransformsPasses();
}

Expand Down
1 change: 1 addition & 0 deletions lib/Bindings/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set(PYTHON_BINDINGS_LINK_LIBS
CIRCTCAPISV
CIRCTCAPIVerif
MLIRCAPITransforms
CIRCTCAPITransforms
)

if (CIRCT_INCLUDE_TESTS)
Expand Down
1 change: 1 addition & 0 deletions lib/CAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ add_subdirectory(ExportVerilog)
add_subdirectory(Dialect)
add_subdirectory(Firtool)
add_subdirectory(RtgTool)
add_subdirectory(Transforms)
6 changes: 6 additions & 0 deletions lib/CAPI/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
add_circt_public_c_api_library(CIRCTCAPITransforms
Transforms.cpp

LINK_LIBS PUBLIC
CIRCTTransforms
)
24 changes: 24 additions & 0 deletions lib/CAPI/Transforms/Transforms.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//===- Transforms.cpp - C API for Transforms Passes -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "circt-c/Transforms.h"
#include "circt/Transforms/Passes.h"
#include "mlir/CAPI/Pass.h"
#include "mlir/Pass/Pass.h"

using namespace circt;

#ifdef __cplusplus
extern "C" {
#endif

#include "circt/Transforms/Transforms.capi.cpp.inc"

#ifdef __cplusplus
}
#endif

0 comments on commit e9e8397

Please sign in to comment.