aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a comment.

Thank you for working on this -- I think it's a good cleanup and feature-add! I 
have a few minor comments, but generally LGTM. You should wait for an okay from 
Richard, however.


================
Comment at: lib/Analysis/CFG.cpp:54
@@ +53,3 @@
+    auto *DR = dyn_cast<DeclRefExpr>(E->IgnoreParenImpCasts());
+    if (DR == nullptr)
+      return nullptr;
----------------
Please don't compare a pointer against nullptr with an equality operator. This 
can be simplified into:

```
if (const auto *DR = dyn_cast<>)
  return isa<> ? "
return nullptr;
```

================
Comment at: lib/Analysis/CFG.cpp:97
@@ +96,3 @@
+  // Currently we're only given EnumConstantDecls or IntegerLiterals
+  auto *C1 = cast<EnumConstantDecl>(cast<DeclRefExpr>(A)->getDecl());
+  auto *C2 = cast<EnumConstantDecl>(cast<DeclRefExpr>(B)->getDecl());
----------------
Are you sure that A and B will only ever be DeclRefExprs? You dyn_cast 
elsewhere.


http://reviews.llvm.org/D13157



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

Reply via email to