|
clang 22.0.0git
|
#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 Expr * | getSimpleArrayDecayOperand (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 DeclRefExpr * | tryToConvertMemberExprToDeclRefExpr (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) |
|
static |
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.
TODO(cir): This could be shared with classic codegen.
Definition at line 701 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::curCodeDecl, clang::CIRGen::CIRGenModule::getCIRLinkageVarDefinition(), clang::CIRGen::CIRGenFunction::getContext(), clang::Decl::getDeclContext(), clang::VarDecl::getDefinition(), clang::CIRGen::CIRGenFunction::getLangOpts(), clang::VarDecl::hasLocalStorage(), and clang::DeclRefExpr::refersToEnclosingVariableOrCapture().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), and clang::CIRGen::CIRGenFunction::emitDeclRefLValue().
|
static |
Definition at line 1365 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::createMemTemp(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::CIRGenFunction::getCounterRefTmpAsString(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::CIRGen::CIRGenFunction::getLoc(), clang::Stmt::getSourceRange(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::Expr::getType(), clang::CIRGen::Address::invalid(), clang::CIRGen::CIRGenFunction::localDeclMap, cir::MissingFeatures::mergeAllConstants(), clang::SD_Automatic, clang::SD_Dynamic, clang::SD_FullExpression, clang::SD_Static, and clang::SD_Thread.
Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), and clang::CIRGen::CIRGenFunction::emitMaterializeTemporaryExpr().
|
static |
Definition at line 1004 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenFunction::convertTypeForMem(), emitArraySubscriptPtr(), clang::CIRGen::Address::getAlignment(), getArrayElementAlign(), clang::ASTContext::getAsVariableArrayType(), clang::CIRGen::CIRGenFunction::getContext(), clang::CIRGen::Address::getElementType(), getFixedSizeElementType(), clang::CIRGen::Address::getPointer(), clang::ASTContext::getTypeSizeInChars(), and cir::MissingFeatures::preservedAccessIndexRegion().
|
static |
Definition at line 991 of file CIRGenExpr.cpp.
References cir::MissingFeatures::emitCheckedInBoundsGEP(), clang::CIRGen::CIRGenBuilderTy::getArrayElement(), clang::CIRGen::CIRGenModule::getBuilder(), and clang::CIRGen::CIRGenFunction::getCIRGenModule().
Referenced by clang::CIRGen::CIRGenFunction::emitArraySubscriptExpr(), and emitArraySubscriptPtr().
|
static |
Definition at line 639 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenFunction::emitLValueForLambdaField().
Referenced by clang::CIRGen::CIRGenFunction::emitDeclRefLValue().
|
static |
Definition at line 671 of file CIRGenExpr.cpp.
References clang::cast(), clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::convertType(), clang::CIRGen::Decl, emitFunctionDeclPointer(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getContext(), clang::GlobalDecl::getDecl(), clang::ASTContext::getDeclAlign(), clang::CIRGen::CIRGenFunction::getLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CIRGen::CIRGenFunction::makeAddrLValue(), and cir::MissingFeatures::sanitizers().
Referenced by clang::CIRGen::CIRGenFunction::emitDeclRefLValue().
|
static |
Definition at line 634 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenModule::getAddrOfFunction(), and cir::MissingFeatures::weakRefReference().
Referenced by emitFunctionDeclLValue().
|
static |
Definition at line 275 of file CIRGenExpr.cpp.
References cir::MissingFeatures::addressSpace(), clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::convertTypeForMem(), cir::CIRBaseBuilderTy::createBitcast(), clang::CIRGen::Decl, clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::CIRGenModule::getAddrOfGlobalVar(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getContext(), clang::ASTContext::getDeclAlign(), clang::CIRGen::CIRGenFunction::getLangOpts(), cir::CIRBaseBuilderTy::getPointerTo(), clang::Stmt::getSourceRange(), clang::VarDecl::getTLSKind(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Type::isReferenceType(), clang::CIRGen::CIRGenFunction::makeAddrLValue(), cir::MissingFeatures::opGlobalThreadLocal(), cir::MissingFeatures::setObjCGCLValueClass(), and clang::VarDecl::TLS_Dynamic.
Referenced by clang::CIRGen::CIRGenFunction::emitDeclRefLValue().
|
static |
Definition at line 970 of file CIRGenExpr.cpp.
References clang::CharUnits::alignmentAtOffset(), clang::CharUnits::alignmentOfArrayElement(), and getConstantIndexOrNull().
Referenced by clang::CodeGen::CodeGenFunction::EmitArraySubscriptExpr(), emitArraySubscriptGEP(), emitArraySubscriptPtr(), and emitPointerArithmetic().
|
static |
Definition at line 963 of file CIRGenExpr.cpp.
Referenced by getArrayElementAlign().
|
static |
Definition at line 982 of file CIRGenExpr.cpp.
References clang::ASTContext::getAsVariableArrayType(), and clang::ArrayType::getElementType().
Referenced by emitArraySubscriptGEP(), and emitArraySubscriptPtr().
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 949 of file CIRGenExpr.cpp.
References clang::ast_matchers::castExpr, clang::Expr::getType(), and clang::Type::isVariableArrayType().
Referenced by clang::CIRGen::CIRGenFunction::emitArraySubscriptExpr().
|
static |
Helper method to check if the underlying ABI is AAPCS.
Definition at line 368 of file CIRGenExpr.cpp.
References clang::TargetInfo::getABI().
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CIRGen::CIRGenFunction::emitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), and clang::CIRGen::CIRGenFunction::emitStoreThroughBitfieldLValue().
|
static |
Definition at line 1658 of file CIRGenExpr.cpp.
References clang::FunctionDecl::getPreviousDecl().
|
static |
Definition at line 1405 of file CIRGenExpr.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::destroyCXXObject, clang::QualType::DK_none, clang::CIRGen::CIRGenModule::errorNYI(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::QualType::getObjCLifetime(), clang::Stmt::getSourceRange(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::Expr::getType(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::QualType::isDestructedType(), clang::CIRGen::NormalAndEHCleanup, clang::CIRGen::CIRGenFunction::pushDestroy(), clang::SD_Automatic, clang::SD_Dynamic, clang::SD_FullExpression, clang::SD_Static, and clang::SD_Thread.
Referenced by clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), and clang::CIRGen::CIRGenFunction::emitMaterializeTemporaryExpr().
|
static |
Definition at line 1281 of file CIRGenExpr.cpp.
References clang::DeclRefExpr::Create(), clang::CIRGen::CIRGenFunction::getContext(), clang::MemberExpr::getExprLoc(), clang::MemberExpr::getMemberDecl(), clang::Expr::getType(), clang::Expr::getValueKind(), and clang::MemberExpr::isNonOdrUse().
Referenced by clang::CodeGen::CodeGenFunction::EmitMemberExpr(), clang::CIRGen::CIRGenFunction::emitMemberExpr(), clang::CIRGen::CIRGenFunction::tryEmitAsConstant(), and clang::CodeGen::CodeGenFunction::tryEmitAsConstant().