[clang] [ObjC] Enable diagnose_if on Objective-C methods (PR #115056)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 25 10:46:41 PST 2024


================
@@ -515,26 +515,94 @@ namespace {
     Call
   };
 
+  /// Either a FunctionDecl or an ObjCMethodDecl. This struct papers over the
+  /// fact that their common ancestors are DeclContext and NamedDecl, which
+  /// does not allow the enumeration of their parameters very easily.
+  class CallableDecl {
----------------
erichkeane wrote:

This type seems unnecessary.  We have some variant-like tagged-union types that would just as easily be usable here. Easiest is probably `llvm::PointerUnion`.

That said, there is interest I thought in representing `callable` at the AST level.  Though, I'm not sure how much lambdas, functions, methods, ObjC Methods, Blocks, etc share that would make this worth-while.

https://github.com/llvm/llvm-project/pull/115056


More information about the cfe-commits mailing list