[cfe-commits] r72504 - in /cfe/trunk: lib/CodeGen/CGBuiltin.cpp test/CodeGen/atomic.c
Daniel Dunbar
daniel at zuster.org
Wed May 27 16:45:34 PDT 2009
Author: ddunbar
Date: Wed May 27 18:45:33 2009
New Revision: 72504
URL: http://llvm.org/viewvc/llvm-project?rev=72504&view=rev
Log:
Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/atomic.c
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=72504&r1=72503&r2=72504&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed May 27 18:45:33 2009
@@ -475,7 +475,7 @@
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 @@
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.
Modified: cfe/trunk/test/CodeGen/atomic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/atomic.c?rev=72504&r1=72503&r2=72504&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/atomic.c (original)
+++ cfe/trunk/test/CodeGen/atomic.c Wed May 27 18:45:33 2009
@@ -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;
More information about the cfe-commits
mailing list