clang 22.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
clang::CIRGen::CIRGenFunction Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenFunction.h"

Inheritance diagram for clang::CIRGen::CIRGenFunction:
[legend]

Classes

class  AbstractCallee
 An abstract representation of regular/ObjC call/message targets. More...
 
struct  AutoVarEmission
 
class  ConditionalEvaluation
 An object to manage conditionally-evaluated expressions. More...
 
struct  ConditionalInfo
 
class  ConstantEmission
 
class  DeclMapRevertingRAII
 
class  FieldConstructionScope
 A scope within which we are constructing the fields of an object which might use a CXXDefaultInitExpr. More...
 
struct  LexicalScope
 Represents a scope, including function bodies, compound statements, and the substatements of if/while/do/for/switch/try statements. More...
 
class  OpaqueValueMapping
 An RAII object to set (and then clear) a mapping for an OpaqueValueExpr. More...
 
class  OpaqueValueMappingData
 A non-RAII class containing all the information about a bound opaque value. More...
 
struct  OpenACCDataOperandInfo
 
struct  PrototypeWrapper
 
class  RunCleanupsScope
 Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited. More...
 
class  SourceLocRAIIObject
 
class  StmtExprEvaluation
 An RAII object to record that we're evaluating a statement expression. More...
 
struct  VPtr
 

Public Types

using DeclMapTy = llvm::DenseMap< const clang::Decl *, Address >
 
using SymTableTy = llvm::ScopedHashTable< const clang::Decl *, mlir::Value >
 The symbol table maps a variable name to a value in the current scope.
 
using SymTableScopeTy = llvm::ScopedHashTableScope< const clang::Decl *, mlir::Value >
 
using VisitedVirtualBasesSetTy = llvm::SmallPtrSet< const clang::CXXRecordDecl *, 4 >
 
using VPtrsVector = llvm::SmallVector< VPtr, 4 >
 
typedef void Destroyer(CIRGenFunction &cgf, Address addr, QualType ty)
 

Public Member Functions

clang::ASTContextgetContext () const
 
CIRGenBuilderTygetBuilder ()
 
CIRGenModulegetCIRGenModule ()
 
const CIRGenModulegetCIRGenModule () const
 
mlir::Block * getCurFunctionEntryBlock ()
 
mlir::Type convertTypeForMem (QualType t)
 
mlir::Type convertType (clang::QualType t)
 
mlir::Type convertType (const TypeDecl *t)
 
 CIRGenFunction (CIRGenModule &cgm, CIRGenBuilderTy &builder, bool suppressNewContext=false)
 
 ~CIRGenFunction ()
 
CIRGenTypesgetTypes () const
 
const TargetInfogetTarget () const
 
mlir::MLIRContext & getMLIRContext ()
 
mlir::Value createDummyValue (mlir::Location loc, clang::QualType qt)
 
void emitNullInitialization (mlir::Location loc, Address destPtr, QualType ty)
 
std::string getCounterRefTmpAsString ()
 
std::string getCounterAggTmpAsString ()
 
mlir::Location getLoc (clang::SourceLocation srcLoc)
 Helpers to convert Clang's SourceLocation to a MLIR Location.
 
mlir::Location getLoc (clang::SourceRange srcLoc)
 
mlir::Location getLoc (mlir::Location lhs, mlir::Location rhs)
 
const clang::LangOptionsgetLangOpts () const
 
bool haveInsertPoint () const
 True if an insertion point is defined.
 
bool isLValueSuitableForInlineAtomic (LValue lv)
 An LValue is a candidate for having its loads and stores be made atomic if we are operating under /volatile:ms and the LValue itself is volatile and performing such an operation can be performed without a libcall.
 
void finishFunction (SourceLocation endLoc)
 
bool isTrivialInitializer (const Expr *init)
 Determine whether the given initializer is trivial in the sense that it requires no code to be generated.
 
bool constantFoldsToBool (const clang::Expr *cond, bool &resultBool, bool allowLabels=false)
 If the specified expression does not fold to a constant, or if it does but contains a label, return false.
 
bool constantFoldsToSimpleInteger (const clang::Expr *cond, llvm::APSInt &resultInt, bool allowLabels=false)
 If the specified expression does not fold to a constant, or if it does fold but contains a label, return false.
 
bool containsLabel (const clang::Stmt *s, bool ignoreCaseStmts=false)
 Return true if the statement contains a label in it.
 
ConstantEmission tryEmitAsConstant (const DeclRefExpr *refExpr)
 Try to emit a reference to the given value without producing it as an l-value.
 
ConstantEmission tryEmitAsConstant (const MemberExpr *me)
 
mlir::Value evaluateExprAsBool (const clang::Expr *e)
 Perform the usual unary conversions on the specified expression and compare the result against zero, returning an Int1Ty value.
 
cir::GlobalOp addInitializerToStaticVarDecl (const VarDecl &d, cir::GlobalOp gv, cir::GetGlobalOp gvAddr)
 Add the initializer for 'd' to the global variable that has already been created for it.
 
void setAddrOfLocalVar (const clang::VarDecl *vd, Address addr)
 Set the address of a local variable.
 
bool shouldNullCheckClassCastValue (const CastExpr *ce)
 
RValue convertTempToRValue (Address addr, clang::QualType type, clang::SourceLocation loc)
 Given the address of a temporary variable, produce an r-value of its type.
 
VPtrsVector getVTablePointers (const clang::CXXRecordDecl *vtableClass)
 
void getVTablePointers (clang::BaseSubobject base, const clang::CXXRecordDecl *nearestVBase, clang::CharUnits offsetFromNearestVBase, bool baseIsNonVirtualPrimaryBase, const clang::CXXRecordDecl *vtableClass, VisitedVirtualBasesSetTy &vbases, VPtrsVector &vptrs)
 
mlir::Value getVTablePtr (mlir::Location loc, Address thisAddr, const clang::CXXRecordDecl *vtableClass)
 Return the Value of the vtable pointer member pointed to by thisAddr.
 
bool shouldEmitVTableTypeCheckedLoad (const CXXRecordDecl *rd)
 Returns whether we should perform a type checked load when loading a virtual function for virtual calls to members of RD.
 
LValue makeNaturalAlignPointeeAddrLValue (mlir::Value v, clang::QualType t)
 Given a value of type T* that may not be to a complete object, construct an l-vlaue withi the natural pointee alignment of T.
 
LValue makeNaturalAlignAddrLValue (mlir::Value val, QualType ty)
 
Address makeNaturalAddressForPointer (mlir::Value ptr, QualType t, CharUnits alignment, bool forPointeeType=false, LValueBaseInfo *baseInfo=nullptr)
 Construct an address with the natural alignment of T.
 
Address getAddressOfBaseClass (Address value, const CXXRecordDecl *derived, llvm::iterator_range< CastExpr::path_const_iterator > path, bool nullCheckValue, SourceLocation loc)
 
LValue makeAddrLValue (Address addr, QualType ty, AlignmentSource source=AlignmentSource::Type)
 
LValue makeAddrLValue (Address addr, QualType ty, LValueBaseInfo baseInfo)
 
void initializeVTablePointers (mlir::Location loc, const clang::CXXRecordDecl *rd)
 
void initializeVTablePointer (mlir::Location loc, const VPtr &vptr)
 
Address getAddrOfLocalVar (const clang::VarDecl *vd)
 Return the address of a local variable.
 
Address getAddrOfBitFieldStorage (LValue base, const clang::FieldDecl *field, mlir::Type fieldType, unsigned index)
 
mlir::Value loadCXXThis ()
 Load the value for 'this'.
 
Address loadCXXThisAddress ()
 
Address getAddressOfDirectBaseInCompleteClass (mlir::Location loc, Address value, const CXXRecordDecl *derived, const CXXRecordDecl *base, bool baseIsVirtual)
 Convert the given pointer to a complete class to the given direct base.
 
AggValueSlot::Overlap_t getOverlapForBaseInit (const CXXRecordDecl *rd, const CXXRecordDecl *baseRD, bool isVirtual)
 Determine whether a base class initialization may overlap some other object.
 
RValue getUndefRValue (clang::QualType ty)
 Get an appropriate 'undef' rvalue for the given type.
 
cir::FuncOp generateCode (clang::GlobalDecl gd, cir::FuncOp fn, cir::FuncType funcType)
 
clang::QualType buildFunctionArgList (clang::GlobalDecl gd, FunctionArgList &args)
 
void startFunction (clang::GlobalDecl gd, clang::QualType returnType, cir::FuncOp fn, cir::FuncType funcType, FunctionArgList args, clang::SourceLocation loc, clang::SourceLocation startLoc)
 Emit code for the start of a function.
 
void popCleanupBlocks (EHScopeStack::stable_iterator oldCleanupStackDepth)
 Takes the old cleanup stack size and emits the cleanup blocks that have been added.
 
void popCleanupBlock ()
 Pops a cleanup block.
 
template<class T , class... As>
void pushFullExprCleanup (CleanupKind kind, As... a)
 Push a cleanup to be run at the end of the current full-expression.
 
void pushDestroy (CleanupKind kind, Address addr, QualType type, Destroyer *destroyer)
 
DestroyergetDestroyer (clang::QualType::DestructionKind kind)
 
mlir::Value emitAlignmentAssumption (mlir::Value ptrValue, QualType ty, SourceLocation loc, SourceLocation assumptionLoc, int64_t alignment, mlir::Value offsetValue=nullptr)
 
mlir::Value emitAlignmentAssumption (mlir::Value ptrValue, const Expr *expr, SourceLocation assumptionLoc, int64_t alignment, mlir::Value offsetValue=nullptr)
 
Address emitAddrOfFieldStorage (Address base, const FieldDecl *field, llvm::StringRef fieldName, unsigned fieldIndex)
 Get the address of a zero-sized field within a record.
 
mlir::Value emitAlloca (llvm::StringRef name, mlir::Type ty, mlir::Location loc, clang::CharUnits alignment, bool insertIntoFnEntryBlock, mlir::Value arraySize=nullptr)
 
mlir::Value emitAlloca (llvm::StringRef name, mlir::Type ty, mlir::Location loc, clang::CharUnits alignment, mlir::OpBuilder::InsertPoint ip, mlir::Value arraySize=nullptr)
 
void emitAggregateStore (mlir::Value value, Address dest)
 
void emitAggExpr (const clang::Expr *e, AggValueSlot slot)
 
LValue emitAggExprToLValue (const Expr *e)
 
RValue emitAnyExpr (const clang::Expr *e, AggValueSlot aggSlot=AggValueSlot::ignored())
 Emit code to compute the specified expression which can have any type.
 
void emitAnyExprToMem (const Expr *e, Address location, Qualifiers quals, bool isInitializer)
 Emits the code necessary to evaluate an arbitrary expression into the given memory location.
 
RValue emitAnyExprToTemp (const clang::Expr *e)
 Similarly to emitAnyExpr(), however, the result will always be accessible even if no aggregate location is provided.
 
void emitArrayDestroy (mlir::Value begin, mlir::Value end, QualType elementType, CharUnits elementAlign, Destroyer *destroyer)
 Destroys all the elements of the given array, beginning from last to first.
 
mlir::Value emitArrayLength (const clang::ArrayType *arrayType, QualType &baseType, Address &addr)
 Computes the length of an array in elements, as well as the base element type and a properly-typed first element pointer.
 
LValue emitArraySubscriptExpr (const clang::ArraySubscriptExpr *e)
 
Address emitArrayToPointerDecay (const Expr *e, LValueBaseInfo *baseInfo=nullptr)
 
mlir::LogicalResult emitAsmStmt (const clang::AsmStmt &s)
 
RValue emitAtomicExpr (AtomicExpr *e)
 
void emitAtomicInit (Expr *init, LValue dest)
 
AutoVarEmission emitAutoVarAlloca (const clang::VarDecl &d, mlir::OpBuilder::InsertPoint ip={})
 
void emitAutoVarDecl (const clang::VarDecl &d)
 Emit code and set up symbol table for a variable declaration with auto, register, or no storage class specifier.
 
void emitAutoVarCleanups (const AutoVarEmission &emission)
 
void emitAutoVarInit (const AutoVarEmission &emission)
 Emit the initializer for an allocated variable.
 
void emitAutoVarTypeCleanup (const AutoVarEmission &emission, clang::QualType::DestructionKind dtorKind)
 Enter a destroy cleanup for the given local variable.
 
void maybeEmitDeferredVarDeclInit (const VarDecl *vd)
 
void emitBaseInitializer (mlir::Location loc, const CXXRecordDecl *classDecl, CXXCtorInitializer *baseInit)
 
LValue emitBinaryOperatorLValue (const BinaryOperator *e)
 
mlir::LogicalResult emitBreakStmt (const clang::BreakStmt &s)
 
RValue emitBuiltinExpr (const clang::GlobalDecl &gd, unsigned builtinID, const clang::CallExpr *e, ReturnValueSlot returnValue)
 
RValue emitCall (const CIRGenFunctionInfo &funcInfo, const CIRGenCallee &callee, ReturnValueSlot returnValue, const CallArgList &args, cir::CIRCallOpInterface *callOp, mlir::Location loc)
 
RValue emitCall (const CIRGenFunctionInfo &funcInfo, const CIRGenCallee &callee, ReturnValueSlot returnValue, const CallArgList &args, cir::CIRCallOpInterface *callOrTryCall=nullptr)
 
RValue emitCall (clang::QualType calleeTy, const CIRGenCallee &callee, const clang::CallExpr *e, ReturnValueSlot returnValue)
 
void emitCallArg (CallArgList &args, const clang::Expr *e, clang::QualType argType)
 
void emitCallArgs (CallArgList &args, PrototypeWrapper prototype, llvm::iterator_range< clang::CallExpr::const_arg_iterator > argRange, AbstractCallee callee=AbstractCallee(), unsigned paramsToSkip=0)
 
RValue emitCallExpr (const clang::CallExpr *e, ReturnValueSlot returnValue=ReturnValueSlot())
 
LValue emitCallExprLValue (const clang::CallExpr *e)
 
CIRGenCallee emitCallee (const clang::Expr *e)
 
template<typename T >
mlir::LogicalResult emitCaseDefaultCascade (const T *stmt, mlir::Type condType, mlir::ArrayAttr value, cir::CaseOpKind kind, bool buildingTopLevelCase)
 
mlir::LogicalResult emitCaseStmt (const clang::CaseStmt &s, mlir::Type condType, bool buildingTopLevelCase)
 
LValue emitCastLValue (const CastExpr *e)
 Casts are never lvalues unless that cast is to a reference type.
 
mlir::Value emitCheckedArgForAssume (const Expr *e)
 Emits an argument for a call to a __builtin_assume.
 
mlir::Value emitComplexToScalarConversion (mlir::Value src, QualType srcTy, QualType dstTy, SourceLocation loc)
 Emit a conversion from the specified complex type to the specified destination type, where the destination type is an LLVM scalar type.
 
LValue emitCompoundAssignmentLValue (const clang::CompoundAssignOperator *e)
 
LValue emitCompoundLiteralLValue (const CompoundLiteralExpr *e)
 
void emitConstructorBody (FunctionArgList &args)
 
void emitDestroy (Address addr, QualType type, Destroyer *destroyer)
 Immediately perform the destruction of the given object.
 
void emitDestructorBody (FunctionArgList &args)
 Emits the body of the current destructor.
 
mlir::LogicalResult emitContinueStmt (const clang::ContinueStmt &s)
 
void emitCXXConstructExpr (const clang::CXXConstructExpr *e, AggValueSlot dest)
 
void emitCXXAggrConstructorCall (const CXXConstructorDecl *ctor, const clang::ArrayType *arrayType, Address arrayBegin, const CXXConstructExpr *e, bool newPointerIsChecked, bool zeroInitialize=false)
 Emit a loop to call a particular constructor for each of several members of an array.
 
void emitCXXAggrConstructorCall (const CXXConstructorDecl *ctor, mlir::Value numElements, Address arrayBase, const CXXConstructExpr *e, bool newPointerIsChecked, bool zeroInitialize)
 Emit a loop to call a particular constructor for each of several members of an array.
 
