[PATCH] D58724: [gnustep-objc] Make the GNUstep v2 ABI work for Windows DLLs.

Dustin L. Howett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 28 23:54:21 PST 2019

DHowett-MSFT added inline comments.

Comment at: clang/lib/CodeGen/CGObjCGNU.cpp:1231
+            break;
+        auto Storage = llvm::GlobalValue::DefaultStorageClass;
After we get the `ObjCInterfaceDecl`, we have to make sure it's the one corresponding to the `@interface` and not one for a forward declaration (`@class`).

+        // The first Interface we find may be a @class,
+        // which should only be treated as the source of
+        // truth in the absence of a true declaration.
+        const ObjCInterfaceDecl *OIDDef = OID->getDefinition();
+        if (OIDDef != nullptr)
+          OID = OIDDef;

Failure to do so can result in us either failing to import the `CLASS_REF` or, if it has been exported as `CONSTANT`, attempt a method dispatch against a pointer to our own import table.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list