aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LowerAtomic.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-08-06 07:43:46 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-08-06 07:43:46 +0000
commite52e9d60456073dddd691ae94c09b790f4bc26d5 (patch)
tree97302147568d120ea1e6df031f733fc435719392 /lib/Transforms/Scalar/LowerAtomic.cpp
parentc9dcbed6a39f3aa2562de070bb15670d81c38650 (diff)
Fix uninitialized variable warning.
Also move 'default' case next to a real case to help compiler optimize in non-Debug builds. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LowerAtomic.cpp')
-rw-r--r--lib/Transforms/Scalar/LowerAtomic.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LowerAtomic.cpp b/lib/Transforms/Scalar/LowerAtomic.cpp
index 11f52570e1..6184da20af 100644
--- a/lib/Transforms/Scalar/LowerAtomic.cpp
+++ b/lib/Transforms/Scalar/LowerAtomic.cpp
@@ -52,8 +52,9 @@ bool LowerAtomicIntrinsic(CallInst *CI) {
Value *Delta = CI->getArgOperand(1);
LoadInst *Orig = Builder.CreateLoad(Ptr);
- Value *Res;
+ Value *Res = NULL;
switch (IID) {
+ default: assert(0 && "Unrecognized atomic modify operation");
case Intrinsic::atomic_load_add:
Res = Builder.CreateAdd(Orig, Delta);
break;
@@ -92,7 +93,6 @@ bool LowerAtomicIntrinsic(CallInst *CI) {
Orig,
Delta);
break;
- default: assert(0 && "Unrecognized atomic modify operation");
}
Builder.CreateStore(Res, Ptr);