[PATCH] D13954: CodeGen: Fix LLVM assertion if Swift and Clang emit Objective-C class reference in same LLVM module

Slava Pestov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 13:00:07 PDT 2015


slavapestov created this revision.
slavapestov added a reviewer: cfe-commits.
slavapestov set the repository for this revision to rL LLVM.

This patch fixes an issue that can come up when Swift and Clang are emitting declarations into the same LLVM module.

Objective-C class literals result in the emission of a global variable named OBJC_CLASS_$_<ClassName>. Clang and Swift emit this variable with different types, resulting in an LLVM assertion firing. This patch changes Clang to be more resilient in the case where the global has already been emitted, wrapping it in a cast constexpr instead of crashing.

Repository:
  rL LLVM

http://reviews.llvm.org/D13954

Files:
  lib/CodeGen/CGObjCGNU.cpp
  lib/CodeGen/CGObjCMac.cpp
  lib/CodeGen/CGObjCRuntime.h
  lib/CodeGen/CodeGenModule.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13954.38036.patch
Type: text/x-patch
Size: 10772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151021/eb262efb/attachment-0001.bin>


More information about the cfe-commits mailing list