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

John McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 21 13:18:18 PDT 2015


rjmccall added a comment.

It just occurred to me that there is a way to test this in Clang with the asm-label extension:

  int Foo_class asm("OBJC_CLASS_$_Foo");

Of course, you'll have to actually use it from somewhere, or define it, in order for it to actually show up in the IR and cause a conflict.

You should probably also test that we do something sane if the caller is making a definition but one already exists.  An error counts as "sane"; just make sure you return a GlobalVariable of the right type.  There's model code for this in GetOrCreateLLVMFunction, although it's okay for the diagnostic here to be worse than that one.


Repository:
  rL LLVM

http://reviews.llvm.org/D13954





More information about the cfe-commits mailing list