[PATCH] D46052: GNUstep Objective-C ABI version 2

Dustin L. Howett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 30 15:05:12 PDT 2018


DHowett-MSFT added inline comments.


================
Comment at: lib/CodeGen/CGObjCGNU.cpp:439
+                             ArrayRef<llvm::Constant *> IvarOffsets,
+                             ArrayRef<llvm::Constant *> IvarAlign,
+                             ArrayRef<Qualifiers::ObjCLifetime> IvarOwnership);
----------------
While we're here, is there value in storing the ivar size in layout as well, so that the runtime doesn't need to calculate it from the distance to the next ivar/end of the instance?


================
Comment at: lib/CodeGen/CGObjCGNU.cpp:1402
+    Stop->setVisibility(llvm::GlobalValue::HiddenVisibility);
+    return { Start, Stop };
+  }
----------------
This should be readily expandable for PE/COFF, but we'll need to change some of the section names to fit better. Is it worth abstracting the names of the sections across the target format somehow?

(pe/coff will need to emit COMDAT symbols pointing into lexicographically sortable section names that the linker can fold away)


================
Comment at: lib/CodeGen/CGObjCGNU.cpp:1446
+        /*isConstant*/true, llvm::GlobalValue::LinkOnceAnyLinkage,
+        LoadFunction, ".objc_ctor");
+    // Check that this hasn't been renamed.  This shouldn't happen, because
----------------
Is there a way to ensure that objc_load happens before other static initializers across the entire set of linker inputs?


Repository:
  rC Clang

https://reviews.llvm.org/D46052





More information about the cfe-commits mailing list