13#ifndef FORTRAN_OPTIMIZER_DIALECT_FIRATTR_H
14#define FORTRAN_OPTIMIZER_DIALECT_FIRATTR_H
16#include "mlir/Dialect/OpenACC/OpenACCVariableInfo.h"
17#include "mlir/IR/BuiltinAttributes.h"
20class DialectAsmParser;
21class DialectAsmPrinter;
33using KindTy = unsigned;
36 :
public mlir::Attribute::AttrBase<ExactTypeAttr, mlir::Attribute,
37 detail::TypeAttributeStorage> {
40 using ValueType = mlir::Type;
42 static constexpr llvm::StringLiteral name =
"fir.type_is";
43 static constexpr llvm::StringRef getAttrName() {
return "type_is"; }
46 mlir::Type getType()
const;
50 :
public mlir::Attribute::AttrBase<SubclassAttr, mlir::Attribute,
51 detail::TypeAttributeStorage> {
54 using ValueType = mlir::Type;
56 static constexpr llvm::StringLiteral name =
"fir.class_is";
57 static constexpr llvm::StringRef getAttrName() {
return "class_is"; }
60 mlir::Type getType()
const;
67 using BoolAttr::BoolAttr;
69 static constexpr llvm::StringLiteral name =
"fir.must_be_heap";
70 static constexpr llvm::StringRef getAttrName() {
return "fir.must_be_heap"; }
77 using BoolAttr::BoolAttr;
79 static constexpr llvm::StringLiteral name =
"fir.must_be_stack";
80 static constexpr llvm::StringRef getAttrName() {
return "fir.must_be_stack"; }
90 :
public mlir::Attribute::AttrBase<ClosedIntervalAttr, mlir::Attribute,
91 mlir::AttributeStorage> {
95 static constexpr llvm::StringLiteral name =
"fir.interval";
96 static constexpr llvm::StringRef getAttrName() {
return "interval"; }
105 :
public mlir::Attribute::AttrBase<UpperBoundAttr, mlir::Attribute,
106 mlir::AttributeStorage> {
110 static constexpr llvm::StringLiteral name =
"fir.upper";
111 static constexpr llvm::StringRef getAttrName() {
return "upper"; }
120 :
public mlir::Attribute::AttrBase<LowerBoundAttr, mlir::Attribute,
121 mlir::AttributeStorage> {
125 static constexpr llvm::StringLiteral name =
"fir.lower";
126 static constexpr llvm::StringRef getAttrName() {
return "lower"; }
135 :
public mlir::Attribute::AttrBase<PointIntervalAttr, mlir::Attribute,
136 mlir::AttributeStorage> {
140 static constexpr llvm::StringLiteral name =
"fir.point";
141 static constexpr llvm::StringRef getAttrName() {
return "point"; }
150 :
public mlir::Attribute::AttrBase<RealAttr, mlir::Attribute,
151 detail::RealAttributeStorage> {
154 using ValueType = std::pair<int, llvm::APFloat>;
156 static constexpr llvm::StringLiteral name =
"fir.real";
157 static constexpr llvm::StringRef getAttrName() {
return "real"; }
158 static RealAttr get(mlir::MLIRContext *ctxt,
const ValueType &key);
160 KindTy getFKind()
const;
161 llvm::APFloat getValue()
const;
164mlir::Attribute parseFirAttribute(FIROpsDialect *dialect,
165 mlir::DialectAsmParser &parser,
168void printFirAttribute(FIROpsDialect *dialect, mlir::Attribute attr,
169 mlir::DialectAsmPrinter &p);
173#include "flang/Optimizer/Dialect/FIREnumAttr.h.inc"
175#define GET_ATTRDEF_CLASSES
176#include "flang/Optimizer/Dialect/FIRAttr.h.inc"
178#include "flang/Optimizer/Dialect/SafeTempArrayCopyAttrInterface.h"
Definition AbstractConverter.h:37
Definition AbstractConverter.h:32
Definition FIRAttr.cpp:32
An attribute representing a reference to a type.
Definition FIRAttr.cpp:62