clang 22.0.0git
Public Member Functions | Public Attributes | List of all members
cir::CIRDataLayout Class Reference

#include "clang/CIR/Dialect/IR/CIRDataLayout.h"

Public Member Functions

 CIRDataLayout (mlir::ModuleOp modOp)
 Constructs a DataLayout the module's data layout attribute.
 
void reset (mlir::DataLayoutSpecInterface spec)
 Parse a data layout string (with fallback to default values).
 
bool isBigEndian () const
 
llvm::Align getAlignment (mlir::Type ty, bool abiOrPref) const
 Internal helper method that returns requested alignment for type.
 
llvm::Align getABITypeAlign (mlir::Type ty) const
 
llvm::TypeSize getTypeStoreSize (mlir::Type ty) const
 Returns the maximum number of bytes that may be overwritten by storing the specified type.
 
llvm::TypeSize getTypeAllocSize (mlir::Type ty) const
 Returns the offset in bytes between successive objects of the specified type, including alignment padding.
 
llvm::TypeSize getTypeSizeInBits (mlir::Type ty) const
 

Public Attributes

mlir::DataLayout layout
 

Detailed Description

Definition at line 22 of file CIRDataLayout.h.

Constructor & Destructor Documentation

◆ CIRDataLayout()

CIRDataLayout::CIRDataLayout ( mlir::ModuleOp  modOp)

Constructs a DataLayout the module's data layout attribute.

Definition at line 11 of file CIRDataLayout.cpp.

References reset().

Member Function Documentation

◆ getABITypeAlign()

llvm::Align cir::CIRDataLayout::getABITypeAlign ( mlir::Type  ty) const
inline

◆ getAlignment()

llvm::Align CIRDataLayout::getAlignment ( mlir::Type  ty,
bool  abiOrPref 
) const

Internal helper method that returns requested alignment for type.

Definition at line 26 of file CIRDataLayout.cpp.

References cir::MissingFeatures::addressSpace(), and layout.

Referenced by getABITypeAlign().

◆ getTypeAllocSize()

llvm::TypeSize cir::CIRDataLayout::getTypeAllocSize ( mlir::Type  ty) const
inline

Returns the offset in bytes between successive objects of the specified type, including alignment padding.

If Ty is a scalable vector type, the scalable property will be set and the runtime size will be a positive integer multiple of the base size.

This is the amount that alloca reserves for this type. For example, returns 12 or 16 for x86_fp80, depending on alignment.

Definition at line 66 of file CIRDataLayout.h.

References getABITypeAlign(), and getTypeStoreSize().

Referenced by clang::CIRGen::CIRGenBuilderTy::computeGlobalViewIndicesFromFlatOffset().

◆ getTypeSizeInBits()

llvm::TypeSize CIRDataLayout::getTypeSizeInBits ( mlir::Type  ty) const

Definition at line 39 of file CIRDataLayout.cpp.

References cir::MissingFeatures::addressSpace(), cir::isSized(), and layout.

Referenced by getTypeStoreSize().

◆ getTypeStoreSize()

llvm::TypeSize cir::CIRDataLayout::getTypeStoreSize ( mlir::Type  ty) const
inline

Returns the maximum number of bytes that may be overwritten by storing the specified type.

If Ty is a scalable vector type, the scalable property will be set and the runtime size will be a positive integer multiple of the base size.

For example, returns 5 for i36 and 10 for x86_fp80.

Definition at line 52 of file CIRDataLayout.h.

References getTypeSizeInBits().

Referenced by getTypeAllocSize(), and isFullSizeType().

◆ isBigEndian()

bool cir::CIRDataLayout::isBigEndian ( ) const
inline

Definition at line 36 of file CIRDataLayout.h.

◆ reset()

void CIRDataLayout::reset ( mlir::DataLayoutSpecInterface  spec)

Parse a data layout string (with fallback to default values).

Definition at line 15 of file CIRDataLayout.cpp.

Referenced by CIRDataLayout().

Member Data Documentation

◆ layout

mlir::DataLayout cir::CIRDataLayout::layout

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