void emitCXXConstructorCall (const clang::CXXConstructorDecl *d, clang::CXXCtorType type, bool forVirtualBase, bool delegating, AggValueSlot thisAVS, const clang::CXXConstructExpr *e)
 
void emitCXXConstructorCall (const clang::CXXConstructorDecl *d, clang::CXXCtorType type, bool forVirtualBase, bool delegating, Address thisAddr, CallArgList &args, clang::SourceLocation loc)
 
void emitCXXDestructorCall (const CXXDestructorDecl *dd, CXXDtorType type, bool forVirtualBase, bool delegating, Address thisAddr, QualType thisTy)
 
RValue emitCXXDestructorCall (GlobalDecl dtor, const CIRGenCallee &callee, mlir::Value thisVal, QualType thisTy, mlir::Value implicitParam, QualType implicitParamTy, const CallExpr *e)
 
mlir::LogicalResult emitCXXForRangeStmt (const CXXForRangeStmt &s, llvm::ArrayRef< const Attr * > attrs)
 
RValue emitCXXMemberCallExpr (const clang::CXXMemberCallExpr *e, ReturnValueSlot returnValue)
 
RValue emitCXXMemberOrOperatorCall (const clang::CXXMethodDecl *md, const CIRGenCallee &callee, ReturnValueSlot returnValue, mlir::Value thisPtr, mlir::Value implicitParam, clang::QualType implicitParamTy, const clang::CallExpr *ce, CallArgList *rtlArgs)
 
RValue emitCXXMemberOrOperatorMemberCallExpr (const clang::CallExpr *ce, const clang::CXXMethodDecl *md, ReturnValueSlot returnValue, bool hasQualifier, clang::NestedNameSpecifier qualifier, bool isArrow, const clang::Expr *base)
 
mlir::Value emitCXXNewExpr (const CXXNewExpr *e)
 
RValue emitCXXOperatorMemberCallExpr (const CXXOperatorCallExpr *e, const CXXMethodDecl *md, ReturnValueSlot returnValue)
 
RValue emitCXXPseudoDestructorExpr (const CXXPseudoDestructorExpr *expr)
 
void emitCXXThrowExpr (const CXXThrowExpr *e)
 
void emitCtorPrologue (const clang::CXXConstructorDecl *ctor, clang::CXXCtorType ctorType, FunctionArgList &args)
 This routine generates necessary code to initialize base classes and non-static data members belonging to this constructor.
 
void emitDelegatingCXXConstructorCall (const CXXConstructorDecl *ctor, const FunctionArgList &args)
 
mlir::LogicalResult emitDoStmt (const clang::DoStmt &s)
 
void emitExprAsInit (const clang::Expr *init, const clang::ValueDecl *d, LValue lvalue, bool capturedByInit=false)
 Emit an expression as an initializer for an object (variable, field, etc.) at the given location.
 
mlir::LogicalResult emitFunctionBody (const clang::Stmt *body)
 
mlir::LogicalResult emitGotoStmt (const clang::GotoStmt &s)
 
void emitImplicitAssignmentOperatorBody (FunctionArgList &args)
 
void emitInitializerForField (clang::FieldDecl *field, LValue lhs, clang::Expr *init)
 
mlir::Value emitPromotedComplexExpr (const Expr *e, QualType promotionType)
 
mlir::Value emitPromotedScalarExpr (const Expr *e, QualType promotionType)
 
mlir::Value emitPromotedValue (mlir::Value result, QualType promotionType)
 
mlir::Value emitScalarExpr (const clang::Expr *e)
 Emit the computation of the specified expression of scalar type.
 
mlir::Value emitScalarPrePostIncDec (const UnaryOperator *e, LValue lv, cir::UnaryOpKind kind, bool isPre)
 
void emitStopPoint (const Stmt *s)
 Build a debug stoppoint if we are emitting debug info.
 
mlir::LogicalResult emitStmt (const clang::Stmt *s, bool useCurrentScope, llvm::ArrayRef< const Attr * > attrs={})
 
mlir::LogicalResult emitSimpleStmt (const clang::Stmt *s, bool useCurrentScope)
 
mlir::LogicalResult emitForStmt (const clang::ForStmt &s)
 
mlir::Value emitComplexExpr (const Expr *e)
 Emit the computation of the specified expression of complex type, returning the result.
 
void emitComplexExprIntoLValue (const Expr *e, LValue dest, bool isInit)
 
mlir::Value emitComplexPrePostIncDec (const UnaryOperator *e, LValue lv, cir::UnaryOpKind op, bool isPre)
 
LValue emitComplexAssignmentLValue (const BinaryOperator *e)
 
LValue emitComplexCompoundAssignmentLValue (const CompoundAssignOperator *e)
 
LValue emitScalarCompoundAssignWithComplex (const CompoundAssignOperator *e, mlir::Value &result)
 
mlir::LogicalResult emitCompoundStmt (const clang::CompoundStmt &s, Address *lastValue=nullptr, AggValueSlot slot=AggValueSlot::ignored())
 
mlir::LogicalResult emitCompoundStmtWithoutScope (const clang::CompoundStmt &s, Address *lastValue=nullptr, AggValueSlot slot=AggValueSlot::ignored())
 
void emitDecl (const clang::Decl &d, bool evaluateConditionDecl=false)
 
mlir::LogicalResult emitDeclStmt (const clang::DeclStmt &s)
 
LValue emitDeclRefLValue (const clang::DeclRefExpr *e)
 
mlir::LogicalResult emitDefaultStmt (const clang::DefaultStmt &s, mlir::Type condType, bool buildingTopLevelCase)
 
void emitDelegateCXXConstructorCall (const clang::CXXConstructorDecl *ctor, clang::CXXCtorType ctorType, const FunctionArgList &args, clang::SourceLocation loc)
 
void emitDelegateCallArg (CallArgList &args, const clang::VarDecl *param, clang::SourceLocation loc)
 We are performing a delegate call; that is, the current function is delegating to another one.
 
mlir::LogicalResult emitIfOnBoolExpr (const clang::Expr *cond, const clang::Stmt *thenS, const clang::Stmt *elseS)
 Emit an if on a boolean condition to the specified blocks.
 
cir::IfOp emitIfOnBoolExpr (const clang::Expr *cond, BuilderCallbackRef thenBuilder, mlir::Location thenLoc, BuilderCallbackRef elseBuilder, std::optional< mlir::Location > elseLoc={})
 Emit an if on a boolean condition, filling then and else into appropriated regions.
 
mlir::Value emitOpOnBoolExpr (mlir::Location loc, const clang::Expr *cond)
 TODO(cir): see EmitBranchOnBoolExpr for extra ideas).
 
mlir::LogicalResult emitLabel (const clang::LabelDecl &d)
 
mlir::LogicalResult emitLabelStmt (const clang::LabelStmt &s)
 
mlir::LogicalResult emitIfStmt (const clang::IfStmt &s)
 
void emitIgnoredExpr (const clang::Expr *e)
 Emit code to compute the specified expression, ignoring the result.
 
RValue emitLoadOfBitfieldLValue (LValue lv, SourceLocation loc)
 
mlir::Value emitLoadOfComplex (LValue src, SourceLocation loc)
 Load a complex number from the specified l-value.
 
RValue emitLoadOfLValue (LValue lv, SourceLocation loc)
 Given an expression that represents a value lvalue, this method emits the address of the lvalue, then loads the result as an rvalue, returning the rvalue.
 
Address emitLoadOfReference (LValue refLVal, mlir::Location loc, LValueBaseInfo *pointeeBaseInfo)
 
LValue emitLoadOfReferenceLValue (Address refAddr, mlir::Location loc, QualType refTy, AlignmentSource source)
 
mlir::Value emitLoadOfScalar (LValue lvalue, SourceLocation loc)
 EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the memory representation to the LLVM value representation.
 
mlir::Value emitLoadOfScalar (Address addr, bool isVolatile, QualType ty, SourceLocation loc, LValueBaseInfo baseInfo)
 
LValue emitLValue (const clang::Expr *e)
 Emit code to compute a designator that specifies the location of the expression.
 
LValue emitLValueForBitField (LValue base, const FieldDecl *field)
 
LValue emitLValueForField (LValue base, const clang::FieldDecl *field)
 
LValue emitLValueForFieldInitialization (LValue base, const clang::FieldDecl *field, llvm::StringRef fieldName)
 Like emitLValueForField, excpet that if the Field is a reference, this will return the address of the reference and not the address of the value stored in the reference.
 
LValue emitMaterializeTemporaryExpr (const MaterializeTemporaryExpr *e)
 
LValue emitMemberExpr (const MemberExpr *e)
 
Address emitPointerWithAlignment (const clang::Expr *expr, LValueBaseInfo *baseInfo=nullptr)
 Given an expression with a pointer type, emit the value and compute our best estimate of the alignment of the pointee.
 
RValue emitReferenceBindingToExpr (const Expr *e)
 Emits a reference binding to the passed in expression.
 
mlir::LogicalResult emitReturnStmt (const clang::ReturnStmt &s)
 
RValue emitRotate (const CallExpr *e, bool isRotateLeft)
 
mlir::Value emitScalarConstant (const ConstantEmission &constant, Expr *e)
 
mlir::Value emitScalarConversion (mlir::Value src, clang::QualType srcType, clang::QualType dstType, clang::SourceLocation loc)
 Emit a conversion from the specified type to the specified destination type, both of which are CIR scalar types.
 
void emitScalarInit (const clang::Expr *init, mlir::Location loc, LValue lvalue, bool capturedByInit=false)
 
void emitStaticVarDecl (const VarDecl &d, cir::GlobalLinkageKind linkage)
 
void emitStoreOfComplex (mlir::Location loc, mlir::Value v, LValue dest, bool isInit)
 EmitStoreOfComplex - Store a complex number into the specified l-value.
 
void emitStoreOfScalar (mlir::Value value, Address addr, bool isVolatile, clang::QualType ty, bool isInit=false, bool isNontemporal=false)
 
void emitStoreOfScalar (mlir::Value value, LValue lvalue, bool isInit)
 
void emitStoreThroughLValue (RValue src, LValue dst, bool isInit=false)
 Store the specified rvalue into the specified lvalue, where both are guaranteed to the have the same type, and that type is 'Ty'.
 
mlir::Value emitStoreThroughBitfieldLValue (RValue src, LValue dstresult)
 
LValue emitStringLiteralLValue (const StringLiteral *e)
 
mlir::LogicalResult emitSwitchBody (const clang::Stmt *s)
 
mlir::LogicalResult emitSwitchCase (const clang::SwitchCase &s, bool buildingTopLevelCase)
 
mlir::LogicalResult emitSwitchStmt (const clang::SwitchStmt &s)
 
mlir::Value emitToMemory (mlir::Value value, clang::QualType ty)
 Given a value and its clang type, returns the value casted to its memory representation.
 
void emitTrap (mlir::Location loc, bool createNewBlock)
 Emit a trap instruction, which is used to abort the program in an abnormal way, usually for debugging purposes.
 
LValue emitUnaryOpLValue (const clang::UnaryOperator *e)
 
mlir::Value emitUnPromotedValue (mlir::Value result, QualType unPromotionType)
 
void emitUnreachable (clang::SourceLocation loc, bool createNewBlock)
 Emit a reached-unreachable diagnostic if loc is valid and runtime checking is enabled.
 
void emitVarDecl (const clang::VarDecl &d)
 This method handles emission of any variable declaration inside a function, including static vars etc.
 
void emitVariablyModifiedType (QualType ty)
 
mlir::LogicalResult emitWhileStmt (const clang::WhileStmt &s)
 
void emitNullabilityCheck (LValue lhs, mlir::Value rhs, clang::SourceLocation loc)
 Given an assignment *lhs = rhs, emit a test that checks if rhs is nonnull, if 1LHS is marked _Nonnull.
 
bool isInConditionalBranch () const
 
void setBeforeOutermostConditional (mlir::Value value, Address addr)
 
template<typename FuncTy >
ConditionalInfo emitConditionalBlocks (const AbstractConditionalOperator *e, const FuncTy &branchGenFunc)
 
mlir::Value emitTernaryOnBoolExpr (const clang::Expr *cond, mlir::Location loc, const clang::Stmt *thenS, const clang::Stmt *elseS)
 
Address emitVAListRef (const Expr *e)
 Build a "reference" to a va_list; this is either the address or the value of the expression, depending on how va_list is defined.
 
void emitVAStart (mlir::Value vaList, mlir::Value count)
 Emits the start of a CIR variable-argument operation (cir.va_start)
 
void emitVAEnd (mlir::Value vaList)
 Emits the end of a CIR variable-argument operation (cir.va_start)
 
mlir::Value emitVAArg (VAArgExpr *ve)
 Generate code to get an argument from the passed in pointer and update it accordingly.
 
cir::AllocaOp createTempAlloca (mlir::Type ty, mlir::Location loc, const Twine &name="tmp", mlir::Value arraySize=nullptr, bool insertIntoFnEntryBlock=false)
 This creates an alloca and inserts it into the entry block if ArraySize is nullptr, otherwise inserts it at the current insertion point of the builder.
 
cir::AllocaOp createTempAlloca (mlir::Type ty, mlir::Location loc, const Twine &name="tmp", mlir::OpBuilder::InsertPoint ip={}, mlir::Value arraySize=nullptr)
 This creates an alloca and inserts it into the provided insertion point.
 
Address createTempAlloca (mlir::Type ty, CharUnits align, mlir::Location loc, const Twine &name="tmp", mlir::Value arraySize=nullptr, Address *alloca=nullptr, mlir::OpBuilder::InsertPoint ip={})
 This creates a alloca and inserts it into the entry block.
 
Address createTempAllocaWithoutCast (mlir::Type ty, CharUnits align, mlir::Location loc, const Twine &name="tmp", mlir::Value arraySize=nullptr, mlir::OpBuilder::InsertPoint ip={})
 This creates a alloca and inserts it into the entry block of the current region.
 
Address createMemTemp (QualType t, mlir::Location loc, const Twine &name="tmp", Address *alloca=nullptr, mlir::OpBuilder::InsertPoint ip={})
 Create a temporary memory object of the given type, with appropriate alignmen and cast it to the default address space.
 
Address createMemTemp (QualType t, CharUnits align, mlir::Location loc, const Twine &name="tmp", Address *alloca=nullptr, mlir::OpBuilder::InsertPoint ip={})
 
OpenACCDataOperandInfo getOpenACCDataOperandInfo (const Expr *e)
 
mlir::Value emitOpenACCIntExpr (const Expr *intExpr)
 
mlir::Value createOpenACCConstantInt (mlir::Location loc, unsigned width, int64_t value)
 
mlir::LogicalResult emitOpenACCComputeConstruct (const OpenACCComputeConstruct &s)
 
mlir::LogicalResult emitOpenACCLoopConstruct (const OpenACCLoopConstruct &s)
 
mlir::LogicalResult emitOpenACCCombinedConstruct (const OpenACCCombinedConstruct &s)
 
mlir::LogicalResult emitOpenACCDataConstruct (const OpenACCDataConstruct &s)
 
mlir::LogicalResult emitOpenACCEnterDataConstruct (const OpenACCEnterDataConstruct &s)
 
mlir::LogicalResult emitOpenACCExitDataConstruct (const OpenACCExitDataConstruct &s)
 
mlir::LogicalResult emitOpenACCHostDataConstruct (const OpenACCHostDataConstruct &s)
 
mlir::LogicalResult emitOpenACCWaitConstruct (const OpenACCWaitConstruct &s)
 
mlir::LogicalResult emitOpenACCInitConstruct (const OpenACCInitConstruct &s)
 
mlir::LogicalResult emitOpenACCShutdownConstruct (const OpenACCShutdownConstruct &s)
 
mlir::LogicalResult emitOpenACCSetConstruct (const OpenACCSetConstruct &s)
 
mlir::LogicalResult emitOpenACCUpdateConstruct (const OpenACCUpdateConstruct &s)
 
mlir::LogicalResult emitOpenACCAtomicConstruct (const OpenACCAtomicConstruct &s)
 
mlir::LogicalResult emitOpenACCCacheConstruct (const OpenACCCacheConstruct &s)
 
