FLANG
Character.h
1//===-- Character.h -- generate calls to character runtime API --*- 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 FORTRAN_OPTIMIZER_BUILDER_RUNTIME_CHARACTER_H
10#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_CHARACTER_H
11
12#include "mlir/Dialect/Arith/IR/Arith.h"
13#include "mlir/Dialect/Func/IR/FuncOps.h"
14
15namespace fir {
16class ExtendedValue;
17class FirOpBuilder;
18} // namespace fir
19
20namespace fir::runtime {
21
30void genAdjustL(fir::FirOpBuilder &builder, mlir::Location loc,
31 mlir::Value resultBox, mlir::Value stringBox);
32
41void genAdjustR(fir::FirOpBuilder &builder, mlir::Location loc,
42 mlir::Value resultBox, mlir::Value stringBox);
43
46mlir::Value genCharCompare(fir::FirOpBuilder &builder, mlir::Location loc,
47 mlir::arith::CmpIPredicate cmp,
48 const fir::ExtendedValue &lhs,
49 const fir::ExtendedValue &rhs);
50
55mlir::Value genCharCompare(fir::FirOpBuilder &builder, mlir::Location loc,
56 mlir::arith::CmpIPredicate cmp, mlir::Value lhsBuff,
57 mlir::Value lhsLen, mlir::Value rhsBuff,
58 mlir::Value rhsLen);
59
63mlir::Value genIndex(fir::FirOpBuilder &builder, mlir::Location loc, int kind,
64 mlir::Value stringBase, mlir::Value stringLen,
65 mlir::Value substringBase, mlir::Value substringLen,
66 mlir::Value back);
67
71void genIndexDescriptor(fir::FirOpBuilder &builder, mlir::Location loc,
72 mlir::Value resultBox, mlir::Value stringBox,
73 mlir::Value substringBox, mlir::Value backOpt,
74 mlir::Value kind);
75
81void genRepeat(fir::FirOpBuilder &builder, mlir::Location loc,
82 mlir::Value resultBox, mlir::Value stringBox,
83 mlir::Value ncopies);
84
89void genTrim(fir::FirOpBuilder &builder, mlir::Location loc,
90 mlir::Value resultBox, mlir::Value stringBox);
91
95void genScanDescriptor(fir::FirOpBuilder &builder, mlir::Location loc,
96 mlir::Value resultBox, mlir::Value stringBox,
97 mlir::Value setBox, mlir::Value backBox,
98 mlir::Value kind);
99
103mlir::Value genScan(fir::FirOpBuilder &builder, mlir::Location loc, int kind,
104 mlir::Value stringBase, mlir::Value stringLen,
105 mlir::Value setBase, mlir::Value setLen, mlir::Value back);
106
110void genVerifyDescriptor(fir::FirOpBuilder &builder, mlir::Location loc,
111 mlir::Value resultBox, mlir::Value stringBox,
112 mlir::Value setBox, mlir::Value backBox,
113 mlir::Value kind);
114
118mlir::Value genVerify(fir::FirOpBuilder &builder, mlir::Location loc, int kind,
119 mlir::Value stringBase, mlir::Value stringLen,
120 mlir::Value setBase, mlir::Value setLen,
121 mlir::Value back);
122
123} // namespace fir::runtime
124
125#endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_CHARACTER_H
Definition: BoxValue.h:478
Definition: FIRBuilder.h:55
Definition: AbstractConverter.h:31