]> granicus.if.org Git - clang/commitdiff
[OpenMP] Remove dead code in conditional of mappable expressions SEMA.
authorSamuel Antao <sfantao@us.ibm.com>
Mon, 18 Jul 2016 23:22:11 +0000 (23:22 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Mon, 18 Jul 2016 23:22:11 +0000 (23:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275930 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOpenMP.cpp

index 1efdcfc63866e7d405799eaa78f8d23558cf455c..9b8c95c1cb44b06784b5c926c00982c2ae6736f2 100644 (file)
@@ -10574,16 +10574,16 @@ static Expr *CheckMapClauseExpressionBase(
       bool NotUnity =
           CheckArrayExpressionDoesNotReferToUnitySize(SemaRef, CurE, CurType);
 
-      if (AllowWholeSizeArraySection && AllowUnitySizeArraySection) {
-        // Any array section is currently allowed.
+      if (AllowWholeSizeArraySection) {
+        // Any array section is currently allowed. Allowing a whole size array
+        // section implies allowing a unity array section as well.
         //
         // If this array section refers to the whole dimension we can still
         // accept other array sections before this one, except if the base is a
         // pointer. Otherwise, only unitary sections are accepted.
         if (NotWhole || IsPointer)
           AllowWholeSizeArraySection = false;
-      } else if ((AllowUnitySizeArraySection && NotUnity) ||
-                 (AllowWholeSizeArraySection && NotWhole)) {
+      } else if (AllowUnitySizeArraySection && NotUnity) {
         // A unity or whole array section is not allowed and that is not
         // compatible with the properties of the current array section.
         SemaRef.Diag(