void emitOpenACCDeclare (const OpenACCDeclareDecl &d)
 
void emitOpenACCRoutine (const OpenACCRoutineDecl &d)
 
AggValueSlot createAggTemp (QualType ty, mlir::Location loc, const Twine &name="tmp", Address *alloca=nullptr)
 Create a temporary memory object for the given aggregate type.
 
template<typename T >
mlir::LogicalResult emitCaseDefaultCascade (const T *stmt, mlir::Type condType, mlir::ArrayAttr value, CaseOpKind kind, bool buildingTopLevelCase)
 
- Public Member Functions inherited from clang::CIRGen::CIRGenTypeCache
 CIRGenTypeCache ()
 
clang::CharUnits getSizeAlign () const
 
clang::CharUnits getPointerAlign () const
 

Static Public Member Functions

static cir::TypeEvaluationKind getEvaluationKind (clang::QualType type)
 Return the cir::TypeEvaluationKind of QualType type.
 
static bool hasScalarEvaluationKind (clang::QualType type)
 
static bool hasAggregateEvaluationKind (clang::QualType type)
 
static bool isConstructorDelegationValid (const clang::CXXConstructorDecl *ctor)
 Checks whether the given constructor is a valid subject for the complete-to-base constructor delegation optimization, i.e.
 

Public Attributes

CIRGenModulecgm
 
clang::GlobalDecl curGD
 The GlobalDecl for the current function being compiled or the global variable currently being initialized.
 
std::optional< mlir::Value > fnRetAlloca
 The compiler-generated variable that holds the return value.
 
EHScopeStack ehStack
 Tracks function scope overall cleanup handling.
 
ImplicitParamDeclcxxabiThisDecl = nullptr
 CXXThisDecl - When generating code for a C++ member function, this will hold the implicit 'this' declaration.
 
mlir::Value cxxabiThisValue = nullptr
 
mlir::Value cxxThisValue = nullptr
 
clang::CharUnits cxxThisAlignment
 
Address cxxDefaultInitExprThis = Address::invalid()
 The value of 'this' to sue when evaluating CXXDefaultInitExprs within this expression.
 
const clang::DeclcurFuncDecl = nullptr
 
cir::FuncOp curFn
 The function for which code is currently being generated.
 
DeclMapTy localDeclMap
 This keeps track of the CIR allocas or globals for local C declarations.
 
llvm::SmallVector< mlir::Type, 2 > condTypeStack
 The type of the condition for the emitting switch statement.
 
clang::SanitizerSet sanOpts
 Sanitizers enabled for this function.
 
SymTableTy symbolTable
 
bool sawAsmBlock = false
 Whether or not a Microsoft-style asm block has been processed within this fuction.
 
llvm::DenseMap< const OpaqueValueExpr *, LValueopaqueLValues
 Keeps track of the current set of opaque value expressions.
 
llvm::DenseMap< const OpaqueValueExpr *, RValueopaqueRValues
 
std::optional< mlir::Location > currSrcLoc
 Use to track source locations across nested visitor traversals.
 
unsigned counterRefTmp = 0
 Hold counters for incrementally naming temporaries.
 
unsigned counterAggTmp = 0
 
EHScopeStack::stable_iterator prologueCleanupDepth
 The cleanup depth enclosing all the cleanups associated with the parameters.
 
EHScopeStack::stable_iterator currentCleanupStackDepth = ehStack.stable_end()
 
LexicalScopecurLexScope = nullptr
 
ConditionalEvaluationoutermostConditional = nullptr
 
- Public Attributes inherited from clang::CIRGen::CIRGenTypeCache
cir::VoidType VoidTy
 
cir::IntType SInt8Ty
 
cir::IntType SInt16Ty
 
cir::IntType SInt32Ty
 
cir::IntType SInt64Ty
 
cir::IntType SInt128Ty
 
cir::IntType UInt8Ty
 
cir::IntType UInt16Ty
 
cir::IntType UInt32Ty
 
cir::IntType UInt64Ty
 
cir::IntType UInt128Ty
 
cir::FP16Type FP16Ty
 
cir::BF16Type BFloat16Ty
 
cir::SingleType FloatTy
 
cir::DoubleType DoubleTy
 
cir::FP80Type FP80Ty
 
cir::FP128Type FP128Ty
 
union {
   mlir::Type   UIntPtrTy
 
   mlir::Type   SizeTy
 
}; 
 intptr_t, size_t, and ptrdiff_t, which we assume are the same size.
 
mlir::Type PtrDiffTy
 
cir::PointerType VoidPtrTy
 void* in address space 0
 
cir::PointerType UInt8PtrTy
 
union {
   unsigned char   PointerAlignInBytes
 
   unsigned char   PointerSizeInBytes
 
}; 
 The size and alignment of a pointer into the generic address space.
 
unsigned char SizeAlignInBytes
 The alignment of size_t.
 

Static Public Attributes

static Destroyer destroyCXXObject
 

Friends

class ::ScalarExprEmitter
 

Detailed Description

Definition at line 48 of file CIRGenFunction.h.

Member Typedef Documentation

◆ DeclMapTy

Definition at line 87 of file CIRGenFunction.h.

◆ Destroyer

typedef void clang::CIRGen::CIRGenFunction::Destroyer(CIRGenFunction &cgf, Address addr, QualType ty)

Definition at line 918 of file CIRGenFunction.h.

◆ SymTableScopeTy

using clang::CIRGen::CIRGenFunction::SymTableScopeTy = llvm::ScopedHashTableScope<const clang::Decl *, mlir::Value>

Definition at line 337 of file CIRGenFunction.h.

◆ SymTableTy

using clang::CIRGen::CIRGenFunction::SymTableTy = llvm::ScopedHashTable<const clang::Decl *, mlir::Value>

The symbol table maps a variable name to a value in the current scope.

Entering a function creates a new scope, and the function arguments are added to the mapping. When the processing of a function is terminated, the scope is destroyed and the mappings created in this scope are dropped.

Definition at line 112 of file CIRGenFunction.h.

◆ VisitedVirtualBasesSetTy

Definition at line 577 of file CIRGenFunction.h.

◆ VPtrsVector

Definition at line 580 of file CIRGenFunction.h.

Constructor & Destructor Documentation

◆ CIRGenFunction()

clang::CIRGen::CIRGenFunction::CIRGenFunction ( CIRGenModule cgm,
CIRGenBuilderTy builder,
bool  suppressNewContext = false 
)

Definition at line 27 of file CIRGenFunction.cpp.

References ehStack, and clang::CIRGen::EHScopeStack::setCGF().

◆ ~CIRGenFunction()

clang::CIRGen::CIRGenFunction::~CIRGenFunction ( )

Definition at line 33 of file CIRGenFunction.cpp.

Member Function Documentation

◆ addInitializerToStaticVarDecl()

cir::GlobalOp CIRGenFunction::addInitializerToStaticVarDecl ( const VarDecl d,
cir::GlobalOp  gv,
cir::GetGlobalOp  gvAddr 
)

Add the initializer for 'd' to the global variable that has already been created for it.

If the initializer has a different type than gv does, this may free gv and return a different one. Otherwise it just returns gv.

Definition at line 358 of file CIRGenDecl.cpp.

References cir::MissingFeatures::addressSpace(), cgm, cir::MissingFeatures::dataLayoutTypeAllocSize(), clang::QualType::DK_cxx_destructor, clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::ConstantEmitter::finalize(), getContext(), cir::CIRBaseBuilderTy::getPointerTo(), clang::VarDecl::getSourceRange(), clang::VarDecl::needsDestruction(), cir::MissingFeatures::opGlobalConstant(), and clang::CIRGen::ConstantEmitter::tryEmitForInitializer().

Referenced by emitStaticVarDecl().

◆ buildFunctionArgList()

clang::QualType clang::CIRGen::CIRGenFunction::buildFunctionArgList ( clang::GlobalDecl  gd,
FunctionArgList args 
)

◆ constantFoldsToBool()

bool clang::CIRGen::CIRGenFunction::constantFoldsToBool ( const clang::Expr cond,
bool resultBool,
bool  allowLabels = false 
)

If the specified expression does not fold to a constant, or if it does but contains a label, return false.

If it constant folds return true and set the boolean result in Result.

Definition at line 176 of file CIRGenFunction.cpp.

References constantFoldsToSimpleInteger().

Referenced by emitIfStmt().

◆ constantFoldsToSimpleInteger()

bool clang::CIRGen::CIRGenFunction::constantFoldsToSimpleInteger ( const clang::Expr cond,
llvm::APSInt &  resultInt,
bool  allowLabels = false 
)

If the specified expression does not fold to a constant, or if it does fold but contains a label, return false.

If it constant folds, return true and set the folded value.

Definition at line 189 of file CIRGenFunction.cpp.

References containsLabel(), clang::Expr::EvaluateAsInt(), getContext(), clang::APValue::getInt(), and clang::Expr::EvalResult::Val.

Referenced by constantFoldsToBool().

◆ containsLabel()

bool clang::CIRGen::CIRGenFunction::containsLabel ( const clang::Stmt s,
bool  ignoreCaseStmts = false 
)

Return true if the statement contains a label in it.

If this statement is not executed normally, it not containing a label means that we can just remove the code.

Definition at line 141 of file CIRGenFunction.cpp.

References s.

Referenced by constantFoldsToSimpleInteger().

◆ convertTempToRValue()

RValue CIRGenFunction::convertTempToRValue ( Address  addr,
clang::QualType  type,
clang::SourceLocation  loc 
)

◆ convertType() [1/2]

mlir::Type clang::CIRGen::CIRGenFunction::convertType ( clang::QualType  t)

◆ convertType() [2/2]

mlir::Type clang::CIRGen::CIRGenFunction::convertType ( const TypeDecl t)
inline

Definition at line 122 of file CIRGenFunction.h.

References convertType(), and getContext().

◆ convertTypeForMem()

mlir::Type clang::CIRGen::CIRGenFunction::convertTypeForMem ( QualType  t)

◆ createAggTemp()

AggValueSlot clang::CIRGen::CIRGenFunction::createAggTemp ( QualType  ty,
mlir::Location  loc,
const Twine &  name = "tmp",
Address alloca = nullptr 
)
inline

◆ createDummyValue()

mlir::Value CIRGenFunction::createDummyValue ( mlir::Location  loc,
clang::QualType  qt 
)

◆ createMemTemp() [1/2]

Address CIRGenFunction::createMemTemp ( QualType  t,
CharUnits  align,
mlir::Location  loc,
const Twine &  name = "tmp",
Address alloca = nullptr,
mlir::OpBuilder::InsertPoint  ip = {} 
)

◆ createMemTemp() [2/2]

Address CIRGenFunction::createMemTemp ( QualType  t,
mlir::Location  loc,
const Twine &  name = "tmp",
Address alloca = nullptr,
mlir::OpBuilder::InsertPoint  ip = {} 
)

Create a temporary memory object of the given type, with appropriate alignmen and cast it to the default address space.

Returns the original alloca instruction by Alloca if it is not nullptr.

Definition at line 2080 of file CIRGenExpr.cpp.

References createMemTemp(), and getContext().

Referenced by createAggTemp(), createMemTemp(), createReferenceTemporary(), emitAggExprToLValue(), emitCall(), emitCompoundLiteralLValue(), and emitValToTemp().

◆ createOpenACCConstantInt()

mlir::Value CIRGenFunction::createOpenACCConstantInt ( mlir::Location  loc,
unsigned  width,
int64_t  value 
)

Definition at line 56 of file CIRGenOpenACC.cpp.

References getMLIRContext().

Referenced by getOpenACCDataOperandInfo().

◆ createTempAlloca() [1/3]

Address CIRGenFunction::createTempAlloca ( mlir::Type  ty,
CharUnits  align,
mlir::Location  loc,
const Twine &  name = "tmp",
mlir::Value  arraySize = nullptr,
Address allocaAddr = nullptr,
mlir::OpBuilder::InsertPoint  ip = {} 
)

This creates a alloca and inserts it into the entry block.

The alloca is casted to default address space if necessary.

Definition at line 2115 of file CIRGenExpr.cpp.

References cir::MissingFeatures::addressSpace(), createTempAllocaWithoutCast(), and clang::CIRGen::Address::getPointer().

◆ createTempAlloca() [2/3]

cir::AllocaOp CIRGenFunction::createTempAlloca ( mlir::Type  ty,
mlir::Location  loc,
const Twine &  name = "tmp",
mlir::OpBuilder::InsertPoint  ip = {},
mlir::Value  arraySize = nullptr 
)

This creates an alloca and inserts it into the provided insertion point.

Definition at line 2147 of file CIRGenExpr.cpp.

References emitAlloca().

◆ createTempAlloca() [3/3]

cir::AllocaOp CIRGenFunction::createTempAlloca ( mlir::Type  ty,
mlir::Location  loc,
const Twine &  name = "tmp",
mlir::Value  arraySize = nullptr,
bool  insertIntoFnEntryBlock = false 
)

This creates an alloca and inserts it into the entry block if ArraySize is nullptr, otherwise inserts it at the current insertion point of the builder.


CIR build helpers

Definition at line 2136 of file CIRGenExpr.cpp.

References emitAlloca().

Referenced by createMemTemp(), createTempAllocaWithoutCast(), and emitAutoVarAlloca().

◆ createTempAllocaWithoutCast()

Address CIRGenFunction::createTempAllocaWithoutCast ( mlir::Type  ty,
CharUnits  align,
mlir::Location  loc,
const Twine &  name = "tmp",
mlir::Value  arraySize = nullptr,
mlir::OpBuilder::InsertPoint  ip = {} 
)

This creates a alloca and inserts it into the entry block of the current region.

Definition at line 2103 of file CIRGenExpr.cpp.

References cgm, createTempAlloca(), and clang::CIRGen::CIRGenModule::getSize().

Referenced by createTempAlloca().

◆ emitAddrOfFieldStorage()

Address CIRGenFunction::emitAddrOfFieldStorage ( Address  base,
const FieldDecl field,
llvm::StringRef  fieldName,
unsigned  fieldIndex 
)

◆ emitAggExpr()

void CIRGenFunction::emitAggExpr ( const clang::Expr e,
AggValueSlot  slot 
)

◆ emitAggExprToLValue()

LValue CIRGenFunction::emitAggExprToLValue ( const Expr e)

◆ emitAggregateStore()

void CIRGenFunction::emitAggregateStore ( mlir::Value  value,
Address  dest 
)

Definition at line 83 of file CIRGenCall.cpp.

References clang::CIRGen::CIRGenBuilderTy::createStore(), and currSrcLoc.

Referenced by emitCall().

◆ emitAlignmentAssumption() [1/2]

mlir::Value clang::CIRGen::CIRGenFunction::emitAlignmentAssumption ( mlir::Value  ptrValue,
const Expr expr,
SourceLocation  assumptionLoc,
int64_t  alignment,
mlir::Value  offsetValue = nullptr 
)

Definition at line 938 of file CIRGenFunction.cpp.

References emitAlignmentAssumption(), and clang::ast_matchers::expr.

◆ emitAlignmentAssumption() [2/2]

mlir::Value clang::CIRGen::CIRGenFunction::emitAlignmentAssumption ( mlir::Value  ptrValue,
QualType  ty,
SourceLocation  loc,
SourceLocation  assumptionLoc,
int64_t  alignment,
mlir::Value  offsetValue = nullptr 
)

CIR emit functions

Definition at line 930 of file CIRGenFunction.cpp.

References getLoc(), and cir::MissingFeatures::sanitizers().

Referenced by emitAlignmentAssumption(), and emitBuiltinExpr().

◆ emitAlloca() [1/2]

mlir::Value clang::CIRGen::CIRGenFunction::emitAlloca ( llvm::StringRef  name,
mlir::Type  ty,
mlir::Location  loc,
clang::CharUnits  alignment,
bool  insertIntoFnEntryBlock,
mlir::Value  arraySize = nullptr 
)

Referenced by createTempAlloca(), and startFunction().

◆ emitAlloca() [2/2]

