[PATCH] D50144: Add Windows support for the GNUstep Objective-C ABI V2.

David Chisnall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 6 05:18:32 PDT 2018


theraven added inline comments.


================
Comment at: include/clang/Driver/Options.td:1491
 // Objective-C ABI options.
-def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>, Flags<[CC1Option]>,
+def fobjc_runtime_EQ : Joined<["-"], "fobjc-runtime=">, Group<f_Group>, Flags<[CC1Option, CoreOption]>,
   HelpText<"Specify the target Objective-C runtime kind and version">;
----------------
DHowett-MSFT wrote:
> Is this so it's exposed to clang-cl?
Yup.  Unfortunately, the normal work around of passing the argument with `-Xclang` (so `-Xclang -fobjc-runtime=gnustep-2.0`) doesn't work because the driver makes various other decisions about what flags to pass to the front end based on the Objective-C runtime and makes all of those assuming `-fobjc-runtime=gcc`.  It is not possible to compile ARC code without this.


================
Comment at: lib/CodeGen/CGBlocks.cpp:1262
+  if (IsWindows) {
+    auto *Init = llvm::Function::Create(llvm::FunctionType::get(CGM.VoidTy,
+          {}), llvm::GlobalValue::InternalLinkage, ".block_isa_init",
----------------
DHowett-MSFT wrote:
> Is there value in emitting a list of blocks that need to be initialized, then initializing them in one go in a COMDAT-foldable function?
I think that the best solution is to move this into the back end, so that this code goes away in the front end, but anything that's referring to a dllimport global in a global initialiser is transformed in the back end to a list of initialisations and a comdat function that walks the list and sets them up.  That said, this seems sufficiently generally useful that it would be nice for the function to be in the CRT bits.  


I should be in Redmond some time in October, so maybe we can discuss it with some of the VS team then?


Repository:
  rC Clang

https://reviews.llvm.org/D50144





More information about the cfe-commits mailing list