From 2f3fc6badd9343f0953f493d3dbdb61910f26eab Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 14 May 2014 13:03:55 +0000 Subject: Formatting and style changes; no functional changes intended. llvm-svn: 208774 --- clang/lib/Analysis/ThreadSafety.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'clang/lib/Analysis/ThreadSafety.cpp') diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 078d3ff13f6..752e5130bfa 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -1643,23 +1643,22 @@ void ThreadSafetyAnalyzer::getMutexIDs(MutexIDList &Mtxs, AttrType *Attr, const CFGBlock *CurrBlock, Expr *BrE, bool Neg) { // Find out which branch has the lock - bool branch = 0; - if (CXXBoolLiteralExpr *BLE = dyn_cast_or_null(BrE)) { + bool branch = false; + if (CXXBoolLiteralExpr *BLE = dyn_cast_or_null(BrE)) branch = BLE->getValue(); - } - else if (IntegerLiteral *ILE = dyn_cast_or_null(BrE)) { + else if (IntegerLiteral *ILE = dyn_cast_or_null(BrE)) branch = ILE->getValue().getBoolValue(); - } + int branchnum = branch ? 0 : 1; - if (Neg) branchnum = !branchnum; + if (Neg) + branchnum = !branchnum; // If we've taken the trylock branch, then add the lock int i = 0; for (CFGBlock::const_succ_iterator SI = PredBlock->succ_begin(), SE = PredBlock->succ_end(); SI != SE && i < 2; ++SI, ++i) { - if (*SI == CurrBlock && i == branchnum) { + if (*SI == CurrBlock && i == branchnum) getMutexIDs(Mtxs, Attr, Exp, D); - } } } -- cgit v1.2.3