mlir::Value clang::CIRGen::CIRGenFunction::emitAlloca ( llvm::StringRef  name,
mlir::Type  ty,
mlir::Location  loc,
clang::CharUnits  alignment,
mlir::OpBuilder::InsertPoint  ip,
mlir::Value  arraySize = nullptr 
)

◆ emitAnyExpr()

RValue CIRGenFunction::emitAnyExpr ( const clang::Expr e,
AggValueSlot  aggSlot = AggValueSlot::ignored() 
)

Emit code to compute the specified expression which can have any type.

The result is returned as an RValue struct. If this is an aggregate expression, the aggloc/agglocvolatile arguments indicate where the result should be returned.

The result is returned as an RValue struct.

Definition at line 1481 of file CIRGenExpr.cpp.

References clang::CIRGen::AggValueSlot::asRValue(), createAggTemp(), emitAggExpr(), emitComplexExpr(), emitScalarExpr(), clang::CIRGen::RValue::get(), clang::CIRGen::RValue::getComplex(), getCounterAggTmpAsString(), getEvaluationKind(), getLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::CIRGen::AggValueSlot::isIgnored(), cir::TEK_Aggregate, cir::TEK_Complex, and cir::TEK_Scalar.

Referenced by clang::CIRGen::CIRGenFunction::OpaqueValueMappingData::bind(), emitAnyExprToTemp(), emitBinaryOperatorLValue(), emitIgnoredExpr(), and emitReturnStmt().

◆ emitAnyExprToMem()

void CIRGenFunction::emitAnyExprToMem ( const Expr e,
Address  location,
Qualifiers  quals,
bool  isInitializer 
)

◆ emitAnyExprToTemp()

RValue CIRGenFunction::emitAnyExprToTemp ( const clang::Expr e)

Similarly to emitAnyExpr(), however, the result will always be accessible even if no aggregate location is provided.

Similar to emitAnyExpr(), however, the result will always be accessible even if no aggregate location is provided.

Definition at line 721 of file CIRGenCall.cpp.

References createAggTemp(), emitAnyExpr(), getCounterAggTmpAsString(), getLoc(), clang::Stmt::getSourceRange(), clang::Expr::getType(), hasAggregateEvaluationKind(), and clang::CIRGen::AggValueSlot::ignored().

Referenced by emitCallArg().

◆ emitArrayDestroy()

void CIRGenFunction::emitArrayDestroy ( mlir::Value  begin,
mlir::Value  end,
QualType  elementType,
CharUnits  elementAlign,
Destroyer destroyer 
)

Destroys all the elements of the given array, beginning from last to first.

The array cannot be zero-length.

Parameters
begin- a type* denoting the first element of the array
end- a type* denoting one past the end of the array
elementType- the element type of the array
destroyer- the function to call to destroy elements

Definition at line 695 of file CIRGenDecl.cpp.

References b, convertTypeForMem(), currSrcLoc, cir::MissingFeatures::dtorCleanups(), cir::CIRBaseBuilderTy::getPointerTo(), and clang::Type::isArrayType().

Referenced by emitDestroy().

◆ emitArrayLength()

mlir::Value clang::CIRGen::CIRGenFunction::emitArrayLength ( const clang::ArrayType arrayType,
QualType baseType,
Address addr 
)

Computes the length of an array in elements, as well as the base element type and a properly-typed first element pointer.

Definition at line 889 of file CIRGenFunction.cpp.

References clang::ast_matchers::arrayType, cgm, currSrcLoc, clang::CIRGen::CIRGenModule::errorNYI(), clang::ASTContext::getAsArrayType(), getContext(), clang::CIRGen::Address::getElementType(), clang::CIRGen::CIRGenTypeCache::SizeTy, and cir::MissingFeatures::vlas().

Referenced by emitCXXAggrConstructorCall(), and emitDestroy().

◆ emitArraySubscriptExpr()

LValue CIRGenFunction::emitArraySubscriptExpr ( const clang::ArraySubscriptExpr e)

◆ emitArrayToPointerDecay()

Address CIRGenFunction::emitArrayToPointerDecay ( const Expr e,
LValueBaseInfo baseInfo = nullptr 
)

◆ emitAsmStmt()

mlir::LogicalResult CIRGenFunction::emitAsmStmt ( const clang::AsmStmt s)

◆ emitAtomicExpr()

RValue CIRGenFunction::emitAtomicExpr ( AtomicExpr e)

◆ emitAtomicInit()

void CIRGenFunction::emitAtomicInit ( Expr init,
LValue  dest 
)

◆ emitAutoVarAlloca()

CIRGenFunction::AutoVarEmission CIRGenFunction::emitAutoVarAlloca ( const clang::VarDecl d,
mlir::OpBuilder::InsertPoint  ip = {} 
)

◆ emitAutoVarCleanups()

void CIRGenFunction::emitAutoVarCleanups ( const AutoVarEmission emission)

◆ emitAutoVarDecl()

void CIRGenFunction::emitAutoVarDecl ( const clang::VarDecl d)

Emit code and set up symbol table for a variable declaration with auto, register, or no storage class specifier.

These turn into simple stack objects, globals depending on target.

Definition at line 205 of file CIRGenDecl.cpp.

References emitAutoVarAlloca(), emitAutoVarCleanups(), and emitAutoVarInit().

Referenced by emitVarDecl().

◆ emitAutoVarInit()

void CIRGenFunction::emitAutoVarInit ( const AutoVarEmission emission)

Emit the initializer for an allocated variable.

If this call is not associated with the call to emitAutoVarAlloca (as the address of the emission is not directly an alloca), the allocatedSeparately parameter can be used to suppress the assertions. However, this should only be used in extreme cases, as it doesn't properly reflect the language/AST.

Definition at line 79 of file CIRGenDecl.cpp.

