clang 22.0.0git
Functions
CIRGenExpr.cpp File Reference
#include "Address.h"
#include "CIRGenConstantEmitter.h"
#include "CIRGenFunction.h"
#include "CIRGenModule.h"
#include "CIRGenValue.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Value.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/CIR/Dialect/IR/CIRDialect.h"
#include "clang/CIR/MissingFeatures.h"
#include <optional>

Go to the source code of this file.

Functions

static LValue emitGlobalVarDeclLValue (CIRGenFunction &cgf, const Expr *e, const VarDecl *vd)
 
static bool isAAPCS (const TargetInfo &targetInfo)
 Helper method to check if the underlying ABI is AAPCS.
 
static cir::FuncOp emitFunctionDeclPointer (CIRGenModule &cgm, GlobalDecl gd)
 
static LValue emitFunctionDeclLValue (CIRGenFunction &cgf, const Expr *e, GlobalDecl gd)
 
static const ExprgetSimpleArrayDecayOperand (const Expr *e)
 If the specified expr is a simple decay from an array to pointer, return the array subexpression.
 
static cir::IntAttr getConstantIndexOrNull (mlir::Value idx)
 
static CharUnits getArrayElementAlign (CharUnits arrayAlign, mlir::Value idx, CharUnits eltSize)
 
static QualType getFixedSizeElementType (const ASTContext &astContext, const VariableArrayType *vla)
 
static mlir::Value emitArraySubscriptPtr (CIRGenFunction &cgf, mlir::Location beginLoc, mlir::Location endLoc, mlir::Value ptr, mlir::Type eltTy, mlir::Value idx, bool shouldDecay)
 
static Address emitArraySubscriptPtr (CIRGenFunction &cgf, mlir::Location beginLoc, mlir::Location endLoc, Address addr, QualType eltType, mlir::Value idx, mlir::Location loc, bool shouldDecay)
 
static DeclRefExprtryToConvertMemberExprToDeclRefExpr (CIRGenFunction &cgf, const MemberExpr *me)
 
static Address createReferenceTemporary (CIRGenFunction &cgf, const MaterializeTemporaryExpr *m, const Expr *inner)
 
static void pushTemporaryCleanup (CIRGenFunction &cgf, const MaterializeTemporaryExpr *m, const Expr *e, Address referenceTemporary)
 
static bool onlyHasInlineBuiltinDeclaration (const FunctionDecl *fd)
 

Function Documentation

◆ createReferenceTemporary()

static Address createReferenceTemporary ( CIRGenFunction cgf,
const MaterializeTemporaryExpr m,
const Expr inner 
)
static

◆ emitArraySubscriptPtr() [1/2]

static Address emitArraySubscriptPtr ( CIRGenFunction cgf,
mlir::Location  beginLoc,
mlir::Location  endLoc,
Address  addr,
QualType  eltType,
mlir::Value  idx,
mlir::Location  loc,
bool  shouldDecay 
)
static

◆ emitArraySubscriptPtr() [2/2]

static mlir::Value emitArraySubscriptPtr ( CIRGenFunction cgf,
mlir::Location  beginLoc,
mlir::Location  endLoc,
mlir::Value  ptr,
mlir::Type  eltTy,
mlir::Value  idx,
bool  shouldDecay 
)
static

◆ emitFunctionDeclLValue()

static LValue emitFunctionDeclLValue ( CIRGenFunction cgf,
const Expr e,
GlobalDecl  gd 
)
static

◆ emitFunctionDeclPointer()

static cir::FuncOp emitFunctionDeclPointer ( CIRGenModule cgm,
GlobalDecl  gd 
)
static

◆ emitGlobalVarDeclLValue()

static LValue emitGlobalVarDeclLValue ( CIRGenFunction cgf,
const Expr e,
const VarDecl vd 
)
static

◆ getArrayElementAlign()

static CharUnits getArrayElementAlign ( CharUnits  arrayAlign,
mlir::Value  idx,
CharUnits  eltSize 
)
static

◆ getConstantIndexOrNull()

static cir::IntAttr getConstantIndexOrNull ( mlir::Value  idx)
static

Definition at line 808 of file CIRGenExpr.cpp.

Referenced by getArrayElementAlign().

◆ getFixedSizeElementType()

static QualType getFixedSizeElementType ( const ASTContext astContext,
const VariableArrayType vla 
)
static

◆ getSimpleArrayDecayOperand()

static const Expr * getSimpleArrayDecayOperand ( const Expr e)
static

If the specified expr is a simple decay from an array to pointer, return the array subexpression.

FIXME: this could be abstracted into a common AST helper.

Definition at line 794 of file CIRGenExpr.cpp.

References clang::ast_matchers::castExpr, clang::Expr::getType(), and clang::Type::isVariableArrayType().

Referenced by clang::CIRGen::CIRGenFunction::emitArraySubscriptExpr().

◆ isAAPCS()

static bool isAAPCS ( const TargetInfo targetInfo)
static

◆ onlyHasInlineBuiltinDeclaration()

static bool onlyHasInlineBuiltinDeclaration ( const FunctionDecl fd)
static

◆ pushTemporaryCleanup()

static void pushTemporaryCleanup ( CIRGenFunction cgf,
const MaterializeTemporaryExpr m,
const Expr e,
Address  referenceTemporary 
)
static

◆ tryToConvertMemberExprToDeclRefExpr()

static DeclRefExpr * tryToConvertMemberExprToDeclRefExpr ( CIRGenFunction cgf,
const MemberExpr me 
)
static