Skip to content

Commit 21c2ab8

Browse files
committed
[presburger] Develope python bindings for presburger
c++ library This MR is work in progress.
1 parent 9bf68c2 commit 21c2ab8

File tree

10 files changed

+1958
-0
lines changed

10 files changed

+1958
-0
lines changed

mlir/include/mlir-c/Presburger.h

+532
Large diffs are not rendered by default.

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h

+9
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,15 @@ class IntegerRelation {
753753
// false.
754754
bool isFullDim();
755755

756+
void *getAsOpaquePointer() const {
757+
return const_cast<IntegerRelation *>(this);
758+
}
759+
760+
static IntegerRelation *getFromOpaquePointer(const void *pointer) {
761+
return const_cast<IntegerRelation *>(
762+
reinterpret_cast<const IntegerRelation *>(pointer));
763+
}
764+
756765
void print(raw_ostream &os) const;
757766
void dump() const;
758767

mlir/include/mlir/CAPI/Presburger.h

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//===- Presburger.h - C API Utils for Presburger library --------*- C++ -*-===//
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+
//
9+
// This file contains declarations of implementation details of the C API for
10+
// Presburger library. This file should not be included from C++ code other than
11+
// C API implementation nor from C code.
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#ifndef MLIR_CAPI_PRESBURGER_H
16+
#define MLIR_CAPI_PRESBURGER_H
17+
18+
#include "mlir-c/Presburger.h"
19+
#include "mlir/Analysis/Presburger/IntegerRelation.h"
20+
#include "mlir/CAPI/Wrap.h"
21+
22+
DEFINE_C_API_PTR_METHODS(MlirPresburgerIntegerRelation,
23+
mlir::presburger::IntegerRelation)
24+
25+
#endif /* MLIR_CAPI_PRESBURGER_H */

0 commit comments

Comments
 (0)