|
MLIR 24.0.0git
|
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< ArgClassification > | argInfos |
| bool | returnsVoid = false |
| Whether the classified return type was the source language's void. | |
Holds the full ABI classification for a function: return type and all arguments.
Definition at line 125 of file ABIRewriteContext.h.
|
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.
| SmallVector<ArgClassification> mlir::abi::FunctionClassification::argInfos |
Definition at line 127 of file ABIRewriteContext.h.
Referenced by mlir::abi::test::classify(), needsRewrite(), and mlir::abi::test::parseClassificationAttr().
| ArgClassification mlir::abi::FunctionClassification::returnInfo |
Definition at line 126 of file ABIRewriteContext.h.
Referenced by mlir::abi::test::classify(), needsRewrite(), and mlir::abi::test::parseClassificationAttr().
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().