FLANG
GenRuntimeCallsForTest.cpp File Reference
#include "flang/Common/static-multimap-view.h"
#include "flang/Optimizer/Builder/Runtime/RTBuilder.h"
#include "flang/Optimizer/Dialect/FIRDialect.h"
#include "flang/Optimizer/Dialect/FIROpsSupport.h"
#include "flang/Optimizer/Support/InternalNames.h"
#include "flang/Optimizer/Transforms/Passes.h"
#include "flang/Runtime/io-api.h"
#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
#include "flang/Optimizer/Transforms/Passes.h.inc"
#include "flang/Optimizer/Transforms/RuntimeFunctions.inc"

Namespaces

namespace  fir

Macros

#define GEN_PASS_DEF_GENRUNTIMECALLSFORTEST
#define DEBUG_TYPE   "gen-runtime-calls-for-test"
#define mkIOKey(X)
#define mkRTKey(X)
#define KNOWN_IO_FUNC(X)
#define KNOWN_RUNTIME_FUNC(X)

Detailed Description

This pass is only for developers to generate declarations/calls of Fortran runtime function recognized in flang/Optimizer/Transforms/RuntimeFunctions.inc table. Sample of the generated FIR: func.func private @_FortranAioSetStatus(!fir.ref<i8>, !fir.ref<i8>, i64) -> i1 attributes {fir.io, fir.runtime}

func.func @test__FortranAioSetStatus( arg0: !fir.ref<i8>, arg1: !fir.ref<i8>, arg2: i64) -> i1 { %0 = fir.call @_FortranAioSetStatus(arg0, arg1, arg2) : (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1 return %0 : i1 }

Macro Definition Documentation

◆ KNOWN_IO_FUNC

#define KNOWN_IO_FUNC ( X)
Value:
fir::runtime::getIORuntimeFunc<mkIOKey(X)>(loc, builder)

◆ KNOWN_RUNTIME_FUNC

#define KNOWN_RUNTIME_FUNC ( X)
Value:
fir::runtime::getRuntimeFunc<mkRTKey(X)>(loc, builder)

◆ mkIOKey

#define mkIOKey ( X)
Value:
FirmkKey(IONAME(X))

◆ mkRTKey

#define mkRTKey ( X)
Value:
FirmkKey(RTNAME(X))