mboehme marked an inline comment as done.
mboehme added inline comments.

================
Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:39
+
   /// Builds a ControlFlowContext from an AST node. `D` is the function in 
which
   /// `S` resides. `D.isTemplated()` must be false.
----------------
xazax.hun wrote:
> I was wondering if there is a plan to make the framework work for 
> non-functions, like global initializers. 
I believe there may be? I remember talking to someone who mentioned this -- I 
don't know, it might have been you?

This is, really, the only reason I can see for having an overload that takes a 
separate `Stmt`. It doesn't really make sense (I think) to pass a 
`FunctionDecl` to this overload and then pass some `Stmt` that isn't the 
complete function body. (I can't think of any good scenarios where the control 
flow wouldn't escape that `Stmt`, and I don't see any good use cases anyway.) 
So I've been assuming that this overload is there for global initializers. 
Confusingly, the comment says that `D` should be a function, but notably, `D` 
is a `Decl`, not a `FunctionDecl` -- so I think the comment is wrong here.

Anyway, I'll try and get some more insights into this, but until then, I'll 
certainly keep this overload in place.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151183

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

Reply via email to