clang 23.0.0git
CIRGenBuiltin.cpp File Reference
#include "CIRGenCall.h"
#include "CIRGenFunction.h"
#include "CIRGenModule.h"
#include "CIRGenValue.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/Value.h"
#include "mlir/Support/LLVM.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/Expr.h"
#include "clang/AST/GlobalDecl.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/CIR/Dialect/IR/CIRTypes.h"
#include "clang/CIR/MissingFeatures.h"
#include "llvm/Support/ErrorHandling.h"

Go to the source code of this file.

Functions

static RValue emitLibraryCall (CIRGenFunction &cgf, const FunctionDecl *fd, const CallExpr *e, mlir::Operation *calleeValue)
template<typename Op>
static RValue emitBuiltinBitOp (CIRGenFunction &cgf, const CallExpr *e, bool poisonZero=false)
static mlir::Value emitToInt (CIRGenFunction &cgf, mlir::Value v, QualType t, cir::IntType intType)
 Emit the conversions required to turn the given value into an integer of the given size.
static mlir::Value emitFromInt (CIRGenFunction &cgf, mlir::Value v, QualType t, mlir::Type resultType)
static Address checkAtomicAlignment (CIRGenFunction &cgf, const CallExpr *e)
static mlir::Value makeBinaryAtomicValue (CIRGenFunction &cgf, cir::AtomicFetchKind kind, const CallExpr *expr, mlir::Type *originalArgType, mlir::Value *emittedArgValue=nullptr, cir::MemOrder ordering=cir::MemOrder::SequentiallyConsistent)
 Utility to insert an atomic instruction based on Intrinsic::ID and the expression node.
static RValue emitBinaryAtomicPost (CIRGenFunction &cgf, cir::AtomicFetchKind atomicOpkind, const CallExpr *e, cir::BinOpKind binopKind, bool invert=false)
static void emitAtomicFenceOp (CIRGenFunction &cgf, const CallExpr *expr, cir::SyncScopeKind syncScope)
static WidthAndSignedness getIntegerWidthAndSignedness (const clang::ASTContext &astContext, const clang::QualType type)
static struct WidthAndSignedness EncompassingIntegerType (ArrayRef< struct WidthAndSignedness > types)
template<class Operation>
static RValue emitUnaryMaybeConstrainedFPBuiltin (CIRGenFunction &cgf, const CallExpr &e)
template<class Operation>
static RValue emitUnaryFPBuiltin (CIRGenFunction &cgf, const CallExpr &e)
static RValue errorBuiltinNYI (CIRGenFunction &cgf, const CallExpr *e, unsigned builtinID)
static RValue emitBuiltinAlloca (CIRGenFunction &cgf, const CallExpr *e, unsigned builtinID)
static bool shouldCIREmitFPMathIntrinsic (CIRGenFunction &cgf, const CallExpr *e, unsigned builtinID)
static RValue tryEmitFPMathIntrinsic (CIRGenFunction &cgf, const CallExpr *e, unsigned builtinID)
static std::optional< mlir::ValueemitTargetArchBuiltinExpr (CIRGenFunction *cgf, unsigned builtinID, const CallExpr *e, ReturnValueSlot &returnValue, llvm::Triple::ArchType arch)

Function Documentation

◆ checkAtomicAlignment()

◆ emitAtomicFenceOp()

◆ emitBinaryAtomicPost()

RValue emitBinaryAtomicPost ( CIRGenFunction & cgf,
cir::AtomicFetchKind atomicOpkind,
const CallExpr * e,
cir::BinOpKind binopKind,
bool invert = false )
static

◆ emitBuiltinAlloca()

◆ emitBuiltinBitOp()

◆ emitFromInt()

◆ emitLibraryCall()

◆ emitTargetArchBuiltinExpr()

◆ emitToInt()

mlir::Value emitToInt ( CIRGenFunction & cgf,
mlir::Value v,
QualType t,
cir::IntType intType )
static

Emit the conversions required to turn the given value into an integer of the given size.

Definition at line 66 of file CIRGenBuiltin.cpp.

References cir::CIRBaseBuilderTy::createPtrToInt(), clang::CIRGen::CIRGenFunction::emitToMemory(), and clang::CIRGen::CIRGenFunction::getBuilder().

Referenced by makeBinaryAtomicValue().

◆ emitUnaryFPBuiltin()

◆ emitUnaryMaybeConstrainedFPBuiltin()

◆ EncompassingIntegerType()

struct WidthAndSignedness EncompassingIntegerType ( ArrayRef< struct WidthAndSignedness > types)
static

◆ errorBuiltinNYI()

◆ getIntegerWidthAndSignedness()

◆ makeBinaryAtomicValue()

◆ shouldCIREmitFPMathIntrinsic()

◆ tryEmitFPMathIntrinsic()