]> granicus.if.org Git - clang/commitdiff
Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 27 May 2009 23:45:33 +0000 (23:45 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 27 May 2009 23:45:33 +0000 (23:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72504 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp
test/CodeGen/atomic.c

index a73be2c60e8ff08c2dc24f243075e7f565055f7f..a90b30404bdc91c731dcad74147e93bcfe755939 100644 (file)
@@ -475,7 +475,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
     const llvm::Type *ElTy =
       cast<llvm::PointerType>(Ptr->getType())->getElementType();
     Builder.CreateStore(llvm::Constant::getNullValue(ElTy), Ptr, true);
-    return RValue();
+    return RValue::get(0);
   }
 
   case Builtin::BI__sync_synchronize: {
@@ -483,7 +483,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
     C[0] = C[1] = C[2] = C[3] = llvm::ConstantInt::get(llvm::Type::Int1Ty, 1);
     C[4] = ConstantInt::get(llvm::Type::Int1Ty, 0);
     Builder.CreateCall(CGM.getIntrinsic(Intrinsic::memory_barrier), C, C + 5);
-    return RValue();
+    return RValue::get(0);
   }
       
     // Library functions with special handling.
index 09e3bf03a47143e64c14b33722d886cd054e1df2..66dc702bfee93d16661b421c07c8886e890ad623 100644 (file)
@@ -14,7 +14,7 @@
 
 int atomic(void)
 {
-  // nonsenical test for sync functions
+  // non-sensical test for sync functions
   int old;
   int val = 1;
   char valc = 1;