Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGAtomic.cpp
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | |||||
static RValue emitAtomicLibcall(CodeGenFunction &CGF, | static RValue emitAtomicLibcall(CodeGenFunction &CGF, | ||||
StringRef fnName, | StringRef fnName, | ||||
QualType resultType, | QualType resultType, | ||||
CallArgList &args) { | CallArgList &args) { | ||||
const CGFunctionInfo &fnInfo = | const CGFunctionInfo &fnInfo = | ||||
CGF.CGM.getTypes().arrangeBuiltinFunctionCall(resultType, args); | CGF.CGM.getTypes().arrangeBuiltinFunctionCall(resultType, args); | ||||
llvm::FunctionType *fnTy = CGF.CGM.getTypes().GetFunctionType(fnInfo); | llvm::FunctionType *fnTy = CGF.CGM.getTypes().GetFunctionType(fnInfo); | ||||
llvm::FunctionCallee fn = CGF.CGM.CreateRuntimeFunction(fnTy, fnName); | llvm::AttributeList fnAttrs; | ||||
fnAttrs = fnAttrs.addAttribute(CGF.getLLVMContext(), | |||||
llvm::AttributeList::FunctionIndex, | |||||
llvm::Attribute::NoUnwind); | |||||
llvm::FunctionCallee fn = | |||||
CGF.CGM.CreateRuntimeFunction(fnTy, fnName, fnAttrs); | |||||
eugenis: This needs a clang test, and better move it to a separate change. | |||||
auto callee = CGCallee::forDirect(fn); | auto callee = CGCallee::forDirect(fn); | ||||
return CGF.EmitCall(fnInfo, callee, ReturnValueSlot(), args); | return CGF.EmitCall(fnInfo, callee, ReturnValueSlot(), args); | ||||
} | } | ||||
/// Does a store of the given IR type modify the full expected width? | /// Does a store of the given IR type modify the full expected width? | ||||
static bool isFullSizeType(CodeGenModule &CGM, llvm::Type *type, | static bool isFullSizeType(CodeGenModule &CGM, llvm::Type *type, | ||||
uint64_t expectedSize) { | uint64_t expectedSize) { | ||||
return (CGM.getDataLayout().getTypeStoreSize(type) * 8 == expectedSize); | return (CGM.getDataLayout().getTypeStoreSize(type) * 8 == expectedSize); | ||||
▲ Show 20 Lines • Show All 1,797 Lines • Show Last 20 Lines |
This needs a clang test, and better move it to a separate change.