Fix warning about || and && without explicit grouping.
authorChandler Carruth <chandlerc@gmail.com>
Thu, 26 May 2011 23:37:58 +0000 (23:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 26 May 2011 23:37:58 +0000 (23:37 +0000)
This looks like it flagged an actual bug. Devang, please review. I added
the parentheses that change behavior, but make the behavior more closely
match commit log's intent.

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

lib/Transforms/Scalar/CodeGenPrepare.cpp

index dbf0e08607c3bdf7bd030818c48b10d52e1dc8ba..eb33fe23e85c169b0509046d6de1afb53b2a44af 100644 (file)
@@ -554,8 +554,8 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
   // find a node corresponding to the value.
   if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(CI))
     if (Instruction *VI = dyn_cast_or_null<Instruction>(DVI->getValue()))
-      if (!VI->isTerminator() && 
-          DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
+      if (!VI->isTerminator() &&
+          (DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI))) {
         DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
         DVI->removeFromParent();
         if (isa<PHINode>(VI))