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
This commit is contained in:
Nick Lewycky 2010-08-06 07:43:46 +00:00
parent c9dcbed6a3
commit e52e9d6045

View File

@ -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);