[clang] [WIP][ObjC] objc_direct method visibility ABI (PR #76608)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 29 23:45:10 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff fe2e677aa7aebedd316b1a688db8410855a213c1 5e69de7ad9b67280db6d62a1c77362d37c343f47 -- clang/include/clang/AST/DeclObjC.h clang/lib/AST/Mangle.cpp clang/lib/CodeGen/CGObjC.cpp clang/lib/CodeGen/CGObjCRuntime.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h
index 9a12b4007f..4081e5915c 100644
--- a/clang/include/clang/AST/DeclObjC.h
+++ b/clang/include/clang/AST/DeclObjC.h
@@ -492,8 +492,8 @@ public:
   /// visibility behavior as an opt-in only.
   bool hasMethodVisibilityDefault() const {
     return isDirectMethod() &&
-      getExplicitVisibility(VisibilityForValue)
-      .value_or(HiddenVisibility) == DefaultVisibility;
+           getExplicitVisibility(VisibilityForValue)
+                   .value_or(HiddenVisibility) == DefaultVisibility;
   }
 
   /// True if the method has a parameter that's destroyed in the callee.
diff --git a/clang/lib/CodeGen/CGObjCRuntime.cpp b/clang/lib/CodeGen/CGObjCRuntime.cpp
index 1841c8ed23..6361f2a786 100644
--- a/clang/lib/CodeGen/CGObjCRuntime.cpp
+++ b/clang/lib/CodeGen/CGObjCRuntime.cpp
@@ -470,9 +470,9 @@ std::string CGObjCRuntime::getSymbolNameForMethod(const ObjCMethodDecl *OMD,
                                                   bool includeCategoryName) {
   std::string buffer;
   llvm::raw_string_ostream out(buffer);
-  CGM.getCXXABI().getMangleContext().mangleObjCMethodName(OMD, out,
-                                       /*includePrefixByte=*/
-                                       !OMD->hasMethodVisibilityDefault(),
-                                       includeCategoryName);
+  CGM.getCXXABI().getMangleContext().mangleObjCMethodName(
+      OMD, out,
+      /*includePrefixByte=*/
+      !OMD->hasMethodVisibilityDefault(), includeCategoryName);
   return buffer;
 }

``````````

</details>


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


More information about the cfe-commits mailing list