[clang] [ExposeObjCDirect] Adding a flag to expose symbols with objc_direct (PR #170616)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 9 12:36:39 PST 2025


================
@@ -4096,6 +4096,10 @@ static void RenderObjCOptions(const ToolChain &TC, const Driver &D,
     }
   }
 
+  // Forward -fobjc-expose-direct-methods to cc1
+  if (Args.hasArg(options::OPT_fobjc_expose_direct_methods))
----------------
tarunprabhu wrote:

If you use `hasArg` here, would it return true in the following case?

```
clang -fobjc-expose-direct-methods -fno-objc-expose-direct-methods
```

If so, is this the expected behavior?

Please add a test that checks that the `f(no)-objc-expose-direct-method options add the correct options to the `cc1` command line.

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


More information about the cfe-commits mailing list