9#ifndef LLVM_CLANG_LIB_CODEGEN_CGBUILTIN_H
10#define LLVM_CLANG_LIB_CODEGEN_CGBUILTIN_H
20 _InterlockedCompareExchange,
21 _InterlockedDecrement,
23 _InterlockedExchangeAdd,
24 _InterlockedExchangeSub,
25 _InterlockedIncrement,
28 _InterlockedExchangeAdd_acq,
29 _InterlockedExchangeAdd_rel,
30 _InterlockedExchangeAdd_nf,
31 _InterlockedExchange_acq,
32 _InterlockedExchange_rel,
33 _InterlockedExchange_nf,
34 _InterlockedCompareExchange_acq,
35 _InterlockedCompareExchange_rel,
36 _InterlockedCompareExchange_nf,
37 _InterlockedCompareExchange128,
38 _InterlockedCompareExchange128_acq,
39 _InterlockedCompareExchange128_rel,
40 _InterlockedCompareExchange128_nf,
50 _InterlockedIncrement_acq,
51 _InterlockedIncrement_rel,
52 _InterlockedIncrement_nf,
53 _InterlockedDecrement_acq,
54 _InterlockedDecrement_rel,
55 _InterlockedDecrement_nf,
66 llvm::StringRef Name =
"") {
67 static_assert(N,
"expect non-empty argument");
69 for (
unsigned I = 0; I < N; ++I)
71 llvm::Function *F = CGF.
CGM.
getIntrinsic(IntrinsicID, Args[0]->getType());
72 return CGF.
Builder.CreateCall(F, Args, Name);
78 unsigned ConstrainedIntrinsicID);
90 llvm::AtomicRMWInst::BinOp
Kind,
92 llvm::AtomicOrdering Ordering =
93 llvm::AtomicOrdering::SequentiallyConsistent);
96 const llvm::Intrinsic::ID IntrinsicID,
llvm::Value * emitBuiltinWithOneOverloadedType(clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, unsigned IntrinsicID, llvm::StringRef Name="")
clang::CodeGen::Address CheckAtomicAlignment(clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E)
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.
llvm::Value * MakeBinaryAtomicValue(clang::CodeGen::CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const clang::CallExpr *E, llvm::AtomicOrdering Ordering=llvm::AtomicOrdering::SequentiallyConsistent)
llvm::Value * EmitOverflowIntrinsic(clang::CodeGen::CodeGenFunction &CGF, const llvm::Intrinsic::ID IntrinsicID, llvm::Value *X, llvm::Value *Y, llvm::Value *&Carry)
llvm::Value * EmitFromInt(clang::CodeGen::CodeGenFunction &CGF, llvm::Value *V, clang::QualType T, llvm::Type *ResultType)
llvm::Value * emitUnaryMaybeConstrainedFPBuiltin(clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, unsigned IntrinsicID, unsigned ConstrainedIntrinsicID)
llvm::Value * MakeAtomicCmpXchgValue(clang::CodeGen::CodeGenFunction &CGF, const clang::CallExpr *E, bool ReturnBool)
Utility to insert an atomic cmpxchg instruction.
enum clang::sema::@1840::IndirectLocalPathEntry::EntryKind Kind
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::Value * EmitScalarExpr(const Expr *E, bool IgnoreResultAssign=false)
EmitScalarExpr - Emit the computation of the specified expression of LLVM scalar type,...
llvm::Function * getIntrinsic(unsigned IID, ArrayRef< llvm::Type * > Tys={})
A (possibly-)qualified type.