tra added inline comments.

================
Comment at: clang/include/clang/Sema/Sema.h:10407-10409
   bool IsAllowedCUDACall(const FunctionDecl *Caller,
                          const FunctionDecl *Callee) {
+    if (llvm::any_of(ExprEvalContexts,
----------------
One more thing. The idea of this function is that we're checking if the 
`Caller` is allowed to call the `Callee`.
However here, you're checking the current context, which may not necessarily be 
the same as the caller's. I.e. someone could potentially call it way after the 
context is gone.

Currently all uses of this function obtain the caller from `CurContext`, but if 
we start relying on other properties of the current context other than the 
caller function, then we may neet to pass the context explicitly, or only pass 
the Callee and check if it's callable from the current context.

```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61458



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

Reply via email to