From: Mon P Wang Date: Thu, 31 Jul 2008 03:28:23 +0000 (+0000) Subject: Updated to match new atomic names (to enable overloading for pointers to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5004516489c931cf839bdbdde5a76e4074cc888;p=clang Updated to match new atomic names (to enable overloading for pointers to different address spaces) for llvm r54195. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54241 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index f32688fded..b493966c62 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -29,8 +29,10 @@ using namespace llvm; // the expression node static RValue EmitBinaryAtomic(CodeGenFunction& CFG, Intrinsic::ID Id, const CallExpr *E) { - const llvm::Type *ResType = CFG.ConvertType(E->getType()); - Value *AtomF = CFG.CGM.getIntrinsic(Id, &ResType, 1); + const llvm::Type *ResType[2]; + ResType[0] = CFG.ConvertType(E->getType()); + ResType[1] = CFG.ConvertType(E->getArg(0)->getType()); + Value *AtomF = CFG.CGM.getIntrinsic(Id, ResType, 2); return RValue::get(CFG.Builder.CreateCall2(AtomF, CFG.EmitScalarExpr(E->getArg(0)), CFG.EmitScalarExpr(E->getArg(1)))); @@ -356,8 +358,10 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) { Args[0]= EmitScalarExpr(E->getArg(0)); Args[1] = EmitScalarExpr(E->getArg(1)); Args[2] = EmitScalarExpr(E->getArg(2)); - const llvm::Type *ResType = ConvertType(E->getType()); - Value *AtomF = CGM.getIntrinsic(Intrinsic::atomic_cmp_swap, &ResType, 1); + const llvm::Type *ResType[2]; + ResType[0]= ConvertType(E->getType()); + ResType[1] = ConvertType(E->getArg(0)->getType()); + Value *AtomF = CGM.getIntrinsic(Intrinsic::atomic_cmp_swap, ResType, 2); return RValue::get(Builder.CreateCall(AtomF, &Args[0], &Args[1]+2)); } case Builtin::BI__sync_lock_test_and_set: