r308783 - Inline variable into assert to fix unused warning.

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 21 14:29:35 PDT 2017


Author: rtrieu
Date: Fri Jul 21 14:29:35 2017
New Revision: 308783

URL: http://llvm.org/viewvc/llvm-project?rev=308783&view=rev
Log:
Inline variable into assert to fix unused warning.

Modified:
    cfe/trunk/lib/Sema/SemaOpenMP.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=308783&r1=308782&r2=308783&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Fri Jul 21 14:29:35 2017
@@ -745,9 +745,8 @@ void DSAStackTy::addReductionData(ValueD
                                   BinaryOperatorKind BOK) {
   D = getCanonicalDecl(D);
   assert(!isStackEmpty() && "Data-sharing attributes stack is empty");
-  auto &Data = Stack.back().first.back().SharingMap[D];
   assert(
-      Data.Attributes == OMPC_reduction &&
+      Stack.back().first.back().SharingMap[D].Attributes == OMPC_reduction &&
       "Additional reduction info may be specified only for reduction items.");
   auto &ReductionData = Stack.back().first.back().ReductionMap[D];
   assert(ReductionData.ReductionRange.isInvalid() &&
@@ -760,9 +759,8 @@ void DSAStackTy::addReductionData(ValueD
                                   const Expr *ReductionRef) {
   D = getCanonicalDecl(D);
   assert(!isStackEmpty() && "Data-sharing attributes stack is empty");
-  auto &Data = Stack.back().first.back().SharingMap[D];
   assert(
-      Data.Attributes == OMPC_reduction &&
+      Stack.back().first.back().SharingMap[D].Attributes == OMPC_reduction &&
       "Additional reduction info may be specified only for reduction items.");
   auto &ReductionData = Stack.back().first.back().ReductionMap[D];
   assert(ReductionData.ReductionRange.isInvalid() &&




More information about the cfe-commits mailing list