TypeAttr:$in_type,
OptionalAttr<StrAttr>:$uniq_name,
OptionalAttr<StrAttr>:$bindc_name,
+ UnitAttr:$pinned,
Variadic<AnyIntegerType>:$typeparams,
Variadic<AnyIntegerType>:$shape
);
let builders = [
OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
"llvm::StringRef":$bindcName, CArg<"mlir::ValueRange", "{}">:$typeparams,
- CArg<"mlir::ValueRange", "{}">:$shape,
- CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
- OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
- CArg<"mlir::ValueRange", "{}">:$typeparams,
- CArg<"mlir::ValueRange", "{}">:$shape,
- CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
- OpBuilder<(ins "mlir::Type":$in_type,
- CArg<"mlir::ValueRange", "{}">:$typeparams,
- CArg<"mlir::ValueRange", "{}">:$shape,
- CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
+ OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
+ "llvm::StringRef":$bindcName, "bool":$pinned,
+ CArg<"mlir::ValueRange", "{}">:$typeparams,
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
+ OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
+ CArg<"mlir::ValueRange", "{}">:$typeparams,
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
+ OpBuilder<(ins "mlir::Type":$inType, "llvm::StringRef":$uniqName,
+ "bool":$pinned, CArg<"mlir::ValueRange", "{}">:$typeparams,
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
+ OpBuilder<(ins "mlir::Type":$inType, "bool":$pinned,
+ CArg<"mlir::ValueRange", "{}">:$typeparams,
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>,
+ OpBuilder<(ins "mlir::Type":$inType,
+ CArg<"mlir::ValueRange", "{}">:$typeparams,
+ CArg<"mlir::ValueRange", "{}">:$shape,
+ CArg<"llvm::ArrayRef<mlir::NamedAttribute>", "{}">:$attributes)>];
let verifier = [{ return ::verify(*this); }];
llvm::ArrayRef<mlir::NamedAttribute> attributes) {
auto nameAttr = builder.getStringAttr(uniqName);
build(builder, result, wrapAllocaResultType(inType), inType, nameAttr, {},
- typeparams, shape);
+ /*pinned=*/false, typeparams, shape);
+ result.addAttributes(attributes);
+}
+
+void fir::AllocaOp::build(mlir::OpBuilder &builder,
+ mlir::OperationState &result, mlir::Type inType,
+ llvm::StringRef uniqName, bool pinned,
+ mlir::ValueRange typeparams, mlir::ValueRange shape,
+ llvm::ArrayRef<mlir::NamedAttribute> attributes) {
+ auto nameAttr = builder.getStringAttr(uniqName);
+ build(builder, result, wrapAllocaResultType(inType), inType, nameAttr, {},
+ pinned, typeparams, shape);
result.addAttributes(attributes);
}
auto bindcAttr =
bindcName.empty() ? mlir::StringAttr{} : builder.getStringAttr(bindcName);
build(builder, result, wrapAllocaResultType(inType), inType, nameAttr,
- bindcAttr, typeparams, shape);
+ bindcAttr, /*pinned=*/false, typeparams, shape);
+ result.addAttributes(attributes);
+}
+
+void fir::AllocaOp::build(mlir::OpBuilder &builder,
+ mlir::OperationState &result, mlir::Type inType,
+ llvm::StringRef uniqName, llvm::StringRef bindcName,
+ bool pinned, mlir::ValueRange typeparams,
+ mlir::ValueRange shape,
+ llvm::ArrayRef<mlir::NamedAttribute> attributes) {
+ auto nameAttr =
+ uniqName.empty() ? mlir::StringAttr{} : builder.getStringAttr(uniqName);
+ auto bindcAttr =
+ bindcName.empty() ? mlir::StringAttr{} : builder.getStringAttr(bindcName);
+ build(builder, result, wrapAllocaResultType(inType), inType, nameAttr,
+ bindcAttr, pinned, typeparams, shape);
result.addAttributes(attributes);
}
mlir::ValueRange typeparams, mlir::ValueRange shape,
llvm::ArrayRef<mlir::NamedAttribute> attributes) {
build(builder, result, wrapAllocaResultType(inType), inType, {}, {},
+ /*pinned=*/false, typeparams, shape);
+ result.addAttributes(attributes);
+}
+
+void fir::AllocaOp::build(mlir::OpBuilder &builder,
+ mlir::OperationState &result, mlir::Type inType,
+ bool pinned, mlir::ValueRange typeparams,
+ mlir::ValueRange shape,
+ llvm::ArrayRef<mlir::NamedAttribute> attributes) {
+ build(builder, result, wrapAllocaResultType(inType), inType, {}, {}, pinned,
typeparams, shape);
result.addAttributes(attributes);
}