Refactor: Simplify boolean conditional return statements in lib/Transforms/Instrument...
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 26 Oct 2015 18:06:40 +0000 (18:06 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 26 Oct 2015 18:06:40 +0000 (18:06 +0000)
Summary: Use clang-tidy to simplify boolean conditional return statements.

Differential Revision: http://reviews.llvm.org/D9996

Patch by Richard (legalize@xmission.com)!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251318 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 5af94ec4bc0a5e66b6399a6d3b806d9f76b3632c..538cc850295a78bb44802a22babe7361f7115309 100644 (file)
@@ -908,10 +908,8 @@ static bool isInterestingPointerComparisonOrSubtraction(Instruction *I) {
   } else {
     return false;
   }
-  if (!isPointerOperand(I->getOperand(0)) ||
-      !isPointerOperand(I->getOperand(1)))
-    return false;
-  return true;
+  return isPointerOperand(I->getOperand(0)) &&
+         isPointerOperand(I->getOperand(1));
 }
 
 bool AddressSanitizer::GlobalIsLinkerInitialized(GlobalVariable *G) {