clang 23.0.0git
CIRTypes.cpp File Reference
#include "clang/CIR/Dialect/IR/CIRTypes.h"
#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/Support/LLVM.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/CIR/Dialect/IR/CIRAttrs.h"
#include "clang/CIR/Dialect/IR/CIRDialect.h"
#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
#include "clang/CIR/Dialect/IR/CIRTypesDetails.h"
#include "clang/CIR/MissingFeatures.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/MathExtras.h"
#include "clang/CIR/Dialect/IR/CIRTypeConstraints.cpp.inc"
#include "clang/CIR/Dialect/IR/CIROpsTypes.cpp.inc"

Go to the source code of this file.

Namespaces

namespace  cir

Macros

#define GET_TYPEDEF_CLASSES
#define GET_TYPEDEF_LIST

Functions

static mlir::ParseResult parseFuncTypeParams (mlir::AsmParser &p, llvm::SmallVector< mlir::Type > &params, bool &isVarArg)
static void printFuncTypeParams (mlir::AsmPrinter &p, mlir::ArrayRef< mlir::Type > params, bool isVarArg)
mlir::ParseResult parseAddressSpaceValue (mlir::AsmParser &p, mlir::ptr::MemorySpaceAttrInterface &attr)
void printAddressSpaceValue (mlir::AsmPrinter &printer, mlir::ptr::MemorySpaceAttrInterface attr)
mlir::ParseResult parseTargetAddressSpace (mlir::AsmParser &p, cir::TargetAddressSpaceAttr &attr)
void printTargetAddressSpace (mlir::AsmPrinter &p, cir::TargetAddressSpaceAttr attr)
static mlir::ParseResult parseRecordBody (mlir::AsmParser &parser, bool &incomplete, llvm::SmallVector< mlir::Type > &members)
 Parse "incomplete" or "{type, type, ...}", writing results into incomplete and members.
template<typename RecordTy>
static void printRecordBody (mlir::AsmPrinter &printer, RecordTy self, mlir::StringAttr name, bool hasClassPrefix, bool isPacked, bool isPadded, bool isIncomplete, llvm::ArrayRef< mlir::Type > members, mlir::Type padding={})
 Print a complete CIR record body: '<' ['class '] [name] ['packed '] ['padded '] body '>' where body is "incomplete" or "{members[, padding = {type}]}".
static mlir::Type getMethodLayoutType (mlir::MLIRContext *ctx)
mlir::OptionalParseResult parseGlobalAddressSpaceValue (mlir::AsmParser &p, mlir::ptr::MemorySpaceAttrInterface &attr)
void printGlobalAddressSpaceValue (mlir::AsmPrinter &printer, cir::GlobalOp, mlir::ptr::MemorySpaceAttrInterface attr)

Macro Definition Documentation

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Definition at line 91 of file CIRTypes.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Function Documentation

◆ getMethodLayoutType()

mlir::Type getMethodLayoutType ( mlir::MLIRContext * ctx)
static

Definition at line 1048 of file CIRTypes.cpp.

◆ parseAddressSpaceValue()

mlir::ParseResult parseAddressSpaceValue ( mlir::AsmParser & p,
mlir::ptr::MemorySpaceAttrInterface & attr )

Definition at line 1285 of file CIRTypes.cpp.

◆ parseFuncTypeParams()

mlir::ParseResult parseFuncTypeParams ( mlir::AsmParser & p,
llvm::SmallVector< mlir::Type > & params,
bool & isVarArg )
static

Definition at line 977 of file CIRTypes.cpp.

◆ parseGlobalAddressSpaceValue()

mlir::OptionalParseResult parseGlobalAddressSpaceValue ( mlir::AsmParser & p,
mlir::ptr::MemorySpaceAttrInterface & attr )

Definition at line 1353 of file CIRTypes.cpp.

References parseAddressSpaceValue().

◆ parseRecordBody()

mlir::ParseResult parseRecordBody ( mlir::AsmParser & parser,
bool & incomplete,
llvm::SmallVector< mlir::Type > & members )
static

Parse "incomplete" or "{type, type, ...}", writing results into incomplete and members.

Returns failure if member parsing fails.

Definition at line 135 of file CIRTypes.cpp.

◆ parseTargetAddressSpace()

mlir::ParseResult parseTargetAddressSpace ( mlir::AsmParser & p,
cir::TargetAddressSpaceAttr & attr )

◆ printAddressSpaceValue()

void printAddressSpaceValue ( mlir::AsmPrinter & printer,
mlir::ptr::MemorySpaceAttrInterface attr )

Definition at line 1333 of file CIRTypes.cpp.

◆ printFuncTypeParams()

void printFuncTypeParams ( mlir::AsmPrinter & p,
mlir::ArrayRef< mlir::Type > params,
bool isVarArg )
static

Definition at line 997 of file CIRTypes.cpp.

◆ printGlobalAddressSpaceValue()

void printGlobalAddressSpaceValue ( mlir::AsmPrinter & printer,
cir::GlobalOp op,
mlir::ptr::MemorySpaceAttrInterface attr )

Definition at line 1362 of file CIRTypes.cpp.

References printAddressSpaceValue().

◆ printRecordBody()

template<typename RecordTy>
void printRecordBody ( mlir::AsmPrinter & printer,
RecordTy self,
mlir::StringAttr name,
bool hasClassPrefix,
bool isPacked,
bool isPadded,
bool isIncomplete,
llvm::ArrayRef< mlir::Type > members,
mlir::Type padding = {} )
static

Print a complete CIR record body: '<' ['class '] [name] ['packed '] ['padded '] body '>' where body is "incomplete" or "{members[, padding = {type}]}".

RecordTy must be a mutable MLIR type (StructType or UnionType).

Definition at line 152 of file CIRTypes.cpp.

◆ printTargetAddressSpace()

void printTargetAddressSpace ( mlir::AsmPrinter & p,
cir::TargetAddressSpaceAttr attr )