aaron.ballman added inline comments.

================
Comment at: clang/include/clang/AST/Stmt.h:1259-1260
+  // This gets the index of the last Stmt before the trailing NullStmts. If
+  // this compound expression contains nothing but NullStmts, then we return
+  // the index of the last one. If the compound statement is empty, return
+  // None.
----------------
Given the name of the function, why return the index of the last null statement 
if it only contains null statements? 


================
Comment at: clang/include/clang/AST/Stmt.h:1270
+    }
+    return size() - 1;
+  }
----------------
The only way you can get here is if all statements are null statements, so this 
should return `None` as well, shouldn't it?


================
Comment at: clang/include/clang/AST/Stmt.h:1315-1316
+    Optional<unsigned> ExprResult = getIndexOfLastNonNullStmt();
+    return ExprResult.hasValue() ? body_begin()[ExprResult.getValue()]
+                                 : nullptr;
   }
----------------
`return ExprResult ? body_begin()[*ExprResult] : nullptr;`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57086/new/

https://reviews.llvm.org/D57086



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to