CIRCT 22.0.0git
Loading...
Searching...
No Matches
LLHD.h
Go to the documentation of this file.
1//===- LLHD.h - C interface for the LLHD dialect ------------------*- 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#ifndef CIRCT_C_DIALECT_LLHD_H
10#define CIRCT_C_DIALECT_LLHD_H
11
12#include "mlir-c/IR.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18//===----------------------------------------------------------------------===//
19// Dialect
20//===----------------------------------------------------------------------===//
21
23
24//===----------------------------------------------------------------------===//
25// Types
26//===----------------------------------------------------------------------===//
27
28/// Check if a type is a time type.
29MLIR_CAPI_EXPORTED bool llhdTypeIsATimeType(MlirType);
30/// Check if a type is a reference type.
31MLIR_CAPI_EXPORTED bool llhdTypeIsARefType(MlirType);
32
33/// Create a time type.
34MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx);
35/// Create a reference type.
36MLIR_CAPI_EXPORTED MlirType llhdRefTypeGet(MlirType element);
37
38/// Get the inner type of a reference.
39MLIR_CAPI_EXPORTED MlirType llhdRefTypeGetNestedType(MlirType);
40
41//===----------------------------------------------------------------------===//
42// Attributes
43//===----------------------------------------------------------------------===//
44
45/// Check if an attribute is a time attribute.
46MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute);
47
48/// Create a time attribute.
49MLIR_CAPI_EXPORTED MlirAttribute llhdTimeAttrGet(MlirContext ctx,
50 MlirStringRef timeUnit,
51 uint64_t seconds,
52 uint64_t delta,
53 uint64_t epsilon);
54
55/// Get the time unit of a time attribute.
56MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute);
57/// Get the seconds component of a time attribute.
58MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetSeconds(MlirAttribute);
59/// Get the delta component of a time attribute.
60MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute);
61/// Get the epsilon component of a time attribute.
62MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetEpsilon(MlirAttribute);
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif // CIRCT_C_DIALECT_LLHD_H
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetSeconds(MlirAttribute)
Get the seconds component of a time attribute.
Definition LLHD.cpp:73
MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute)
Get the time unit of a time attribute.
Definition LLHD.cpp:68
MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx)
Create a time type.
Definition LLHD.cpp:36
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute)
Get the delta component of a time attribute.
Definition LLHD.cpp:78
MLIR_CAPI_EXPORTED MlirType llhdRefTypeGetNestedType(MlirType)
Get the inner type of a reference.
Definition LLHD.cpp:46
MLIR_CAPI_EXPORTED MlirType llhdRefTypeGet(MlirType element)
Create a reference type.
Definition LLHD.cpp:41
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetEpsilon(MlirAttribute)
Get the epsilon component of a time attribute.
Definition LLHD.cpp:83
MLIR_CAPI_EXPORTED bool llhdTypeIsATimeType(MlirType)
Check if a type is a time type.
Definition LLHD.cpp:30
MLIR_CAPI_EXPORTED bool llhdTypeIsARefType(MlirType)
Check if a type is a reference type.
Definition LLHD.cpp:33
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLHD, llhd)
MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute)
Check if an attribute is a time attribute.
Definition LLHD.cpp:55
MLIR_CAPI_EXPORTED MlirAttribute llhdTimeAttrGet(MlirContext ctx, MlirStringRef timeUnit, uint64_t seconds, uint64_t delta, uint64_t epsilon)
Create a time attribute.
Definition LLHD.cpp:60