clang  3.9.0
Functions
CGAtomic.cpp File Reference
#include "CodeGenFunction.h"
#include "CGCall.h"
#include "CGRecordLayout.h"
#include "CodeGenModule.h"
#include "clang/AST/ASTContext.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Operator.h"
Include dependency graph for CGAtomic.cpp:

Go to the source code of this file.

Functions

static RValue emitAtomicLibcall (CodeGenFunction &CGF, StringRef fnName, QualType resultType, CallArgList &args)
 
static bool isFullSizeType (CodeGenModule &CGM, llvm::Type *type, uint64_t expectedSize)
 Does a store of the given IR type modify the full expected width? More...
 
static void emitAtomicCmpXchg (CodeGenFunction &CGF, AtomicExpr *E, bool IsWeak, Address Dest, Address Ptr, Address Val1, Address Val2, uint64_t Size, llvm::AtomicOrdering SuccessOrder, llvm::AtomicOrdering FailureOrder)
 
static void emitAtomicCmpXchgFailureSet (CodeGenFunction &CGF, AtomicExpr *E, bool IsWeak, Address Dest, Address Ptr, Address Val1, Address Val2, llvm::Value *FailureOrderVal, uint64_t Size, llvm::AtomicOrdering SuccessOrder)
 Given an ordering required on success, emit all possible cmpxchg instructions to cope with the provided (but possibly only dynamically known) FailureOrder. More...
 
static void EmitAtomicOp (CodeGenFunction &CGF, AtomicExpr *E, Address Dest, Address Ptr, Address Val1, Address Val2, llvm::Value *IsWeak, llvm::Value *FailureOrder, uint64_t Size, llvm::AtomicOrdering Order)
 
static Address EmitValToTemp (CodeGenFunction &CGF, Expr *E)
 
static void AddDirectArgument (CodeGenFunction &CGF, CallArgList &Args, bool UseOptimizedLibcall, llvm::Value *Val, QualType ValTy, SourceLocation Loc, CharUnits SizeInChars)
 
static void EmitAtomicUpdateValue (CodeGenFunction &CGF, AtomicInfo &Atomics, RValue OldRVal, const llvm::function_ref< RValue(RValue)> &UpdateOp, Address DesiredAddr)
 
static void EmitAtomicUpdateValue (CodeGenFunction &CGF, AtomicInfo &Atomics, RValue UpdateRVal, Address DesiredAddr)
 

Function Documentation

static void AddDirectArgument ( CodeGenFunction CGF,
CallArgList Args,
bool  UseOptimizedLibcall,
llvm::Value Val,
QualType  ValTy,
SourceLocation  Loc,
CharUnits  SizeInChars 
)
static
static void emitAtomicCmpXchg ( CodeGenFunction CGF,
AtomicExpr E,
bool  IsWeak,
Address  Dest,
Address  Ptr,
Address  Val1,
Address  Val2,
uint64_t  Size,
llvm::AtomicOrdering  SuccessOrder,
llvm::AtomicOrdering  FailureOrder 
)
static
static void emitAtomicCmpXchgFailureSet ( CodeGenFunction CGF,
AtomicExpr E,
bool  IsWeak,
Address  Dest,
Address  Ptr,
Address  Val1,
Address  Val2,
llvm::Value FailureOrderVal,
uint64_t  Size,
llvm::AtomicOrdering  SuccessOrder 
)
static

Given an ordering required on success, emit all possible cmpxchg instructions to cope with the provided (but possibly only dynamically known) FailureOrder.

Definition at line 405 of file CGAtomic.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::CurFn, and emitAtomicCmpXchg().

Referenced by EmitAtomicOp().

static RValue emitAtomicLibcall ( CodeGenFunction CGF,
StringRef  fnName,
QualType  resultType,
CallArgList args 
)
static
static void EmitAtomicOp ( CodeGenFunction CGF,
AtomicExpr E,
Address  Dest,
Address  Ptr,
Address  Val1,
Address  Val2,
llvm::Value IsWeak,
llvm::Value FailureOrder,
uint64_t  Size,
llvm::AtomicOrdering  Order 
)
static
static void EmitAtomicUpdateValue ( CodeGenFunction CGF,
AtomicInfo &  Atomics,
RValue  OldRVal,
const llvm::function_ref< RValue(RValue)> &  UpdateOp,
Address  DesiredAddr 
)
static
static void EmitAtomicUpdateValue ( CodeGenFunction CGF,
AtomicInfo &  Atomics,
RValue  UpdateRVal,
Address  DesiredAddr 
)
static
static Address EmitValToTemp ( CodeGenFunction CGF,
Expr E 
)
static
static bool isFullSizeType ( CodeGenModule CGM,
llvm::Type *  type,
uint64_t  expectedSize 
)
static

Does a store of the given IR type modify the full expected width?

Definition at line 315 of file CGAtomic.cpp.

References clang::CodeGen::CodeGenModule::getDataLayout().