clang 22.0.0git
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 emitCapturedFieldLValue (CIRGenFunction &cgf, const FieldDecl *fd, mlir::Value thisValue)
static LValue emitFunctionDeclLValue (CIRGenFunction &cgf, const Expr *e, GlobalDecl gd)
static bool canEmitSpuriousReferenceToVariable (CIRGenFunction &cgf, const DeclRefExpr *e, const VarDecl *vd)
 Determine whether we can emit a reference to vd from the current context, despite not necessarily having seen an odr-use of the variable in this context.
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

◆ canEmitSpuriousReferenceToVariable()

bool canEmitSpuriousReferenceToVariable ( CIRGenFunction & cgf,
const DeclRefExpr * e,
const VarDecl * vd )
static

◆ createReferenceTemporary()

◆ emitArraySubscriptPtr() [1/2]

◆ emitArraySubscriptPtr() [2/2]

◆ emitCapturedFieldLValue()

LValue emitCapturedFieldLValue ( CIRGenFunction & cgf,
const FieldDecl * fd,
mlir::Value thisValue )
static

◆ emitFunctionDeclLValue()

◆ emitFunctionDeclPointer()

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

◆ emitGlobalVarDeclLValue()

◆ getArrayElementAlign()

◆ getConstantIndexOrNull()

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

Definition at line 955 of file CIRGenExpr.cpp.

Referenced by getArrayElementAlign().

◆ getFixedSizeElementType()

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

◆ getSimpleArrayDecayOperand()

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 941 of file CIRGenExpr.cpp.

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

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

◆ isAAPCS()

◆ onlyHasInlineBuiltinDeclaration()

bool onlyHasInlineBuiltinDeclaration ( const FunctionDecl * fd)
static

Definition at line 1642 of file CIRGenExpr.cpp.

References clang::FunctionDecl::getPreviousDecl().

◆ pushTemporaryCleanup()

◆ tryToConvertMemberExprToDeclRefExpr()