aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-27 23:45:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-27 23:45:33 +0000
commiteb4f81e174b11633f7b85f555ea5d2834d6dae8a (patch)
tree6ee0eb9c47fa66d2d3de7bb24cb63ee2a4051484
parent1f65cd9291d580d4f57df5f850d19805e37c5b62 (diff)
Fix a use-of-undefined, IRgen expects the RValue for "void" to be a scalar RValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72504 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGBuiltin.cpp4
-rw-r--r--test/CodeGen/atomic.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index a73be2c60e..a90b30404b 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -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.
diff --git a/test/CodeGen/atomic.c b/test/CodeGen/atomic.c
index 09e3bf03a4..66dc702bfe 100644
--- a/test/CodeGen/atomic.c
+++ b/test/CodeGen/atomic.c
@@ -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;