clang 24.0.0git
cir::CIRABIClassifierCommon Class Referenceabstract

Classifies through the LLVM ABI Lowering Library. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.h"

Inheritance diagram for cir::CIRABIClassifierCommon:
[legend]

Public Member Functions

std::optional< mlir::abi::FunctionClassification > classifyFunction (cir::FuncOp func) override
 Classify a cir.func using the LLVM ABI library.
std::optional< mlir::abi::FunctionClassification > classifyVariadicCall (cir::CIRCallOpInterface call, cir::FuncOp callee) override
 The call is classified at the callee's features, not the caller's, because the pass rewrites the definition and its call sites from one classification.
std::optional< mlir::abi::FunctionClassification > classifyIndirectCall (cir::CIRCallOpInterface call) override
 A callee resolved at run time carries no features of its own, so the call is classified at the features of the function containing it, which is the declaration classic arranges every call site from.
Public Member Functions inherited from cir::CIRABIClassifier
virtual ~CIRABIClassifier ()=default
virtual std::optional< mlir::abi::ArgClassification > classifyVAArg (cir::VAArgOp vaArg)=0
 Classify the type fetched by vaArg as an unnamed argument with a full register budget.

Protected Member Functions

 CIRABIClassifierCommon (const mlir::DataLayout &dl, mlir::ModuleOp modOp)
virtual const llvm::abi::TargetInfo & getTargetInfo (cir::FuncOp featureSource)=0
 The library classifier for a function whose recorded target features may refine the ABI rules.
std::optional< mlir::abi::ArgClassification > classifyVarArgType (mlir::Type ty, const llvm::abi::TargetInfo &targetInfo, llvm::function_ref< mlir::InFlightDiagnostic()> emitError)
 Classify ty, the type fetched by a cir.va_arg, as an unnamed argument with every argument register free.

Protected Attributes

const mlir::DataLayout & dl
mlir::ModuleOp modOp
mlir::abi::ABITypeMapper typeMapper

Detailed Description

Classifies through the LLVM ABI Lowering Library.

The signature's CIR types are mapped to llvm::abi types, the target's TargetInfo classifies them, and each llvm::abi::ArgInfo is converted to an ArgClassification.

A subclass supplies the TargetInfo and classifies cir.va_arg, whose expansion is specific to each target.

Definition at line 96 of file CIRABIClassifier.h.

Constructor & Destructor Documentation

◆ CIRABIClassifierCommon()

cir::CIRABIClassifierCommon::CIRABIClassifierCommon ( const mlir::DataLayout & dl,
mlir::ModuleOp modOp )
inlineprotected

Definition at line 119 of file CIRABIClassifier.h.

References dl, modOp, and typeMapper.

Member Function Documentation

◆ classifyFunction()

std::optional< FunctionClassification > CIRABIClassifierCommon::classifyFunction ( cir::FuncOp func)
overridevirtual

Classify a cir.func using the LLVM ABI library.

Returns std::nullopt and emits an NYI error if the signature uses a type the bridge does not handle yet.

Implements cir::CIRABIClassifier.

Definition at line 798 of file CallConvLoweringPass.cpp.

References cir::convertCallingConv(), getTargetInfo(), and cir::requiredArgs().

◆ classifyIndirectCall()

std::optional< FunctionClassification > CIRABIClassifierCommon::classifyIndirectCall ( cir::CIRCallOpInterface call)
overridevirtual

A callee resolved at run time carries no features of its own, so the call is classified at the features of the function containing it, which is the declaration classic arranges every call site from.

A call that passes arguments through an ellipsis is classified from its own operands, as a direct one is.

Implements cir::CIRABIClassifier.

Definition at line 42 of file CIRABIClassifier.cpp.

References classifyVariadicCall(), cir::getIndirectCalleeType(), getTargetInfo(), and cir::requiredArgs().

◆ classifyVarArgType()

std::optional< ArgClassification > CIRABIClassifierCommon::classifyVarArgType ( mlir::Type ty,
const llvm::abi::TargetInfo & targetInfo,
llvm::function_ref< mlir::InFlightDiagnostic()> emitError )
protected

Classify ty, the type fetched by a cir.va_arg, as an unnamed argument with every argument register free.

Classify the single type fetched by a cir.va_arg as an unnamed argument (RequiredArgs(0)) with a full register budget.

Returns std::nullopt and emits an NYI error if the type is not one this bridge handles.

Definition at line 809 of file CallConvLoweringPass.cpp.

References modOp.

◆ classifyVariadicCall()

std::optional< FunctionClassification > CIRABIClassifierCommon::classifyVariadicCall ( cir::CIRCallOpInterface call,
cir::FuncOp callee )
overridevirtual

The call is classified at the callee's features, not the caller's, because the pass rewrites the definition and its call sites from one classification.

Classic instead arranges every call site from the caller and reports a caller whose features disagree with its callee in checkFunctionCallABI, which has no equivalent here yet.

Implements cir::CIRABIClassifier.

Definition at line 34 of file CIRABIClassifier.cpp.

References classifyVariadicCall(), cir::convertCallingConv(), and getTargetInfo().

Referenced by classifyIndirectCall(), and classifyVariadicCall().

◆ getTargetInfo()

virtual const llvm::abi::TargetInfo & cir::CIRABIClassifierCommon::getTargetInfo ( cir::FuncOp featureSource)
protectedpure virtual

The library classifier for a function whose recorded target features may refine the ABI rules.

Referenced by classifyFunction(), classifyIndirectCall(), and classifyVariadicCall().

Member Data Documentation

◆ dl

const mlir::DataLayout& cir::CIRABIClassifierCommon::dl
protected

Definition at line 133 of file CIRABIClassifier.h.

Referenced by CIRABIClassifierCommon().

◆ modOp

mlir::ModuleOp cir::CIRABIClassifierCommon::modOp
protected

Definition at line 134 of file CIRABIClassifier.h.

Referenced by CIRABIClassifierCommon(), and classifyVarArgType().

◆ typeMapper

mlir::abi::ABITypeMapper cir::CIRABIClassifierCommon::typeMapper
protected

Definition at line 135 of file CIRABIClassifier.h.

Referenced by CIRABIClassifierCommon().


The documentation for this class was generated from the following files: