MLIR 24.0.0git
mlir::abi::FunctionClassification Struct Reference

Holds the full ABI classification for a function: return type and all arguments. More...

#include "mlir/ABI/ABIRewriteContext.h"

Public Member Functions

bool needsRewrite () const
 Whether any value in the signature is passed differently from how it is written, so a rewriter has work to do.

Public Attributes

ArgClassification returnInfo
SmallVector< ArgClassificationargInfos
bool returnsVoid = false
 Whether the classified return type was the source language's void.

Detailed Description

Holds the full ABI classification for a function: return type and all arguments.

Definition at line 125 of file ABIRewriteContext.h.

Member Function Documentation

◆ needsRewrite()

bool mlir::abi::FunctionClassification::needsRewrite ( ) const
inline

Whether any value in the signature is passed differently from how it is written, so a rewriter has work to do.

Definition at line 146 of file ABIRewriteContext.h.

References argInfos, mlir::abi::ArgClassification::isPassThrough(), returnInfo, and returnsVoid.

Member Data Documentation

◆ argInfos

SmallVector<ArgClassification> mlir::abi::FunctionClassification::argInfos

◆ returnInfo

ArgClassification mlir::abi::FunctionClassification::returnInfo

◆ returnsVoid

bool mlir::abi::FunctionClassification::returnsVoid = false

Whether the classified return type was the source language's void.

A void return classifies as Ignore, and so does a return the ABI drops, such as an empty record. The two need opposite treatment: void is already its own wire form, while a dropped record return has to be rewritten to one. returnInfo alone cannot tell them apart, so whoever produces the classification records it here, next to the return type it came from. A consumer that re-derived it from something else could pair a classification with the wrong answer, and reading a dropped return as void means silently skipping the rewrite it needs.

Left false when unknown, which costs a needless rewrite rather than a skipped one.

Definition at line 142 of file ABIRewriteContext.h.

Referenced by needsRewrite().


The documentation for this struct was generated from the following file: