[clang] [ObjCDirectPreconditionThunk] Adding a flag to with objc_direct symbols' prefix (PR #170616)

Kyungwoo Lee via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 16 01:02:33 PST 2025


================
@@ -717,6 +717,32 @@ class CodeGenModule : public CodeGenTypeCache {
   /// Return true iff an Objective-C runtime has been configured.
   bool hasObjCRuntime() { return !!ObjCRuntime; }
 
+  /// Check if a direct method should use precondition thunks (exposed symbols).
+  /// This applies to ALL direct methods (including variadic).
+  /// Returns false if OMD is null or not a direct method.
+  bool usePreconditionThunk(const ObjCMethodDecl *OMD) const {
+    return OMD && OMD->isDirectMethod() &&
+           getLangOpts().ObjCRuntime.isNeXTFamily() &&
----------------
kyulee-com wrote:

Is there a technical reason to restrict this to Apple platforms, or is it just for initial deployment safety? In either case, could you please add a comment?

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


More information about the cfe-commits mailing list