clang 22.0.0git
Functions
CGBuiltin.h File Reference
#include "CodeGenFunction.h"

Go to the source code of this file.

Functions

template<unsigned N>
llvm::ValueemitBuiltinWithOneOverloadedType (clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, unsigned IntrinsicID, llvm::StringRef Name="")
 
llvm::ValueemitUnaryMaybeConstrainedFPBuiltin (clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, unsigned IntrinsicID, unsigned ConstrainedIntrinsicID)
 
llvm::ValueEmitToInt (clang::CodeGen::CodeGenFunction &CGF, llvm::Value *V, clang::QualType T, llvm::IntegerType *IntType)
 Emit the conversions required to turn the given value into an integer of the given size.
 
llvm::ValueEmitFromInt (clang::CodeGen::CodeGenFunction &CGF, llvm::Value *V, clang::QualType T, llvm::Type *ResultType)
 
clang::CodeGen::Address CheckAtomicAlignment (clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E)
 
llvm::ValueMakeBinaryAtomicValue (clang::CodeGen::CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const clang::CallExpr *E, llvm::AtomicOrdering Ordering=llvm::AtomicOrdering::SequentiallyConsistent)
 
llvm::ValueEmitOverflowIntrinsic (clang::CodeGen::CodeGenFunction &CGF, const llvm::Intrinsic::ID IntrinsicID, llvm::Value *X, llvm::Value *Y, llvm::Value *&Carry)
 
llvm::ValueMakeAtomicCmpXchgValue (clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, bool ReturnBool)
 Utility to insert an atomic cmpxchg instruction.
 

Function Documentation

◆ CheckAtomicAlignment()

clang::CodeGen::Address CheckAtomicAlignment ( clang::CodeGen::CodeGenFunction CGF,
const clang::CallExpr E 
)

◆ emitBuiltinWithOneOverloadedType()

template<unsigned N>
llvm::Value * emitBuiltinWithOneOverloadedType ( clang::CodeGen::CodeGenFunction CGF,
const clang::CallExpr E,
unsigned  IntrinsicID,
llvm::StringRef  Name = "" 
)

◆ EmitFromInt()

llvm::Value * EmitFromInt ( clang::CodeGen::CodeGenFunction CGF,
llvm::Value V,
clang::QualType  T,
llvm::Type ResultType 
)

◆ EmitOverflowIntrinsic()

llvm::Value * EmitOverflowIntrinsic ( clang::CodeGen::CodeGenFunction CGF,
const llvm::Intrinsic::ID  IntrinsicID,
llvm::Value X,
llvm::Value Y,
llvm::Value *&  Carry 
)

◆ EmitToInt()

llvm::Value * EmitToInt ( clang::CodeGen::CodeGenFunction CGF,
llvm::Value V,
clang::QualType  T,
llvm::IntegerType *  IntType 
)

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

Definition at line 252 of file CGBuiltin.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitToMemory(), clang::T, and V.

Referenced by EmitBinaryAtomicPost(), MakeAtomicCmpXchgValue(), and MakeBinaryAtomicValue().

◆ emitUnaryMaybeConstrainedFPBuiltin()

llvm::Value * emitUnaryMaybeConstrainedFPBuiltin ( clang::CodeGen::CodeGenFunction CGF,
const clang::CallExpr E,
unsigned  IntrinsicID,
unsigned  ConstrainedIntrinsicID 
)

◆ MakeAtomicCmpXchgValue()

llvm::Value * MakeAtomicCmpXchgValue ( CodeGenFunction CGF,
const CallExpr E,
bool  ReturnBool 
)

Utility to insert an atomic cmpxchg instruction.

Parameters
CGFThe current codegen function.
EBuiltin call expression to convert to cmpxchg. arg0 - address to operate on arg1 - value to compare with arg2 - new value
ReturnBoolSpecifies whether to return success flag of cmpxchg result or the old value.
Returns
result of cmpxchg, according to ReturnBool

Note: In order to lower Microsoft's _InterlockedCompareExchange* intrinsics invoke the function EmitAtomicCmpXchgForMSIntrin.

Definition at line 390 of file CGBuiltin.cpp.

References clang::CodeGen::CodeGenFunction::Builder, CheckAtomicAlignment(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CGBuilderTy::CreateAtomicCmpXchg(), E, EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), New, and clang::T.

Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr().

◆ MakeBinaryAtomicValue()

llvm::Value * MakeBinaryAtomicValue ( clang::CodeGen::CodeGenFunction CGF,
llvm::AtomicRMWInst::BinOp  Kind,
const clang::CallExpr E,
llvm::AtomicOrdering  Ordering = llvm::AtomicOrdering::SequentiallyConsistent 
)