References clang::CIRGen::CIRGenFunction::AutoVarEmission::Addr, cgm, clang::CIRGen::Decl, emitExprAsInit(), emitStoreThroughLValue(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::RValue::get(), clang::CIRGen::LValue::getAddress(), clang::Decl::getAttr(), cir::CIRBaseBuilderTy::getConstant(), getContext(), clang::VarDecl::getInit(), clang::ASTContext::getLangOpts(), getLoc(), getMLIRContext(), clang::CIRGen::Address::getPointer(), clang::Stmt::getSourceRange(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::CIRGen::CIRGenFunction::AutoVarEmission::IsConstantAggregate, clang::VarDecl::isConstexpr(), isTrivialInitializer(), makeAddrLValue(), clang::VarDecl::mightBeUsableInConstantExpressions(), cir::MissingFeatures::opAllocaCaptureByInit(), clang::QualType::PDIK_Struct, clang::CIRGen::ConstantEmitter::tryEmitAbstractForInitializer(), clang::ast_matchers::type, clang::LangOptionsBase::Uninitialized, clang::CIRGen::CIRGenFunction::AutoVarEmission::Variable, clang::CIRGen::CIRGenFunction::AutoVarEmission::wasEmittedAsGlobal(), and clang::CIRGen::CIRGenFunction::AutoVarEmission::wasEmittedAsOffloadClause().

Referenced by emitAutoVarDecl().

◆ emitAutoVarTypeCleanup()

void CIRGenFunction::emitAutoVarTypeCleanup ( const AutoVarEmission emission,
clang::QualType::DestructionKind  dtorKind 
)

◆ emitBaseInitializer()

void CIRGenFunction::emitBaseInitializer ( mlir::Location  loc,
const CXXRecordDecl classDecl,
CXXCtorInitializer baseInit 
)

◆ emitBinaryOperatorLValue()

LValue CIRGenFunction::emitBinaryOperatorLValue ( const BinaryOperator e)

◆ emitBreakStmt()

mlir::LogicalResult CIRGenFunction::emitBreakStmt ( const clang::BreakStmt s)

Definition at line 545 of file CIRGenStmt.cpp.

References cir::CIRBaseBuilderTy::createBreak(), getLoc(), and s.

Referenced by emitSimpleStmt().

◆ emitBuiltinExpr()

RValue CIRGenFunction::emitBuiltinExpr ( const clang::GlobalDecl gd,
unsigned  builtinID,
const clang::CallExpr e,
ReturnValueSlot  returnValue 
)

Definition at line 88 of file CIRGenBuiltin.cpp.

References cir::MissingFeatures::builtinCall(), cir::MissingFeatures::builtinCallF128(), cir::MissingFeatures::builtinCallMathErrno(), cir::MissingFeatures::builtinCheckKind(), cgm, conj, convertType(), cir::CIRBaseBuilderTy::createComplexCreate(), cir::CIRBaseBuilderTy::createComplexImag(), cir::CIRBaseBuilderTy::createComplexReal(), cir::CIRBaseBuilderTy::createUnaryOp(), emitAlignmentAssumption(), emitCheckedArgForAssume(), emitComplexExpr(), emitLibraryCall(), emitRotate(), emitScalarExpr(), emitTrap(), emitUnreachable(), emitVAEnd(), emitVAListRef(), emitVAStart(), clang::CIRGen::CIRGenModule::errorNYI(), clang::Expr::EvaluateAsFloat(), clang::Expr::EvaluateAsRValue(), clang::Expr::EvaluateKnownConstInt(), clang::CIRGen::RValue::get(), clang::CallExpr::getArg(), clang::Decl::getAsFunction(), clang::CIRGen::CIRGenModule::getASTContext(), clang::CIRGen::CIRGenModule::getBuiltinLibFunction(), clang::CIRGen::RValue::getComplex(), cir::CIRBaseBuilderTy::getConstAPInt(), clang::CIRGen::CIRGenBuilderTy::getConstFP(), clang::CIRGen::CIRGenBuilderTy::getConstInt(), getContext(), clang::GlobalDecl::getDecl(), clang::Expr::getExprLoc(), clang::APValue::getFloat(), clang::APValue::getInt(), clang::Expr::getIntegerConstantExpr(), getLoc(), getMLIRContext(), clang::CallExpr::getNumArgs(), clang::CIRGen::Address::getPointer(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::CIRGen::CIRGenBuilderTy::getUInt32Ty(), getUndefRValue(), clang::Decl::hasAttr(), clang::Expr::EvalStatus::hasSideEffects(), clang::Expr::HasSideEffects(), clang::APValue::isFloat(), clang::APValue::isInt(), clang::Expr::isPRValue(), clang::ast_matchers::type, and clang::Expr::EvalResult::Val.

Referenced by emitCallExpr().

◆ emitCall() [1/3]

RValue CIRGenFunction::emitCall ( clang::QualType  calleeTy,
const CIRGenCallee callee,
const clang::CallExpr e,
ReturnValueSlot  returnValue 
)

◆ emitCall() [2/3]

RValue CIRGenFunction::emitCall ( const CIRGenFunctionInfo funcInfo,
const CIRGenCallee callee,
ReturnValueSlot  returnValue,
const CallArgList args,
cir::CIRCallOpInterface *  callOp,
mlir::Location  loc 
)

Definition at line 500 of file CIRGenCall.cpp.

References clang::CIRGen::CIRGenFunctionInfo::argTypes(), cgm, clang::CIRGen::CIRGenModule::constructAttributeList(), convertType(), clang::CIRGen::CIRGenBuilderTy::createLoad(), createMemTemp(), cir::MissingFeatures::dataLayoutTypeAllocSize(), emitAggregateStore(), emitCallLikeOp(), cir::MissingFeatures::emitLifetimeMarkers(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::RValue::get(), clang::CIRGen::CIRGenCallee::getAbstractInfo(), clang::CIRGen::RValue::getAggregate(), getCounterAggTmpAsString(), clang::CIRGen::Address::getElementType(), getEvaluationKind(), clang::CIRGen::CIRGenCallee::getFunctionPointer(), clang::CIRGen::CIRGenTypes::getFunctionType(), clang::CIRGen::CIRGenModule::getGlobalValue(), clang::CIRGen::CIRGenFunctionInfo::getReturnType(), getTypes(), getUndefRValue(), clang::CIRGen::ReturnValueSlot::getValue(), clang::CIRGen::Address::invalid(), cir::MissingFeatures::invokeOp(), clang::CIRGen::Address::isValid(), cir::MissingFeatures::lowerAggregateLoadStore(), cir::MissingFeatures::opCallAttrs(), cir::MissingFeatures::opCallBitcastArg(), cir::MissingFeatures::opCallCallConv(), cir::MissingFeatures::opCallInAlloca(), cir::MissingFeatures::opCallMustTail(), cir::MissingFeatures::opCallPaddingArgs(), cir::MissingFeatures::opCallReturn(), clang::CIRGen::CIRGenCallee::prepareConcreteCallee(), cir::TEK_Aggregate, cir::TEK_Complex, and cir::TEK_Scalar.

Referenced by emitCall(), emitCallExpr(), emitCXXConstructorCall(), emitCXXDestructorCall(), emitCXXMemberOrOperatorCall(), emitLibraryCall(), and emitNewDeleteCall().

◆ emitCall() [3/3]

RValue clang::CIRGen::CIRGenFunction::emitCall ( const CIRGenFunctionInfo funcInfo,
const CIRGenCallee callee,
ReturnValueSlot  returnValue,
const CallArgList args,
cir::CIRCallOpInterface *  callOrTryCall = nullptr 
)
inline

Definition at line 1034 of file CIRGenFunction.h.

References currSrcLoc, and emitCall().

◆ emitCallArg()

void CIRGenFunction::emitCallArg ( CallArgList args,
const clang::Expr e,
clang::QualType  argType 
)

◆ emitCallArgs()

void CIRGenFunction::emitCallArgs ( CallArgList args,
PrototypeWrapper  prototype,
llvm::iterator_range< clang::CallExpr::const_arg_iterator argRange,
AbstractCallee  callee = AbstractCallee(),
unsigned  paramsToSkip = 0 
)

◆ emitCallee()

CIRGenCallee CIRGenFunction::emitCallee ( const clang::Expr e)

◆ emitCallExpr()

RValue CIRGenFunction::emitCallExpr ( const clang::CallExpr e,
ReturnValueSlot  returnValue = ReturnValueSlot() 
)

◆ emitCallExprLValue()

LValue CIRGenFunction::emitCallExprLValue ( const clang::CallExpr e)

◆ emitCaseDefaultCascade() [1/2]

template<typename T >
mlir::LogicalResult clang::CIRGen::CIRGenFunction::emitCaseDefaultCascade ( const T stmt,
mlir::Type  condType,
mlir::ArrayAttr  value,
CaseOpKind  kind,
bool  buildingTopLevelCase 
)

◆ emitCaseDefaultCascade() [2/2]

template<typename T >
mlir::LogicalResult clang::CIRGen::CIRGenFunction::emitCaseDefaultCascade ( const T stmt,
mlir::Type  condType,
mlir::ArrayAttr  value,
cir::CaseOpKind  kind,
bool  buildingTopLevelCase 
)

Referenced by emitCaseStmt(), and emitDefaultStmt().

◆ emitCaseStmt()

mlir::LogicalResult CIRGenFunction::emitCaseStmt ( const clang::CaseStmt s,
mlir::Type  condType,
bool  buildingTopLevelCase 
)

Definition at line 638 of file CIRGenStmt.cpp.

References emitCaseDefaultCascade(), getContext(), and s.

Referenced by emitCaseDefaultCascade(), and emitSwitchCase().

◆ emitCastLValue()

LValue CIRGenFunction::emitCastLValue ( const CastExpr e)

Casts are never lvalues unless that cast is to a reference type.

If the cast is to a reference, we can have the usual lvalue result, otherwise if a cast is needed by the code generator in an lvalue context, then it must mean that we need the address of an aggregate in order to access one of its members. This can happen for all the reasons that casts are permitted with aggregate result, including noop aggregate casts, and cast from scalar to union.

Definition at line 1011 of file CIRGenExpr.cpp.

References clang::Type::castAsCXXRecordDecl(), cgm, clang::CastExpr::changesVolatileQualification(), convertTypeForMem(), clang::CIRGen::CIRGenModule::emitExplicitCastExprType(), emitLValue(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::LValue::getAddress(), getAddressOfBaseClass(), clang::CIRGen::LValue::getBaseInfo(), clang::CastExpr::getCastKind(), clang::CastExpr::getCastKindName(), clang::CIRGen::Address::getElementType(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::CIRGen::LValue::isSimple(), clang::CIRGen::Address::isValid(), makeAddrLValue(), cir::MissingFeatures::opTBAA(), clang::CastExpr::path(), V, and clang::CIRGen::Address::withElementType().

Referenced by emitLValue().

◆ emitCheckedArgForAssume()

mlir::Value CIRGenFunction::emitCheckedArgForAssume ( const Expr e)

Emits an argument for a call to a __builtin_assume.

If the builtin sanitizer is enabled, a runtime check is also emitted.

Definition at line 384 of file CIRGenBuiltin.cpp.

References cgm, clang::CIRGen::CIRGenModule::errorNYI(), evaluateExprAsBool(), clang::Stmt::getSourceRange(), clang::SanitizerSet::has(), cir::MissingFeatures::sanitizers(), and sanOpts.

Referenced by emitBuiltinExpr().

◆ emitComplexAssignmentLValue()

LValue CIRGenFunction::emitComplexAssignmentLValue ( const BinaryOperator e)

◆ emitComplexCompoundAssignmentLValue()

LValue CIRGenFunction::emitComplexCompoundAssignmentLValue ( const CompoundAssignOperator e)

Definition at line 1067 of file CIRGenExprComplex.cpp.

References getComplexOp(), and clang::BinaryOperator::getOpcode().

Referenced by emitLValue().

◆ emitComplexExpr()

mlir::Value CIRGenFunction::emitComplexExpr ( const Expr e)

Emit the computation of the specified expression of complex type, returning the result.

EmitComplexExpr - Emit the computation of the specified expression of complex type, ignoring the result.

Definition at line 1012 of file CIRGenExprComplex.cpp.

References getComplexType(), and clang::Expr::getType().

Referenced by emitAnyExpr(), emitBuiltinExpr(), and emitExprAsInit().

◆ emitComplexExprIntoLValue()

void CIRGenFunction::emitComplexExprIntoLValue ( const Expr e,
LValue  dest,
bool  isInit 
)

◆ emitComplexPrePostIncDec()

mlir::Value CIRGenFunction::emitComplexPrePostIncDec ( const UnaryOperator e,
LValue  lv,
cir::UnaryOpKind  op,
bool  isPre 
)

◆ emitComplexToScalarConversion()

mlir::Value CIRGenFunction::emitComplexToScalarConversion ( mlir::Value  src,
QualType  srcTy,
QualType  dstTy,
SourceLocation  loc 
)

Emit a conversion from the specified complex type to the specified destination type, where the destination type is an LLVM scalar type.

Definition at line 2002 of file CIRGenExprScalar.cpp.

References clang::Type::castAs(), convertType(), emitScalarConversion(), getLoc(), hasScalarEvaluationKind(), clang::Type::isAnyComplexType(), clang::Type::isBooleanType(), and clang::Type::isFloatingType().

◆ emitCompoundAssignmentLValue()

LValue CIRGenFunction::emitCompoundAssignmentLValue ( const clang::CompoundAssignOperator e)

◆ emitCompoundLiteralLValue()

LValue CIRGenFunction::emitCompoundLiteralLValue ( const CompoundLiteralExpr e)

◆ emitCompoundStmt()

mlir::LogicalResult CIRGenFunction::emitCompoundStmt ( const clang::CompoundStmt s,
Address lastValue = nullptr,
AggValueSlot  slot = AggValueSlot::ignored() 
)

Definition at line 87 of file CIRGenStmt.cpp.

References b, emitCompoundStmtWithoutScope(), getLoc(), s, symbolTable, and clang::ast_matchers::type.

Referenced by emitSimpleStmt().

◆ emitCompoundStmtWithoutScope()

mlir::LogicalResult CIRGenFunction::emitCompoundStmtWithoutScope ( const clang::CompoundStmt s,
Address lastValue = nullptr,
AggValueSlot  slot = AggValueSlot::ignored() 
)

Definition at line 66 of file CIRGenStmt.cpp.

References emitStmt(), emitStmtWithResult(), and s.

Referenced by emitCompoundStmt(), emitFunctionBody(), and emitSimpleStmt().

◆ emitConditionalBlocks()

template<typename FuncTy >
ConditionalInfo clang::CIRGen::CIRGenFunction::emitConditionalBlocks ( const AbstractConditionalOperator e,
const FuncTy &  branchGenFunc 
)

◆ emitConstructorBody()

void clang::CIRGen::CIRGenFunction::emitConstructorBody ( FunctionArgList args)

◆ emitContinueStmt()

mlir::LogicalResult CIRGenFunction::emitContinueStmt ( const clang::ContinueStmt s)

Definition at line 510 of file CIRGenStmt.cpp.

References cir::CIRBaseBuilderTy::createContinue(), getLoc(), and s.

Referenced by emitSimpleStmt().

◆ emitCtorPrologue()

void CIRGenFunction::emitCtorPrologue ( const clang::CXXConstructorDecl ctor,
clang::CXXCtorType  ctorType,
FunctionArgList args 
)

◆ emitCXXAggrConstructorCall() [1/2]

void CIRGenFunction::emitCXXAggrConstructorCall ( const CXXConstructorDecl ctor,
const clang::ArrayType arrayType,
Address  arrayBegin,
const CXXConstructExpr e,
bool  newPointerIsChecked,
bool  zeroInitialize = false 
)

Emit a loop to call a particular constructor for each of several members of an array.

Parameters
ctorthe constructor to call for each element
arrayTypethe type of the array to initialize
arrayBeginan arrayType*
zeroInitializetrue if each element should be zero-initialized before it is constructed

Definition at line 522 of file CIRGenClass.cpp.

References clang::ast_matchers::arrayType, emitArrayLength(), and emitCXXAggrConstructorCall().

Referenced by emitCXXAggrConstructorCall(), and emitCXXConstructExpr().

◆ emitCXXAggrConstructorCall() [2/2]

void CIRGenFunction::emitCXXAggrConstructorCall ( const CXXConstructorDecl ctor,
mlir::Value  numElements,
Address  arrayBase,
const CXXConstructExpr e,
bool  newPointerIsChecked,
bool  zeroInitialize 
)

◆ emitCXXConstructExpr()

void CIRGenFunction::emitCXXConstructExpr ( const clang::CXXConstructExpr e,
AggValueSlot  dest 
)

◆ emitCXXConstructorCall() [1/2]

void CIRGenFunction::emitCXXConstructorCall ( const clang::CXXConstructorDecl d,
clang::CXXCtorType  type,
bool  forVirtualBase,
bool  delegating,
Address  thisAddr,
CallArgList args,
clang::SourceLocation  loc 
)

◆ emitCXXConstructorCall() [2/2]

void CIRGenFunction::emitCXXConstructorCall ( const clang::CXXConstructorDecl d,
clang::CXXCtorType  type,
bool  forVirtualBase,
bool  delegating,
AggValueSlot  thisAVS,
const clang::CXXConstructExpr e 
)

◆ emitCXXDestructorCall() [1/2]

void CIRGenFunction::emitCXXDestructorCall ( const CXXDestructorDecl dd,
CXXDtorType  type,
bool  forVirtualBase,
bool  delegating,
Address  thisAddr,
QualType  thisTy 
)

◆ emitCXXDestructorCall() [2/2]

RValue CIRGenFunction::emitCXXDestructorCall ( GlobalDecl  dtor,
const CIRGenCallee callee,
mlir::Value  thisVal,
QualType  thisTy,
mlir::Value  implicitParam,
QualType  implicitParamTy,
const CallExpr e 
)

◆ emitCXXForRangeStmt()

mlir::LogicalResult CIRGenFunction::emitCXXForRangeStmt ( const CXXForRangeStmt s,
llvm::ArrayRef< const Attr * >  attrs 
)

◆ emitCXXMemberCallExpr()

RValue CIRGenFunction::emitCXXMemberCallExpr ( const clang::CXXMemberCallExpr e,
ReturnValueSlot  returnValue 
)

◆ emitCXXMemberOrOperatorCall()

RValue CIRGenFunction::emitCXXMemberOrOperatorCall ( const clang::CXXMethodDecl md,
const CIRGenCallee callee,
ReturnValueSlot  returnValue,
mlir::Value  thisPtr,
mlir::Value  implicitParam,
clang::QualType  implicitParamTy,
const clang::CallExpr ce,
CallArgList rtlArgs 
)

◆ emitCXXMemberOrOperatorMemberCallExpr()

RValue CIRGenFunction::emitCXXMemberOrOperatorMemberCallExpr ( const clang::CallExpr ce,
const clang::CXXMethodDecl md,
ReturnValueSlot  returnValue,
bool  hasQualifier,
clang::NestedNameSpecifier  qualifier,
bool  isArrow,
const clang::Expr base 
)

◆ emitCXXNewExpr()

mlir::Value CIRGenFunction::emitCXXNewExpr ( const CXXNewExpr e)

◆ emitCXXOperatorMemberCallExpr()

RValue CIRGenFunction::emitCXXOperatorMemberCallExpr ( const CXXOperatorCallExpr e,
const CXXMethodDecl md,
ReturnValueSlot  returnValue 
)

◆ emitCXXPseudoDestructorExpr()

RValue CIRGenFunction::emitCXXPseudoDestructorExpr ( const CXXPseudoDestructorExpr expr)

◆ emitCXXThrowExpr()

void CIRGenFunction::emitCXXThrowExpr ( const CXXThrowExpr e)

◆ emitDecl()

void CIRGenFunction::emitDecl ( const clang::Decl d,
bool  evaluateConditionDecl = false 
)

◆ emitDeclRefLValue()

LValue CIRGenFunction::emitDeclRefLValue ( const clang::DeclRefExpr e)

◆ emitDeclStmt()

mlir::LogicalResult CIRGenFunction::emitDeclStmt ( const clang::DeclStmt s)

Definition at line 433 of file CIRGenStmt.cpp.

References emitDecl(), and s.

Referenced by emitSimpleStmt().

◆ emitDefaultStmt()

mlir::LogicalResult CIRGenFunction::emitDefaultStmt ( const clang::DefaultStmt s,
mlir::Type  condType,
bool  buildingTopLevelCase 
)

Definition at line 662 of file CIRGenStmt.cpp.

References emitCaseDefaultCascade(), and s.

Referenced by emitCaseDefaultCascade(), and emitSwitchCase().

◆ emitDelegateCallArg()

void CIRGenFunction::emitDelegateCallArg ( CallArgList args,
const clang::VarDecl param,
clang::SourceLocation  loc 
)

◆ emitDelegateCXXConstructorCall()

void CIRGenFunction::emitDelegateCXXConstructorCall ( const clang::CXXConstructorDecl ctor,
clang::CXXCtorType  ctorType,
const FunctionArgList args,
clang::SourceLocation  loc 
)

◆ emitDelegatingCXXConstructorCall()

void CIRGenFunction::emitDelegatingCXXConstructorCall ( const CXXConstructorDecl ctor,
const FunctionArgList args 
)

◆ emitDestroy()

void CIRGenFunction::emitDestroy ( Address  addr,
QualType  type,
Destroyer destroyer 
)

Immediately perform the destruction of the given object.

Parameters
addr- the address of the object; a type*
type- the type of the object; if an array type, all objects are destroyed in reverse order
destroyer- the function to call to destroy individual elements

Definition at line 727 of file CIRGenDecl.cpp.

References clang::CharUnits::alignmentOfArrayElement(), clang::ast_matchers::arrayType, cgm, emitArrayDestroy(), emitArrayLength(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::Address::getAlignment(), clang::ASTContext::getAsArrayType(), getContext(), clang::CIRGen::Address::getPointer(), length(), clang::ast_matchers::type, and cir::MissingFeatures::vlas().

◆ emitDestructorBody()

void clang::CIRGen::CIRGenFunction::emitDestructorBody ( FunctionArgList args)

◆ emitDoStmt()

mlir::LogicalResult CIRGenFunction::emitDoStmt ( const clang::DoStmt s)

◆ emitExprAsInit()

void CIRGenFunction::emitExprAsInit ( const clang::Expr init,
const clang::ValueDecl d,
LValue  lvalue,
bool  capturedByInit = false 
)

Emit an expression as an initializer for an object (variable, field, etc.) at the given location.

The expression is not necessarily the normal initializer for the object, and the address is not necessarily its normal location.

Parameters
initthe initializing expression
dthe object to act as if we're initializing
lvaluethe lvalue to initialize
capturedByInittrue if d is a __block variable whose address is potentially changed by the initializer

Definition at line 487 of file CIRGenDecl.cpp.

References cir::MissingFeatures::aggValueSlotMayOverlap(), cgm, emitAggExpr(), emitComplexExpr(), emitReferenceBindingToExpr(), emitScalarInit(), emitStoreOfComplex(), emitStoreThroughLValue(), clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::AggValueSlot::forLValue(), getEvaluationKind(), clang::Expr::getExprLoc(), getLoc(), clang::Decl::getSourceRange(), clang::Stmt::getSourceRange(), clang::ValueDecl::getType(), clang::CIRGen::AggValueSlot::IsDestructed, clang::CIRGen::AggValueSlot::IsNotAliased, clang::CIRGen::AggValueSlot::MayOverlap, cir::TEK_Aggregate, cir::TEK_Complex, cir::TEK_Scalar, and clang::ast_matchers::type.

Referenced by emitAutoVarInit(), and emitInitializerForField().

◆ emitForStmt()

mlir::LogicalResult CIRGenFunction::emitForStmt ( const clang::ForStmt s)

◆ emitFunctionBody()

mlir::LogicalResult clang::CIRGen::CIRGenFunction::emitFunctionBody ( const clang::Stmt body)

Definition at line 485 of file CIRGenFunction.cpp.

References emitCompoundStmtWithoutScope(), emitStmt(), and symbolTable.

Referenced by generateCode().

◆ emitGotoStmt()

mlir::LogicalResult CIRGenFunction::emitGotoStmt ( const clang::GotoStmt s)

Definition at line 491 of file CIRGenStmt.cpp.

References cir::MissingFeatures::generateDebugInfo(), getLoc(), and s.

Referenced by emitSimpleStmt().

◆ emitIfOnBoolExpr() [1/2]

cir::IfOp CIRGenFunction::emitIfOnBoolExpr ( const clang::Expr cond,
BuilderCallbackRef  thenBuilder,
mlir::Location  thenLoc,
BuilderCallbackRef  elseBuilder,
std::optional< mlir::Location >  elseLoc = {} 
)

Emit an if on a boolean condition, filling then and else into appropriated regions.

Definition at line 1820 of file CIRGenExpr.cpp.

References emitOpOnBoolExpr(), and getMLIRContext().

◆ emitIfOnBoolExpr() [2/2]

mlir::LogicalResult CIRGenFunction::emitIfOnBoolExpr ( const clang::Expr cond,
const clang::Stmt thenS,
const clang::Stmt elseS 
)

Emit an if on a boolean condition to the specified blocks.

Emit an if on a boolean condition, filling then and else into appropriated regions.

FIXME: Based on the condition, this might try to simplify the codegen of the conditional based on the branch. In the future, we may apply code generation simplifications here, similar to those used in classic LLVM codegen See EmitBranchOnBoolExpr for inspiration.

Definition at line 1790 of file CIRGenExpr.cpp.

References emitIfOnBoolExpr(), emitStmt(), getLoc(), and clang::Stmt::getSourceRange().

Referenced by emitIfOnBoolExpr(), and emitIfStmt().

◆ emitIfStmt()

mlir::LogicalResult CIRGenFunction::emitIfStmt ( const clang::IfStmt s)

◆ emitIgnoredExpr()

void CIRGenFunction::emitIgnoredExpr ( const clang::Expr e)

◆ emitImplicitAssignmentOperatorBody()

void CIRGenFunction::emitImplicitAssignmentOperatorBody ( FunctionArgList args)

◆ emitInitializerForField()

void CIRGenFunction::emitInitializerForField ( clang::FieldDecl field,
LValue  lhs,
clang::Expr init 
)

◆ emitLabel()

mlir::LogicalResult CIRGenFunction::emitLabel ( const clang::LabelDecl d)

◆ emitLabelStmt()

mlir::LogicalResult CIRGenFunction::emitLabelStmt ( const clang::LabelStmt s)

◆ emitLoadOfBitfieldLValue()

RValue CIRGenFunction::emitLoadOfBitfieldLValue ( LValue  lv,
SourceLocation  loc 
)

◆ emitLoadOfComplex()

mlir::Value CIRGenFunction::emitLoadOfComplex ( LValue  src,
SourceLocation  loc 
)

Load a complex number from the specified l-value.

Definition at line 1034 of file CIRGenExprComplex.cpp.

Referenced by emitComplexPrePostIncDec().

◆ emitLoadOfLValue()

RValue CIRGenFunction::emitLoadOfLValue ( LValue  lv,
SourceLocation  loc 
)

◆ emitLoadOfReference()

Address CIRGenFunction::emitLoadOfReference ( LValue  refLVal,
mlir::Location  loc,
LValueBaseInfo pointeeBaseInfo 
)

◆ emitLoadOfReferenceLValue()

LValue CIRGenFunction::emitLoadOfReferenceLValue ( Address  refAddr,
mlir::Location  loc,
QualType  refTy,
AlignmentSource  source 
)

◆ emitLoadOfScalar() [1/2]

mlir::Value CIRGenFunction::emitLoadOfScalar ( Address  addr,
bool  isVolatile,
QualType  ty,
SourceLocation  loc,
LValueBaseInfo  baseInfo 
)

◆ emitLoadOfScalar() [2/2]

mlir::Value CIRGenFunction::emitLoadOfScalar ( LValue  lvalue,
SourceLocation  loc 
)

EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the memory representation to the LLVM value representation.

The l-value must be a simple l-value.

Definition at line 585 of file CIRGenExpr.cpp.

References emitLoadOfScalar(), clang::CIRGen::LValue::getAddress(), clang::CIRGen::LValue::getBaseInfo(), clang::CIRGen::LValue::getType(), clang::CIRGen::LValue::isVolatile(), cir::MissingFeatures::opLoadStoreNontemporal(), and cir::MissingFeatures::opLoadStoreTbaa().

Referenced by convertTempToRValue(), emitLoadOfLValue(), and emitLoadOfScalar().

◆ emitLValue()

LValue clang::CIRGen::CIRGenFunction::emitLValue ( const clang::Expr e)

◆ emitLValueForBitField()

LValue CIRGenFunction::emitLValueForBitField ( LValue  base,
const FieldDecl field 
)

◆ emitLValueForField()

LValue CIRGenFunction::emitLValueForField ( LValue  base,
const clang::FieldDecl field 
)

◆ emitLValueForFieldInitialization()

LValue CIRGenFunction::emitLValueForFieldInitialization ( LValue  base,
const clang::FieldDecl field,
llvm::StringRef  fieldName 
)

◆ emitMaterializeTemporaryExpr()

LValue CIRGenFunction::emitMaterializeTemporaryExpr ( const MaterializeTemporaryExpr e)

◆ emitMemberExpr()

LValue CIRGenFunction::emitMemberExpr ( const MemberExpr e)

◆ emitNullabilityCheck()

void CIRGenFunction::emitNullabilityCheck ( LValue  lhs,
mlir::Value  rhs,
clang::SourceLocation  loc 
)

Given an assignment *lhs = rhs, emit a test that checks if rhs is nonnull, if 1LHS is marked _Nonnull.

Definition at line 653 of file CIRGenDecl.cpp.

References clang::SanitizerSet::has(), cir::MissingFeatures::sanitizers(), and sanOpts.

◆ emitNullInitialization()

void clang::CIRGen::CIRGenFunction::emitNullInitialization ( mlir::Location  loc,
Address  destPtr,
QualType  ty 
)

◆ emitOpenACCAtomicConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCAtomicConstruct ( const OpenACCAtomicConstruct s)

Definition at line 308 of file CIRGenStmtOpenACC.cpp.

References cgm, clang::CIRGen::CIRGenModule::errorNYI(), and s.

Referenced by emitStmt().

◆ emitOpenACCCacheConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCCacheConstruct ( const OpenACCCacheConstruct s)

◆ emitOpenACCCombinedConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCCombinedConstruct ( const OpenACCCombinedConstruct s)

Definition at line 220 of file CIRGenStmtOpenACC.cpp.

References getLoc(), clang::KernelsLoop, clang::ParallelLoop, s, and clang::SerialLoop.

Referenced by emitStmt().

◆ emitOpenACCComputeConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCComputeConstruct ( const OpenACCComputeConstruct s)

Definition at line 128 of file CIRGenStmtOpenACC.cpp.

References getLoc(), clang::Kernels, clang::Parallel, s, and clang::Serial.

Referenced by emitStmt().

◆ emitOpenACCDataConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCDataConstruct ( const OpenACCDataConstruct s)

Definition at line 151 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCDeclare()

void CIRGenFunction::emitOpenACCDeclare ( const OpenACCDeclareDecl d)

◆ emitOpenACCEnterDataConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCEnterDataConstruct ( const OpenACCEnterDataConstruct s)

Definition at line 253 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCExitDataConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCExitDataConstruct ( const OpenACCExitDataConstruct s)

Definition at line 261 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCHostDataConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCHostDataConstruct ( const OpenACCHostDataConstruct s)

Definition at line 243 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCInitConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCInitConstruct ( const OpenACCInitConstruct s)

Definition at line 161 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCIntExpr()

mlir::Value CIRGenFunction::emitOpenACCIntExpr ( const Expr intExpr)

◆ emitOpenACCLoopConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCLoopConstruct ( const OpenACCLoopConstruct s)

Definition at line 56 of file CIRGenStmtOpenACCLoop.cpp.

References emitStmt(), getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCRoutine()

void CIRGenFunction::emitOpenACCRoutine ( const OpenACCRoutineDecl d)

◆ emitOpenACCSetConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCSetConstruct ( const OpenACCSetConstruct s)

Definition at line 169 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCShutdownConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCShutdownConstruct ( const OpenACCShutdownConstruct s)

Definition at line 176 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCUpdateConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCUpdateConstruct ( const OpenACCUpdateConstruct s)

Definition at line 270 of file CIRGenStmtOpenACC.cpp.

References getLoc(), and s.

Referenced by emitStmt().

◆ emitOpenACCWaitConstruct()

mlir::LogicalResult CIRGenFunction::emitOpenACCWaitConstruct ( const OpenACCWaitConstruct s)

◆ emitOpOnBoolExpr()

mlir::Value CIRGenFunction::emitOpOnBoolExpr ( mlir::Location  loc,
const clang::Expr cond 
)

◆ emitPointerWithAlignment()

Address CIRGenFunction::emitPointerWithAlignment ( const clang::Expr expr,
LValueBaseInfo baseInfo = nullptr 
)

Given an expression with a pointer type, emit the value and compute our best estimate of the alignment of the pointee.

Given an expression of pointer type, try to derive a more accurate bound on the alignment of the pointer.

One reasonable way to use this information is when there's a language guarantee that the pointer must be aligned to some stricter value, and we're simply trying to ensure that sufficiently obvious uses of under- aligned objects don't get miscompiled; for example, a placement new into the address of a local variable. In such a case, it's quite reasonable to just ignore the returned alignment when it isn't from an explicit source.

Definition at line 67 of file CIRGenExpr.cpp.

References cir::MissingFeatures::addressIsKnownNonNull(), cir::MissingFeatures::addressSpace(), cgm, convertTypeForMem(), clang::CIRGen::CIRGenBuilderTy::createElementBitCast(), clang::CIRGen::Decl, emitArrayToPointerDecay(), clang::CIRGen::CIRGenModule::emitExplicitCastExprType(), emitLValue(), emitPointerWithAlignment(), emitScalarExpr(), clang::CIRGen::CIRGenModule::errorNYI(), clang::ast_matchers::expr, clang::CIRGen::LValue::getAddress(), getAddressOfBaseClass(), clang::CIRGen::LValueBaseInfo::getAlignmentSource(), clang::CIRGen::LValue::getBaseInfo(), getBuilder(), clang::CIRGen::Address::getElementType(), getLoc(), clang::CIRGen::CIRGenModule::getNaturalTypeAlignment(), clang::CIRGen::Address::getPointer(), clang::CIRGen::Address::invalid(), makeNaturalAddressForPointer(), clang::CIRGen::LValueBaseInfo::mergeForCast(), cir::MissingFeatures::opTBAA(), cir::MissingFeatures::sanitizers(), and shouldNullCheckClassCastValue().

Referenced by emitArraySubscriptExpr(), emitAtomicExpr(), emitCXXMemberOrOperatorMemberCallExpr(), emitMemberExpr(), emitPointerWithAlignment(), emitUnaryOpLValue(), and emitVAListRef().

◆ emitPromotedComplexExpr()

mlir::Value CIRGenFunction::emitPromotedComplexExpr ( const Expr e,
QualType  promotionType 
)

Definition at line 776 of file CIRGenExprComplex.cpp.

◆ emitPromotedScalarExpr()

mlir::Value CIRGenFunction::emitPromotedScalarExpr ( const Expr e,
QualType  promotionType 
)

Definition at line 1347 of file CIRGenExprScalar.cpp.

References ::ScalarExprEmitter, and clang::QualType::isNull().

◆ emitPromotedValue()

mlir::Value CIRGenFunction::emitPromotedValue ( mlir::Value  result,
QualType  promotionType 
)

Definition at line 733 of file CIRGenExprComplex.cpp.

References convertType(), and cir::CIRBaseBuilderTy::createCast().

◆ emitReferenceBindingToExpr()

RValue CIRGenFunction::emitReferenceBindingToExpr ( const Expr e)

◆ emitReturnStmt()

mlir::LogicalResult CIRGenFunction::emitReturnStmt ( const clang::ReturnStmt s)

◆ emitRotate()

RValue CIRGenFunction::emitRotate ( const CallExpr e,
bool  isRotateLeft 
)

◆ emitScalarCompoundAssignWithComplex()

LValue CIRGenFunction::emitScalarCompoundAssignWithComplex ( const CompoundAssignOperator e,
mlir::Value &  result 
)

◆ emitScalarConstant()

mlir::Value CIRGenFunction::emitScalarConstant ( const ConstantEmission constant,
Expr e 
)

◆ emitScalarConversion()

mlir::Value CIRGenFunction::emitScalarConversion ( mlir::Value  src,
clang::QualType  srcType,
clang::QualType  dstType,
clang::SourceLocation  loc 
)

Emit a conversion from the specified type to the specified destination type, both of which are CIR scalar types.

Definition at line 1992 of file CIRGenExprScalar.cpp.

References ::ScalarExprEmitter, and hasScalarEvaluationKind().

Referenced by emitComplexToScalarConversion(), emitOpOnBoolExpr(), and evaluateExprAsBool().

◆ emitScalarExpr()

mlir::Value CIRGenFunction::emitScalarExpr ( const clang::Expr e)

◆ emitScalarInit()

void CIRGenFunction::emitScalarInit ( const clang::Expr init,
mlir::Location  loc,
LValue  lvalue,
bool  capturedByInit = false 
)

◆ emitScalarPrePostIncDec()

mlir::Value CIRGenFunction::emitScalarPrePostIncDec ( const UnaryOperator e,
LValue  lv,
cir::UnaryOpKind  kind,
bool  isPre 
)

Definition at line 2282 of file CIRGenExprScalar.cpp.

References ::ScalarExprEmitter.

Referenced by emitUnaryOpLValue().

◆ emitSimpleStmt()

mlir::LogicalResult CIRGenFunction::emitSimpleStmt ( const clang::Stmt s,
bool  useCurrentScope 
)

◆ emitStaticVarDecl()

void CIRGenFunction::emitStaticVarDecl ( const VarDecl d,
cir::GlobalLinkageKind  linkage 
)

◆ emitStmt()

mlir::LogicalResult CIRGenFunction::emitStmt ( const clang::Stmt s,
bool  useCurrentScope,
llvm::ArrayRef< const Attr * >  attrs = {} 
)

◆ emitStopPoint()

void CIRGenFunction::emitStopPoint ( const Stmt s)

Build a debug stoppoint if we are emitting debug info.

Definition at line 104 of file CIRGenStmt.cpp.

References cir::MissingFeatures::generateDebugInfo().

Referenced by emitForStmt().

◆ emitStoreOfComplex()

void CIRGenFunction::emitStoreOfComplex ( mlir::Location  loc,
mlir::Value  v,
LValue  dest,
bool  isInit 
)

EmitStoreOfComplex - Store a complex number into the specified l-value.

Definition at line 1029 of file CIRGenExprComplex.cpp.

Referenced by emitComplexPrePostIncDec(), and emitExprAsInit().

◆ emitStoreOfScalar() [1/2]

void CIRGenFunction::emitStoreOfScalar ( mlir::Value  value,
Address  addr,
bool  isVolatile,
clang::QualType  ty,
bool  isInit = false,
bool  isNontemporal = false 
)

◆ emitStoreOfScalar() [2/2]

void CIRGenFunction::emitStoreOfScalar ( mlir::Value  value,
LValue  lvalue,
bool  isInit 
)

◆ emitStoreThroughBitfieldLValue()

mlir::Value CIRGenFunction::emitStoreThroughBitfieldLValue ( RValue  src,
LValue  dstresult 
)

◆ emitStoreThroughLValue()

void CIRGenFunction::emitStoreThroughLValue ( RValue  src,
LValue  dst,
bool  isInit = false 
)

◆ emitStringLiteralLValue()

LValue CIRGenFunction::emitStringLiteralLValue ( const StringLiteral e)

◆ emitSwitchBody()

mlir::LogicalResult CIRGenFunction::emitSwitchBody ( const clang::Stmt s)

◆ emitSwitchCase()

mlir::LogicalResult CIRGenFunction::emitSwitchCase ( const clang::SwitchCase s,
bool  buildingTopLevelCase 
)

Definition at line 669 of file CIRGenStmt.cpp.

References condTypeStack, emitCaseStmt(), emitDefaultStmt(), and s.

Referenced by emitSimpleStmt(), and emitSwitchBody().

◆ emitSwitchStmt()

mlir::LogicalResult CIRGenFunction::emitSwitchStmt ( const clang::SwitchStmt s)

◆ emitTernaryOnBoolExpr()

mlir::Value clang::CIRGen::CIRGenFunction::emitTernaryOnBoolExpr ( const clang::Expr cond,
mlir::Location  loc,
const clang::Stmt thenS,
const clang::Stmt elseS 
)

◆ emitToMemory()

mlir::Value CIRGenFunction::emitToMemory ( mlir::Value  value,
clang::QualType  ty 
)

Given a value and its clang type, returns the value casted to its memory representation.

Note: CIR defers most of the special casting to the final lowering passes to conserve the high level information.

Definition at line 529 of file CIRGenExpr.cpp.

Referenced by emitStoreOfScalar().

◆ emitTrap()

void CIRGenFunction::emitTrap ( mlir::Location  loc,
bool  createNewBlock 
)

Emit a trap instruction, which is used to abort the program in an abnormal way, usually for debugging purposes.

createNewBlock indicates whether to create a new block for the IR builder. Since the cir.trap operation is a terminator, operations that follow a trap cannot be emitted after cir.trap in the same block. To ensure these operations get emitted successfully, you need to create a new dummy block and set the insertion point there before continuing from the trap operation.

Definition at line 2055 of file CIRGenExpr.cpp.

Referenced by emitBuiltinExpr().

◆ emitUnaryOpLValue()

LValue CIRGenFunction::emitUnaryOpLValue ( const clang::UnaryOperator e)

◆ emitUnPromotedValue()

mlir::Value CIRGenFunction::emitUnPromotedValue ( mlir::Value  result,
QualType  unPromotionType 
)

Definition at line 725 of file CIRGenExprComplex.cpp.

References convertType(), and cir::CIRBaseBuilderTy::createCast().

◆ emitUnreachable()

void CIRGenFunction::emitUnreachable ( clang::SourceLocation  loc,
bool  createNewBlock 
)

Emit a reached-unreachable diagnostic if loc is valid and runtime checking is enabled.

Otherwise, just emit an unreachable instruction. createNewBlock indicates whether to create a new block for the IR builder. Since the cir.unreachable operation is a terminator, operations that follow an unreachable point cannot be emitted after cir.unreachable in the same block. To ensure these operations get emitted successfully, you need to create a dummy block and set the insertion point there before continuing from the unreachable point.

Definition at line 2061 of file CIRGenExpr.cpp.

References getLoc(), and cir::MissingFeatures::sanitizers().

Referenced by emitBuiltinExpr().

◆ emitVAArg()

mlir::Value CIRGenFunction::emitVAArg ( VAArgExpr ve)

Generate code to get an argument from the passed in pointer and update it accordingly.

Parameters
veThe VAArgExpr for which to generate code.
vaListAddrReceives a reference to the va_list as emitted by either emitVAListRef or emitMSVAListRef.
Returns
SSA value with the argument.

Definition at line 408 of file CIRGenBuiltin.cpp.

References cgm, convertType(), emitVAListRef(), clang::Expr::getExprLoc(), clang::CIRGen::CIRGenModule::getLoc(), clang::CIRGen::Address::getPointer(), clang::VAArgExpr::getSubExpr(), clang::Expr::getType(), cir::MissingFeatures::msabi(), clang::ast_matchers::type, and cir::MissingFeatures::vlas().

◆ emitVAEnd()

void CIRGenFunction::emitVAEnd ( mlir::Value  vaList)

Emits the end of a CIR variable-argument operation (cir.va_start)

Parameters
vaListA reference to the va_list as emitted by either emitVAListRef or emitMSVAListRef.

Definition at line 401 of file CIRGenBuiltin.cpp.

Referenced by emitBuiltinExpr().

◆ emitVAListRef()

Address clang::CIRGen::CIRGenFunction::emitVAListRef ( const Expr e)

Build a "reference" to a va_list; this is either the address or the value of the expression, depending on how va_list is defined.

Definition at line 1070 of file CIRGenFunction.cpp.

References emitLValue(), emitPointerWithAlignment(), clang::CIRGen::LValue::getAddress(), and getContext().

Referenced by emitBuiltinExpr(), and emitVAArg().

◆ emitVarDecl()

void CIRGenFunction::emitVarDecl ( const clang::VarDecl d)

◆ emitVariablyModifiedType()

void clang::CIRGen::CIRGenFunction::emitVariablyModifiedType ( QualType  ty)

◆ emitVAStart()

void CIRGenFunction::emitVAStart ( mlir::Value  vaList,
mlir::Value  count 
)

Emits the start of a CIR variable-argument operation (cir.va_start)

Parameters
vaListA reference to the va_list as emitted by either emitVAListRef or emitMSVAListRef.
countThe number of arguments in vaList

Definition at line 395 of file CIRGenBuiltin.cpp.

Referenced by emitBuiltinExpr().

◆ emitWhileStmt()

mlir::LogicalResult CIRGenFunction::emitWhileStmt ( const clang::WhileStmt s)

◆ evaluateExprAsBool()

mlir::Value CIRGenFunction::evaluateExprAsBool ( const clang::Expr e)

◆ finishFunction()

void clang::CIRGen::CIRGenFunction::finishFunction ( SourceLocation  endLoc)

◆ generateCode()

cir::FuncOp clang::CIRGen::CIRGenFunction::generateCode ( clang::GlobalDecl  gd,
cir::FuncOp  fn,
cir::FuncType  funcType 
)

◆ getAddressOfBaseClass()

Address CIRGenFunction::getAddressOfBaseClass ( Address  value,
const CXXRecordDecl derived,
llvm::iterator_range< CastExpr::path_const_iterator path,
bool  nullCheckValue,
SourceLocation  loc 
)

◆ getAddressOfDirectBaseInCompleteClass()

Address CIRGenFunction::getAddressOfDirectBaseInCompleteClass ( mlir::Location  loc,
Address  thisAddr,
const CXXRecordDecl derived,
const CXXRecordDecl base,
bool  baseIsVirtual 
)

Convert the given pointer to a complete class to the given direct base.

Gets the address of a direct base class within a complete object.

This should only be used for (1) non-virtual bases or (2) virtual bases when the type is known to be complete (e.g. in complete destructors).

The object pointed to by 'thisAddr' is assumed to be non-null.

Definition at line 159 of file CIRGenClass.cpp.

References convertType(), clang::CIRGen::CIRGenBuilderTy::createBaseClassAddr(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), getContext(), clang::CIRGen::Address::getElementType(), clang::CharUnits::getQuantity(), and clang::ASTRecordLayout::getVBaseClassOffset().

Referenced by emitBaseInitializer().

◆ getAddrOfBitFieldStorage()

Address CIRGenFunction::getAddrOfBitFieldStorage ( LValue  base,
const clang::FieldDecl field,
mlir::Type  fieldType,
unsigned  index 
)

◆ getAddrOfLocalVar()

Address clang::CIRGen::CIRGenFunction::getAddrOfLocalVar ( const clang::VarDecl vd)
inline

Return the address of a local variable.

Definition at line 650 of file CIRGenFunction.h.

References localDeclMap.

Referenced by emitDelegateCallArg(), and clang::CIRGen::CIRGenCXXABI::loadIncomingCXXThis().

◆ getBuilder()

CIRGenBuilderTy & clang::CIRGen::CIRGenFunction::getBuilder ( )
inline

◆ getCIRGenModule() [1/2]

CIRGenModule & clang::CIRGen::CIRGenFunction::getCIRGenModule ( )
inline

◆ getCIRGenModule() [2/2]

const CIRGenModule & clang::CIRGen::CIRGenFunction::getCIRGenModule ( ) const
inline

Definition at line 100 of file CIRGenFunction.h.

References cgm.

◆ getContext()

clang::ASTContext & clang::CIRGen::CIRGenFunction::getContext ( ) const
inline

◆ getCounterAggTmpAsString()

std::string clang::CIRGen::CIRGenFunction::getCounterAggTmpAsString ( )

◆ getCounterRefTmpAsString()

std::string clang::CIRGen::CIRGenFunction::getCounterRefTmpAsString ( )

Definition at line 817 of file CIRGenFunction.cpp.

References counterRefTmp, and clang::CIRGen::getVersionedTmpName().

Referenced by createReferenceTemporary().

◆ getCurFunctionEntryBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::getCurFunctionEntryBlock ( )
inline

Definition at line 102 of file CIRGenFunction.h.

References curFn.

◆ getDestroyer()

CIRGenFunction::Destroyer * CIRGenFunction::getDestroyer ( clang::QualType::DestructionKind  kind)

◆ getEvaluationKind()

cir::TypeEvaluationKind clang::CIRGen::CIRGenFunction::getEvaluationKind ( clang::QualType  type)
static

◆ getLangOpts()

const clang::LangOptions & clang::CIRGen::CIRGenFunction::getLangOpts ( ) const
inline

◆ getLoc() [1/3]

mlir::Location clang::CIRGen::CIRGenFunction::getLoc ( clang::SourceLocation  srcLoc)

Helpers to convert Clang's SourceLocation to a MLIR Location.

Definition at line 103 of file CIRGenFunction.cpp.

References currSrcLoc, clang::PresumedLoc::getColumn(), getContext(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), clang::ASTContext::getSourceManager(), and clang::SourceLocation::isValid().

Referenced by createReferenceTemporary(), emitAddrOfFieldStorage(), emitAggExprToLValue(), emitAlignmentAssumption(), emitAnyExpr(), emitAnyExprToTemp(), emitAsmStmt(), emitAtomicExpr(), emitAtomicInit(), emitAtomicOp(), emitAutoVarAlloca(), emitAutoVarInit(), emitBinaryOperatorLValue(), emitBreakStmt(), emitBuiltinBitOp(), emitBuiltinExpr(), emitCall(), emitCaseDefaultCascade(), emitComplexExprIntoLValue(), emitComplexPrePostIncDec(), emitComplexToScalarConversion(), emitCompoundLiteralLValue(), emitCompoundStmt(), emitContinueStmt(), emitCtorPrologue(), emitCXXConstructorCall(), emitCXXDestructorCall(), emitCXXForRangeStmt(), emitCXXMemberOrOperatorCall(), emitCXXNewAllocSize(), emitCXXNewExpr(), emitDeclRefLValue(), emitDelegateCallArg(), emitDoStmt(), emitExprAsInit(), emitForStmt(), emitFunctionDeclLValue(), emitGotoStmt(), emitIfOnBoolExpr(), emitIfStmt(), emitLabel(), emitLoadOfBitfieldLValue(), emitLoadOfLValue(), emitLoadOfScalar(), emitLValueForBitField(), emitLValueForFieldInitialization(), emitOpenACCCombinedConstruct(), emitOpenACCComputeConstruct(), emitOpenACCDataConstruct(), emitOpenACCEnterDataConstruct(), emitOpenACCExitDataConstruct(), emitOpenACCHostDataConstruct(), emitOpenACCInitConstruct(), emitOpenACCLoopConstruct(), emitOpenACCSetConstruct(), emitOpenACCShutdownConstruct(), emitOpenACCUpdateConstruct(), emitOpenACCWaitConstruct(), emitPointerArithmetic(), emitPointerWithAlignment(), emitReturnStmt(), emitRotate(), emitScalarConstant(), emitStringLiteralLValue(), emitSwitchStmt(), emitUnaryOpLValue(), emitUnreachable(), emitValToTemp(), emitWhileStmt(), evaluateExprAsBool(), generateCode(), getAddressOfBaseClass(), getAddrOfBitFieldStorage(), getLoc(), clang::CIRGen::CIRGenCXXABI::loadIncomingCXXThis(), startFunction(), and storeAnyExprIntoOneUnit().

◆ getLoc() [2/3]

mlir::Location clang::CIRGen::CIRGenFunction::getLoc ( clang::SourceRange  srcLoc)

◆ getLoc() [3/3]

mlir::Location clang::CIRGen::CIRGenFunction::getLoc ( mlir::Location  lhs,
mlir::Location  rhs 
)

Definition at line 135 of file CIRGenFunction.cpp.

References getMLIRContext().

◆ getMLIRContext()

mlir::MLIRContext & clang::CIRGen::CIRGenFunction::getMLIRContext ( )
inline

◆ getOpenACCDataOperandInfo()

CIRGenFunction::OpenACCDataOperandInfo CIRGenFunction::getOpenACCDataOperandInfo ( const Expr e)

◆ getOverlapForBaseInit()

AggValueSlot::Overlap_t CIRGenFunction::getOverlapForBaseInit ( const CXXRecordDecl rd,
const CXXRecordDecl baseRD,
bool  isVirtual 
)

◆ getTarget()

const TargetInfo & clang::CIRGen::CIRGenFunction::getTarget ( ) const
inline

◆ getTypes()

CIRGenTypes & clang::CIRGen::CIRGenFunction::getTypes ( ) const
inline

Definition at line 141 of file CIRGenFunction.h.

References cgm, and clang::CIRGen::CIRGenModule::getTypes().

Referenced by commonBuildCXXMemberOrOperatorCall(), and emitCall().

◆ getUndefRValue()

RValue CIRGenFunction::getUndefRValue ( clang::QualType  ty)

Get an appropriate 'undef' rvalue for the given type.

TODO: What's the equivalent for MLIR? Currently we're only using this for void types so it just returns RValue::get(nullptr) but it'll need addressed later.

Definition at line 1549 of file CIRGenExpr.cpp.

References cgm, clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::RValue::get(), and clang::Type::isVoidType().

Referenced by emitBuiltinExpr(), and emitCall().

◆ getVTablePointers() [1/2]

void CIRGenFunction::getVTablePointers ( clang::BaseSubobject  base,
const clang::CXXRecordDecl nearestVBase,
clang::CharUnits  offsetFromNearestVBase,
bool  baseIsNonVirtualPrimaryBase,
const clang::CXXRecordDecl vtableClass,
VisitedVirtualBasesSetTy vbases,
VPtrsVector vptrs 
)

◆ getVTablePointers() [2/2]

CIRGenFunction::VPtrsVector CIRGenFunction::getVTablePointers ( const clang::CXXRecordDecl vtableClass)

Definition at line 399 of file CIRGenClass.cpp.

References getVTablePointers(), and clang::CharUnits::Zero().

Referenced by getVTablePointers(), and initializeVTablePointers().

◆ getVTablePtr()

mlir::Value CIRGenFunction::getVTablePtr ( mlir::Location  loc,
Address  thisAddr,
const clang::CXXRecordDecl vtableClass 
)

◆ hasAggregateEvaluationKind()

static bool clang::CIRGen::CIRGenFunction::hasAggregateEvaluationKind ( clang::QualType  type)
inlinestatic

◆ hasScalarEvaluationKind()

static bool clang::CIRGen::CIRGenFunction::hasScalarEvaluationKind ( clang::QualType  type)
inlinestatic

◆ haveInsertPoint()

bool clang::CIRGen::CIRGenFunction::haveInsertPoint ( ) const
inline

True if an insertion point is defined.

If not, this indicates that the current code being emitted is unreachable. FIXME(cir): we need to inspect this and perhaps use a cleaner mechanism since we don't yet force null insertion point to designate behavior (like LLVM's codegen does) and we probably shouldn't.

Definition at line 358 of file CIRGenFunction.h.

Referenced by emitCleanup().

◆ initializeVTablePointer()

void CIRGenFunction::initializeVTablePointer ( mlir::Location  loc,
const VPtr vptr 
)

◆ initializeVTablePointers()

void CIRGenFunction::initializeVTablePointers ( mlir::Location  loc,
const clang::CXXRecordDecl rd 
)

◆ isConstructorDelegationValid()

bool CIRGenFunction::isConstructorDelegationValid ( const clang::CXXConstructorDecl ctor)
static

Checks whether the given constructor is a valid subject for the complete-to-base constructor delegation optimization, i.e.

emitting the complete constructor as a simple call to the base constructor.

Definition at line 29 of file CIRGenClass.cpp.

References clang::Type::castAs(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), clang::CXXConstructorDecl::isDelegatingConstructor(), and clang::FunctionProtoType::isVariadic().

Referenced by emitConstructorBody().

◆ isInConditionalBranch()

bool clang::CIRGen::CIRGenFunction::isInConditionalBranch ( ) const
inline

Definition at line 1450 of file CIRGenFunction.h.

References outermostConditional.

Referenced by pushFullExprCleanup(), and setBeforeOutermostConditional().

◆ isLValueSuitableForInlineAtomic()

bool CIRGenFunction::isLValueSuitableForInlineAtomic ( LValue  lv)

An LValue is a candidate for having its loads and stores be made atomic if we are operating under /volatile:ms and the LValue itself is volatile and performing such an operation can be performed without a libcall.

Definition at line 2222 of file CIRGenExpr.cpp.

References cgm, clang::CIRGen::CIRGenModule::errorNYI(), and clang::CIRGen::CIRGenModule::getLangOpts().

Referenced by emitLoadOfScalar().

◆ isTrivialInitializer()

bool CIRGenFunction::isTrivialInitializer ( const Expr init)

Determine whether the given initializer is trivial in the sense that it requires no code to be generated.

Definition at line 66 of file CIRGenDecl.cpp.

Referenced by emitAutoVarInit().

◆ loadCXXThis()

mlir::Value clang::CIRGen::CIRGenFunction::loadCXXThis ( )
inline

Load the value for 'this'.

This function is only valid while generating code for an C++ member function. FIXME(cir): this should return a mlir::Value!

Definition at line 663 of file CIRGenFunction.h.

References cxxThisValue.

Referenced by emitMemberInitializer(), and loadCXXThisAddress().

◆ loadCXXThisAddress()

Address CIRGenFunction::loadCXXThisAddress ( )

◆ makeAddrLValue() [1/2]

LValue clang::CIRGen::CIRGenFunction::makeAddrLValue ( Address  addr,
QualType  ty,
AlignmentSource  source = AlignmentSource::Type 
)
inline

◆ makeAddrLValue() [2/2]

LValue clang::CIRGen::CIRGenFunction::makeAddrLValue ( Address  addr,
QualType  ty,
LValueBaseInfo  baseInfo 
)
inline

Definition at line 641 of file CIRGenFunction.h.

References clang::CIRGen::LValue::makeAddr().

◆ makeNaturalAddressForPointer()

Address clang::CIRGen::CIRGenFunction::makeNaturalAddressForPointer ( mlir::Value  ptr,
QualType  t,
CharUnits  alignment,
bool  forPointeeType = false,
LValueBaseInfo baseInfo = nullptr 
)
inline

Construct an address with the natural alignment of T.

If a pointer to T is expected to be signed, the pointer passed to this function must have been signed, and the returned Address will have the pointer authentication information needed to authenticate the signed pointer.

Definition at line 622 of file CIRGenFunction.h.

References cgm, convertTypeForMem(), clang::CIRGen::CIRGenModule::getNaturalTypeAlignment(), and clang::CharUnits::isZero().

Referenced by emitPointerWithAlignment().

◆ makeNaturalAlignAddrLValue()

LValue clang::CIRGen::CIRGenFunction::makeNaturalAlignAddrLValue ( mlir::Value  val,
QualType  ty 
)

◆ makeNaturalAlignPointeeAddrLValue()

LValue clang::CIRGen::CIRGenFunction::makeNaturalAlignPointeeAddrLValue ( mlir::Value  v,
clang::QualType  t 
)

Given a value of type T* that may not be to a complete object, construct an l-vlaue withi the natural pointee alignment of T.

Definition at line 709 of file CIRGenFunction.cpp.

References cgm, clang::CIRGen::CIRGenModule::getNaturalTypeAlignment(), makeAddrLValue(), and cir::MissingFeatures::opTBAA().

Referenced by emitCallExprLValue(), and emitMemberInitializer().

◆ maybeEmitDeferredVarDeclInit()

void CIRGenFunction::maybeEmitDeferredVarDeclInit ( const VarDecl vd)

Definition at line 821 of file CIRGenDecl.cpp.

References b, and emitVarDecl().

Referenced by emitDecl().

◆ popCleanupBlock()

void CIRGenFunction::popCleanupBlock ( )

◆ popCleanupBlocks()

void CIRGenFunction::popCleanupBlocks ( EHScopeStack::stable_iterator  oldCleanupStackDepth)

Takes the old cleanup stack size and emits the cleanup blocks that have been added.

Pops cleanup blocks until the given savepoint is reached.

Definition at line 171 of file CIRGenCleanup.cpp.

References cir::MissingFeatures::ehstackBranches().

Referenced by finishFunction(), and clang::CIRGen::CIRGenFunction::RunCleanupsScope::forceCleanup().

◆ pushDestroy()

void CIRGenFunction::pushDestroy ( CleanupKind  kind,
Address  addr,
QualType  type,
Destroyer destroyer 
)

Definition at line 683 of file CIRGenDecl.cpp.

References clang::ast_matchers::type.

Referenced by pushTemporaryCleanup().

◆ pushFullExprCleanup()

template<class T , class... As>
void clang::CIRGen::CIRGenFunction::pushFullExprCleanup ( CleanupKind  kind,
As...  a 
)
inline

Push a cleanup to be run at the end of the current full-expression.

Safe against the possibility that we're currently inside a conditionally-evaluated expression.

Definition at line 715 of file CIRGenFunction.h.

References cgm, ehStack, clang::CIRGen::CIRGenModule::errorNYI(), isInConditionalBranch(), and clang::T.

◆ setAddrOfLocalVar()

void clang::CIRGen::CIRGenFunction::setAddrOfLocalVar ( const clang::VarDecl vd,
Address  addr 
)
inline

Set the address of a local variable.

Definition at line 523 of file CIRGenFunction.h.

References clang::CIRGen::Address::getPointer(), localDeclMap, and symbolTable.

Referenced by emitAutoVarAlloca(), emitStaticVarDecl(), and startFunction().

◆ setBeforeOutermostConditional()

void clang::CIRGen::CIRGenFunction::setBeforeOutermostConditional ( mlir::Value  value,
Address  addr 
)
inline

◆ shouldEmitVTableTypeCheckedLoad()

bool CIRGenFunction::shouldEmitVTableTypeCheckedLoad ( const CXXRecordDecl rd)

Returns whether we should perform a type checked load when loading a virtual function for virtual calls to members of RD.

This is generally true when both vcall CFI and whole-program-vtables are enabled.

Definition at line 773 of file CIRGenClass.cpp.

References cgm, clang::CIRGen::CIRGenModule::getCodeGenOpts(), cir::MissingFeatures::hiddenVisibility(), and cir::MissingFeatures::sanitizers().

◆ shouldNullCheckClassCastValue()

bool clang::CIRGen::CIRGenFunction::shouldNullCheckClassCastValue ( const CastExpr ce)

◆ startFunction()

void clang::CIRGen::CIRGenFunction::startFunction ( clang::GlobalDecl  gd,
clang::QualType  returnType,
cir::FuncOp  fn,
cir::FuncType  funcType,
FunctionArgList  args,
clang::SourceLocation  loc,
clang::SourceLocation  startLoc 
)

◆ tryEmitAsConstant() [1/2]

CIRGenFunction::ConstantEmission CIRGenFunction::tryEmitAsConstant ( const DeclRefExpr refExpr)

Try to emit a reference to the given value without producing it as an l-value.

For many cases, this is just an optimization, but it avoids us needing to emit global copies of variables if they're named without triggering a formal use in a context where we can't emit a direct reference to them, for instance if a block or lambda or a member of a local class uses a const int variable or constexpr variable from an enclosing function.

For named members of enums, this is the only way they are emitted.

Definition at line 2168 of file CIRGenExpr.cpp.

References c, clang::CIRGen::ConstantEmitter::emitAbstract(), clang::Expr::EvaluateAsRValue(), clang::CIRGen::CIRGenFunction::ConstantEmission::forValue(), cir::MissingFeatures::generateDebugInfo(), getContext(), clang::DeclRefExpr::getDecl(), clang::DeclRefExpr::getLocation(), clang::Expr::getType(), clang::Expr::EvalStatus::HasSideEffects, cir::MissingFeatures::tryEmitAsConstant(), and clang::Expr::EvalResult::Val.

Referenced by tryEmitAsConstant().

◆ tryEmitAsConstant() [2/2]

CIRGenFunction::ConstantEmission CIRGenFunction::tryEmitAsConstant ( const MemberExpr me)

Definition at line 2203 of file CIRGenExpr.cpp.

References tryEmitAsConstant(), and tryToConvertMemberExprToDeclRefExpr().

Friends And Related Function Documentation

◆ ::ScalarExprEmitter

friend class ::ScalarExprEmitter
friend

Member Data Documentation

◆ cgm

CIRGenModule& clang::CIRGen::CIRGenFunction::cgm

Definition at line 50 of file CIRGenFunction.h.

Referenced by addInitializerToStaticVarDecl(), buildFunctionArgList(), commonBuildCXXMemberOrOperatorCall(), convertTempToRValue(), convertType(), convertTypeForMem(), createMemTemp(), createReferenceTemporary(), createTempAllocaWithoutCast(), emitAddrOfFieldStorage(), emitArrayLength(), emitArraySubscriptExpr(), emitArrayToPointerDecay(), emitAsmStmt(), emitAtomicExpr(), emitAtomicInit(), emitAtomicOp(), emitAutoVarAlloca(), emitAutoVarCleanups(), emitAutoVarInit(), emitAutoVarTypeCleanup(), emitBinaryOperatorLValue(), emitBuiltinExpr(), emitCall(), emitCallArg(), emitCallArgs(), emitCallee(), emitCallExpr(), emitCallExprLValue(), emitCastLValue(), emitCheckedArgForAssume(), emitComplexAssignmentLValue(), emitComplexPrePostIncDec(), emitCompoundLiteralLValue(), emitConstructorBody(), emitCtorPrologue(), emitCXXAggrConstructorCall(), emitCXXConstructExpr(), emitCXXConstructorCall(), emitCXXDestructorCall(), emitCXXMemberCallExpr(), emitCXXMemberOrOperatorCall(), emitCXXMemberOrOperatorMemberCallExpr(), emitCXXNewAllocSize(), emitCXXNewExpr(), emitCXXPseudoDestructorExpr(), emitCXXThrowExpr(), emitDecl(), emitDeclRefLValue(), emitDelegateCallArg(), emitDelegateCXXConstructorCall(), emitDelegatingCXXConstructorCall(), emitDestroy(), emitDestructorBody(), emitExprAsInit(), emitFunctionDeclLValue(), emitGlobalVarDeclLValue(), emitImplicitAssignmentOperatorBody(), emitInitializerForField(), emitLoadOfBitfieldLValue(), emitLoadOfLValue(), emitLoadOfReference(), emitLoadOfScalar(), emitLValue(), emitLValueForBitField(), emitLValueForField(), emitLValueForFieldInitialization(), emitMaterializeTemporaryExpr(), emitMemberExpr(), emitMemberInitializer(), emitNewDeleteCall(), emitNewInitializer(), emitNullInitialization(), emitOpenACCAtomicConstruct(), emitOpenACCIntExpr(), emitOpenACCWaitConstruct(), emitOpOnBoolExpr(), emitPointerArithmetic(), emitPointerWithAlignment(), emitReturnStmt(), emitScalarConstant(), emitScalarInit(), emitStaticVarDecl(), emitStmt(), emitStoreOfScalar(), emitStoreThroughBitfieldLValue(), emitStoreThroughLValue(), emitStringLiteralLValue(), emitUnaryOpLValue(), emitVAArg(), emitVarDecl(), emitVariablyModifiedType(), evaluateExprAsBool(), getAddressOfBaseClass(), getAddrOfBitFieldStorage(), getCIRGenModule(), getContext(), getDestroyer(), getLangOpts(), getMLIRContext(), getOpenACCDataOperandInfo(), clang::CIRGen::CIRGenFunction::ConstantEmission::getReferenceLValue(), getTarget(), getTypes(), getUndefRValue(), getVTablePtr(), initializeVTablePointer(), initializeVTablePointers(), isLValueSuitableForInlineAtomic(), loadCXXThisAddress(), makeNaturalAddressForPointer(), makeNaturalAlignAddrLValue(), makeNaturalAlignPointeeAddrLValue(), clang::CIRGen::CIRGenCallee::prepareConcreteCallee(), pushFullExprCleanup(), pushTemporaryCleanup(), shouldEmitVTableTypeCheckedLoad(), startFunction(), and storeAnyExprIntoOneUnit().

◆ condTypeStack

llvm::SmallVector<mlir::Type, 2> clang::CIRGen::CIRGenFunction::condTypeStack

The type of the condition for the emitting switch statement.

Definition at line 93 of file CIRGenFunction.h.

Referenced by emitSwitchCase(), and emitSwitchStmt().

◆ counterAggTmp

unsigned clang::CIRGen::CIRGenFunction::counterAggTmp = 0

Definition at line 342 of file CIRGenFunction.h.

Referenced by getCounterAggTmpAsString().

◆ counterRefTmp

unsigned clang::CIRGen::CIRGenFunction::counterRefTmp = 0

Hold counters for incrementally naming temporaries.

Definition at line 341 of file CIRGenFunction.h.

Referenced by getCounterRefTmpAsString().

◆ curFn

cir::FuncOp clang::CIRGen::CIRGenFunction::curFn

The function for which code is currently being generated.

Definition at line 85 of file CIRGenFunction.h.

Referenced by clang::CIRGen::CIRGenModule::createCIRFunction(), clang::CIRGen::CIRGenFunction::LexicalScope::createCleanupBlock(), getCurFunctionEntryBlock(), and startFunction().

◆ curFuncDecl

const clang::Decl* clang::CIRGen::CIRGenFunction::curFuncDecl = nullptr

Definition at line 82 of file CIRGenFunction.h.

Referenced by emitBaseInitializer(), loadCXXThisAddress(), and startFunction().

◆ curGD

clang::GlobalDecl clang::CIRGen::CIRGenFunction::curGD

◆ curLexScope

LexicalScope* clang::CIRGen::CIRGenFunction::curLexScope = nullptr

◆ currentCleanupStackDepth

EHScopeStack::stable_iterator clang::CIRGen::CIRGenFunction::currentCleanupStackDepth = ehStack.stable_end()

◆ currSrcLoc

std::optional<mlir::Location> clang::CIRGen::CIRGenFunction::currSrcLoc

◆ cxxabiThisDecl

ImplicitParamDecl* clang::CIRGen::CIRGenFunction::cxxabiThisDecl = nullptr

CXXThisDecl - When generating code for a C++ member function, this will hold the implicit 'this' declaration.

Definition at line 72 of file CIRGenFunction.h.

Referenced by clang::CIRGen::CIRGenCXXABI::buildThisParam(), and clang::CIRGen::CIRGenCXXABI::getThisDecl().

◆ cxxabiThisValue

mlir::Value clang::CIRGen::CIRGenFunction::cxxabiThisValue = nullptr

◆ cxxDefaultInitExprThis

Address clang::CIRGen::CIRGenFunction::cxxDefaultInitExprThis = Address::invalid()

The value of 'this' to sue when evaluating CXXDefaultInitExprs within this expression.

Definition at line 79 of file CIRGenFunction.h.

Referenced by clang::CIRGen::CIRGenFunction::FieldConstructionScope::FieldConstructionScope(), and clang::CIRGen::CIRGenFunction::FieldConstructionScope::~FieldConstructionScope().

◆ cxxThisAlignment

clang::CharUnits clang::CIRGen::CIRGenFunction::cxxThisAlignment

Definition at line 75 of file CIRGenFunction.h.

Referenced by loadCXXThisAddress().

◆ cxxThisValue

mlir::Value clang::CIRGen::CIRGenFunction::cxxThisValue = nullptr

Definition at line 74 of file CIRGenFunction.h.

Referenced by emitCtorPrologue(), loadCXXThis(), and startFunction().

◆ destroyCXXObject

void CIRGenFunction::destroyCXXObject
static

Definition at line 920 of file CIRGenFunction.h.

Referenced by getDestroyer(), and pushTemporaryCleanup().

◆ ehStack

EHScopeStack clang::CIRGen::CIRGenFunction::ehStack

◆ fnRetAlloca

std::optional<mlir::Value> clang::CIRGen::CIRGenFunction::fnRetAlloca

The compiler-generated variable that holds the return value.

Definition at line 65 of file CIRGenFunction.h.

Referenced by emitReturnStmt().

◆ localDeclMap

DeclMapTy clang::CIRGen::CIRGenFunction::localDeclMap

◆ opaqueLValues

llvm::DenseMap<const OpaqueValueExpr *, LValue> clang::CIRGen::CIRGenFunction::opaqueLValues

Keeps track of the current set of opaque value expressions.

Definition at line 151 of file CIRGenFunction.h.

Referenced by clang::CIRGen::CIRGenFunction::OpaqueValueMappingData::bind(), and clang::CIRGen::CIRGenFunction::OpaqueValueMappingData::unbind().

◆ opaqueRValues

llvm::DenseMap<const OpaqueValueExpr *, RValue> clang::CIRGen::CIRGenFunction::opaqueRValues

◆ outermostConditional

ConditionalEvaluation* clang::CIRGen::CIRGenFunction::outermostConditional = nullptr

◆ prologueCleanupDepth

EHScopeStack::stable_iterator clang::CIRGen::CIRGenFunction::prologueCleanupDepth

The cleanup depth enclosing all the cleanups associated with the parameters.

Definition at line 704 of file CIRGenFunction.h.

Referenced by finishFunction(), and startFunction().

◆ sanOpts

clang::SanitizerSet clang::CIRGen::CIRGenFunction::sanOpts

Sanitizers enabled for this function.

Definition at line 105 of file CIRGenFunction.h.

Referenced by emitCheckedArgForAssume(), and emitNullabilityCheck().

◆ sawAsmBlock

bool clang::CIRGen::CIRGenFunction::sawAsmBlock = false

Whether or not a Microsoft-style asm block has been processed within this fuction.

These can potentially set the return value.

Definition at line 117 of file CIRGenFunction.h.

◆ symbolTable

SymTableTy clang::CIRGen::CIRGenFunction::symbolTable

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