[PATCH] D19829: [scan-build] fix dead store warnings emitted on clang code base

Richard Trieu via cfe-commits cfe-commits at lists.llvm.org
Thu May 5 15:14:09 PDT 2016


rtrieu added inline comments.

================
Comment at: lib/Sema/SemaExpr.cpp:9629
@@ -9628,3 +9628,3 @@
   // Track if the current expression is the result of a derefence, and if the
   // next checked expression is the result of a derefence.
   bool IsDereference = false;
----------------
Add comment that these variables are only updated when processing MemberExpr's in the while loop.

================
Comment at: lib/Sema/SemaExpr.cpp:9635-9637
@@ -9634,4 +9634,5 @@
   while (true) {
     IsDereference = NextIsDereference;
     NextIsDereference = false;
+    (void) NextIsDereference;
 
----------------
Remove these lines.

================
Comment at: lib/Sema/SemaExpr.cpp:9641
@@ -9639,3 +9640,3 @@
     if (const MemberExpr *ME = dyn_cast<MemberExpr>(E)) {
       NextIsDereference = ME->isArrow();
       const ValueDecl *VD = ME->getMemberDecl();
----------------
Add "IsDereference = NextIsDereference;" before this line.


http://reviews.llvm.org/D19829





More information about the cfe-commits mailing list