[cfe-commits] r54241 - /cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Mon P Wang wangmp at apple.com
Wed Jul 30 20:28:24 PDT 2008


Author: wangmp
Date: Wed Jul 30 22:28:23 2008
New Revision: 54241

URL: http://llvm.org/viewvc/llvm-project?rev=54241&view=rev
Log:
Updated to match new atomic names (to enable overloading for pointers to
different address spaces) for llvm r54195.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=54241&r1=54240&r2=54241&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Jul 30 22:28:23 2008
@@ -29,8 +29,10 @@
 // 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 @@
     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:





More information about the cfe-commits mailing list