|
clang 23.0.0git
|
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenConstantEmitter.h"
Public Member Functions | |
| ConstantEmitter (CIRGenFunction &cgf) | |
| Initialize this emission in the context of the given function. | |
| ConstantEmitter (CIRGenModule &cgm, const CIRGenFunction *cgf=nullptr) | |
| ConstantEmitter (const ConstantEmitter &other)=delete | |
| ConstantEmitter & | operator= (const ConstantEmitter &other)=delete |
| ~ConstantEmitter () | |
| bool | isInConstantContext () const |
| void | setInConstantContext (bool value) |
| mlir::Attribute | tryEmitForInitializer (const VarDecl &d) |
| Try to emit the initializer of the given declaration as an abstract constant. | |
| mlir::Attribute | tryEmitForInitializer (const Expr *e, QualType destType) |
| mlir::Attribute | emitForInitializer (const APValue &value, QualType destType) |
| void | finalize (cir::GlobalOp gv) |
| mlir::Attribute | emitForMemory (mlir::Attribute c, QualType destType) |
| mlir::Attribute | emitNullForMemory (mlir::Location loc, QualType t) |
| mlir::Attribute | tryEmitAbstractForInitializer (const VarDecl &d) |
| Try to emit the initializer of the given declaration as an abstract constant. | |
| mlir::Attribute | emitAbstract (const Expr *e, QualType destType) |
| Emit the result of the given expression as an abstract constant, asserting that it succeeded. | |
| mlir::Attribute | emitAbstract (SourceLocation loc, const APValue &value, QualType destType) |
| mlir::Attribute | tryEmitConstantExpr (const ConstantExpr *ce) |
| mlir::Attribute | tryEmitPrivateForVarInit (const VarDecl &d) |
| mlir::TypedAttr | tryEmitPrivate (const Expr *e, QualType destType) |
| mlir::Attribute | tryEmitPrivate (const APValue &value, QualType destType) |
| mlir::Attribute | tryEmitPrivateForMemory (const Expr *e, QualType destTy) |
| mlir::Attribute | tryEmitPrivateForMemory (const APValue &value, QualType destTy) |
| mlir::Attribute | tryEmitAbstract (const Expr *e, QualType destType) |
Static Public Member Functions | |
| static mlir::Attribute | emitForMemory (CIRGenModule &cgm, mlir::Attribute c, clang::QualType destTy) |
| static mlir::Attribute | emitNullForMemory (mlir::Location loc, CIRGenModule &cgm, QualType t) |
Public Attributes | |
| CIRGenModule & | cgm |
| const CIRGenFunction * | cgf |
Definition at line 26 of file CIRGenConstantEmitter.h.
|
inline |
Initialize this emission in the context of the given function.
Use this if the expression might contain contextual references like block addresses or PredefinedExprs.
Definition at line 54 of file CIRGenConstantEmitter.h.
Referenced by ConstantEmitter(), and operator=().
|
inline |
Definition at line 56 of file CIRGenConstantEmitter.h.
|
delete |
References ConstantEmitter().
| ConstantEmitter::~ConstantEmitter | ( | ) |
Definition at line 1031 of file CIRGenExprConstant.cpp.
Emit the result of the given expression as an abstract constant, asserting that it succeeded.
This is only safe to do when the expression is known to be a constant expression with either a fairly simple type or a known simple form.
Definition at line 1201 of file CIRGenExprConstant.cpp.
References cgm, clang::Stmt::getSourceRange(), and tryEmitPrivate().
Referenced by clang::CIRGen::CIRGenFunction::emitDeclRefLValue(), clang::CIRGen::CIRGenFunction::tryEmitAsConstant(), and tryEmitConstantExpr().
| mlir::Attribute ConstantEmitter::emitAbstract | ( | SourceLocation | loc, |
| const APValue & | value, | ||
| QualType | destType ) |
Definition at line 1211 of file CIRGenExprConstant.cpp.
References cgm, and tryEmitPrivate().
Definition at line 1006 of file CIRGenExprConstant.cpp.
References tryEmitPrivateForMemory().
Referenced by clang::CIRGen::CIRGenModule::getAddrOfTemplateParamObject(), and clang::CIRGen::CIRGenModule::getAddrOfUnnamedGlobalConstantDecl().
|
static |
Definition at line 1235 of file CIRGenExprConstant.cpp.
References cgm, emitForMemory(), clang::Type::getAs(), clang::Type::isBitIntType(), clang::Type::isExtVectorBoolType(), and clang::Type::isPackedVectorBoolType().
| mlir::Attribute ConstantEmitter::emitForMemory | ( | mlir::Attribute | c, |
| QualType | destType ) |
Definition at line 1230 of file CIRGenExprConstant.cpp.
References cgm, and emitForMemory().
Referenced by emitForMemory(), emitForMemory(), emitNullForMemory(), tryEmitPrivateForMemory(), tryEmitPrivateForMemory(), and tryEmitPrivateForVarInit().
|
static |
Definition at line 1221 of file CIRGenExprConstant.cpp.
References cgm, and emitForMemory().
|
inline |
Definition at line 93 of file CIRGenConstantEmitter.h.
References cgm, and emitNullForMemory().
Referenced by emitNullForMemory().
| void ConstantEmitter::finalize | ( | cir::GlobalOp | gv | ) |
|
inline |
Definition at line 64 of file CIRGenConstantEmitter.h.
|
delete |
References ConstantEmitter().
|
inline |
Definition at line 65 of file CIRGenConstantEmitter.h.
Definition at line 1166 of file CIRGenExprConstant.cpp.
References tryEmitPrivate().
Referenced by emitCXXNewAllocSize().
| mlir::Attribute ConstantEmitter::tryEmitAbstractForInitializer | ( | const VarDecl & | d | ) |
Try to emit the initializer of the given declaration as an abstract constant.
Definition at line 1026 of file CIRGenExprConstant.cpp.
References tryEmitPrivateForVarInit().
Referenced by clang::CIRGen::CIRGenFunction::emitAutoVarInit().
| mlir::Attribute ConstantEmitter::tryEmitConstantExpr | ( | const ConstantExpr * | ce | ) |
Definition at line 1172 of file CIRGenExprConstant.cpp.
References cgm, emitAbstract(), clang::ConstantExpr::getAPValueResult(), clang::ConstantExpr::getBeginLoc(), clang::Expr::getType(), clang::ConstantExpr::hasAPValueResult(), and clang::Expr::isGLValue().
Definition at line 1000 of file CIRGenExprConstant.cpp.
References tryEmitPrivateForMemory().
| mlir::Attribute ConstantEmitter::tryEmitForInitializer | ( | const VarDecl & | d | ) |
Try to emit the initializer of the given declaration as an abstract constant.
If this succeeds, the emission must be finalized.
Definition at line 995 of file CIRGenExprConstant.cpp.
References tryEmitPrivateForVarInit().
Referenced by clang::CIRGen::CIRGenFunction::addInitializerToStaticVarDecl(), and tryEmitGlobalCompoundLiteral().
Definition at line 1291 of file CIRGenExprConstant.cpp.
References clang::APValue::AddrLabelDiff, clang::APValue::Array, clang::cast(), clang::Type::castAs(), cgm, clang::APValue::ComplexFloat, clang::APValue::ComplexInt, clang::ast_matchers::complexType, cir::MissingFeatures::cxxABI(), clang::ast_matchers::fieldDecl, clang::APValue::FixedPoint, clang::APValue::Float, clang::APValue::getArrayFiller(), clang::APValue::getArrayInitializedElt(), clang::APValue::getArrayInitializedElts(), clang::APValue::getArraySize(), cir::CIRBaseBuilderTy::getCIRBoolAttr(), clang::APValue::getComplexFloatImag(), clang::APValue::getComplexFloatReal(), clang::APValue::getComplexIntImag(), clang::APValue::getComplexIntReal(), clang::CIRGen::CIRGenBuilderTy::getDataMemberAttr(), clang::ArrayType::getElementType(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::APValue::getKind(), clang::APValue::getMemberPointerDecl(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::APValue::getVectorElt(), clang::APValue::getVectorLength(), cir::CIRBaseBuilderTy::getZeroInitAttr(), clang::APValue::hasArrayFiller(), clang::APValue::Indeterminate, clang::APValue::Int, clang::isa(), clang::CIRGen::CIRGenBuilderTy::isNullValue(), clang::APValue::LValue, clang::APValue::Matrix, clang::APValue::MemberPointer, clang::APValue::None, clang::APValue::Struct, tryEmitPrivate(), tryEmitPrivateForMemory(), clang::APValue::Union, and clang::APValue::Vector.
Definition at line 1265 of file CIRGenExprConstant.cpp.
References cgm, clang::Expr::EvaluateAsLValue(), clang::Expr::EvaluateAsRValue(), clang::Expr::EvalStatus::hasSideEffects(), clang::Type::isReferenceType(), clang::Type::isVoidType(), tryEmitPrivate(), and clang::Expr::EvalResult::Val.
Referenced by emitAbstract(), emitAbstract(), tryEmitAbstract(), tryEmitPrivate(), tryEmitPrivate(), tryEmitPrivateForMemory(), and tryEmitPrivateForMemory().
Definition at line 1194 of file CIRGenExprConstant.cpp.
References cgm, emitForMemory(), getNonMemoryType(), and tryEmitPrivate().
Definition at line 1183 of file CIRGenExprConstant.cpp.
References cgm, emitForMemory(), getNonMemoryType(), and tryEmitPrivate().
Referenced by emitForInitializer(), tryEmitForInitializer(), tryEmitPrivate(), and tryEmitPrivateForVarInit().
| mlir::Attribute ConstantEmitter::tryEmitPrivateForVarInit | ( | const VarDecl & | d | ) |
Definition at line 1130 of file CIRGenExprConstant.cpp.
References cgm, emitForMemory(), clang::VarDecl::evaluateValue(), clang::VarDecl::getInit(), getNonMemoryType(), clang::ValueDecl::getType(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasLocalStorage(), clang::CXXConstructorDecl::isDefaultConstructor(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::FunctionDecl::isTrivial(), and tryEmitPrivateForMemory().
Referenced by tryEmitAbstractForInitializer(), and tryEmitForInitializer().
| const CIRGenFunction* clang::CIRGen::ConstantEmitter::cgf |
Definition at line 29 of file CIRGenConstantEmitter.h.
Referenced by ConstantEmitter(), and ConstantEmitter().
| CIRGenModule& clang::CIRGen::ConstantEmitter::cgm |
Definition at line 28 of file CIRGenConstantEmitter.h.
Referenced by ConstantEmitter(), ConstantEmitter(), emitAbstract(), emitAbstract(), emitForMemory(), emitForMemory(), emitNullForMemory(), emitNullForMemory(), tryEmitConstantExpr(), tryEmitGlobalCompoundLiteral(), tryEmitPrivate(), tryEmitPrivate(), tryEmitPrivateForMemory(), tryEmitPrivateForMemory(), and tryEmitPrivateForVarInit().