From 42902e1a9c9b35805a0bc9dfdacd20b6e0724c63 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Fri, 26 Sep 2025 16:23:21 -0700 Subject: [PATCH] Mark remaining clases final in ObjC bindings. Differential Revision: D83382356 Pull Request resolved: https://github.com/pytorch/executorch/pull/14634 (cherry picked from commit 73dc30b06e6f6ea8e185672a55ee5f211561c0cc) --- extension/apple/ExecuTorch/Exported/ExecuTorchLog.h | 1 + extension/apple/ExecuTorch/Exported/ExecuTorchModule.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/extension/apple/ExecuTorch/Exported/ExecuTorchLog.h b/extension/apple/ExecuTorch/Exported/ExecuTorchLog.h index a71591c7ba7..17d9f339618 100644 --- a/extension/apple/ExecuTorch/Exported/ExecuTorchLog.h +++ b/extension/apple/ExecuTorch/Exported/ExecuTorchLog.h @@ -49,6 +49,7 @@ NS_SWIFT_NAME(LogSink) * A singleton class for managing log sinks and dispatching log messages. */ NS_SWIFT_NAME(Log) +__attribute__((objc_subclassing_restricted)) @interface ExecuTorchLog : NSObject /// The shared singleton log instance. diff --git a/extension/apple/ExecuTorch/Exported/ExecuTorchModule.h b/extension/apple/ExecuTorch/Exported/ExecuTorchModule.h index 9cc1b71249d..cda9a914bc3 100644 --- a/extension/apple/ExecuTorch/Exported/ExecuTorchModule.h +++ b/extension/apple/ExecuTorch/Exported/ExecuTorchModule.h @@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN * and its debug name. */ NS_SWIFT_NAME(TensorMetadata) +__attribute__((objc_subclassing_restricted)) @interface ExecuTorchTensorMetadata : NSObject /** The size of each dimension. */ @@ -46,6 +47,7 @@ NS_SWIFT_NAME(TensorMetadata) * per-tensor metadata, buffer sizes, backends, and instruction count. */ NS_SWIFT_NAME(MethodMetadata) +__attribute__((objc_subclassing_restricted)) @interface ExecuTorchMethodMetadata : NSObject /** The method’s name. */