[clang] Set dllimport on Objective C ivar offsets (PR #107604)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 09:18:39 PDT 2024


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 62fec3d23d2325869e6eba0263b0b9f834c2067f 83511b91e37a9191fcde289b1f302c79e8533b6f --extensions cpp -- clang/lib/CodeGen/CGObjCGNU.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index c78a3ab983..6280e9465e 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1698,15 +1698,17 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
   }
   llvm::Value *EmitIvarOffset(CodeGenFunction &CGF,
                               const ObjCInterfaceDecl *Interface,
-                              const ObjCIvarDecl *Ivar) override {                            
-    const ObjCInterfaceDecl *ContainingInterface = Ivar->getContainingInterface();
-    const std::string Name = GetIVarOffsetVariableName(ContainingInterface, Ivar);
+                              const ObjCIvarDecl *Ivar) override {
+    const ObjCInterfaceDecl *ContainingInterface =
+        Ivar->getContainingInterface();
+    const std::string Name =
+        GetIVarOffsetVariableName(ContainingInterface, Ivar);
     llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name);
     if (!IvarOffsetPointer) {
       IvarOffsetPointer = new llvm::GlobalVariable(TheModule, IntTy, false,
               llvm::GlobalValue::ExternalLinkage, nullptr, Name);
-      if (Ivar->getAccessControl() != ObjCIvarDecl::Private
-         && Ivar->getAccessControl() != ObjCIvarDecl::Package)
+      if (Ivar->getAccessControl() != ObjCIvarDecl::Private &&
+          Ivar->getAccessControl() != ObjCIvarDecl::Package)
         CGM.setGVProperties(IvarOffsetPointer, ContainingInterface);
     }
     CharUnits Align = CGM.getIntAlign();

``````````

</details>


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


More information about the cfe-commits mailing list