NoQ added inline comments.

================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:236
+  using UseSetTy = SmallSet<const DeclRefExpr *, 16>;
+  using DefMapTy = DenseMap<const VarDecl *, const DeclStmt *>;
+
----------------
This extra payload wasn't advertised but it's very useful because it's hard to 
jump from `VarDecl` to `DeclStmt` without it, and we need to do such jump 
because our analysis starts from unsafe *uses* of a variable, which only give 
us a `VarDecl`.


================
Comment at: clang/lib/Analysis/UnsafeBufferUsage.cpp:447-451
+      // FIXME: This isn't sufficient (or even correct) when a gadget has
+      // already produced a fixit for a different variable i.e. it was 
mentioned
+      // in the map twice (or more). In such case the correct thing to do is
+      // to undo the previous fix first, and then if we can't produce the new
+      // fix for both variables, revert to the old one.
----------------
We're safe for now because none of the currently implemented `Gadget` classes 
"claim" more than one `DeclRefExpr`. We need to address this FIXME before we 
implement such gadgets.


Repository:
  rC Clang

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

https://reviews.llvm.org/D138253

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

Reply via email to