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

2015-10-24 Thread Slava Pestov via cfe-commits
slavapestov added a subscriber: slavapestov. slavapestov added a comment. Unfortunately the asm label attribute doesn’t seem to work in this case, at least on Darwin. I get two symbols in the IR, with the asm label having the \01 prefix from MangleContext::mangleName():

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

2015-10-24 Thread Slava Pestov via cfe-commits
Unfortunately the asm label attribute doesn’t seem to work in this case, at least on Darwin. I get two symbols in the IR, with the asm label having the \01 prefix from MangleContext::mangleName(): @"\01OBJC_CLASS_$_NSNumber" = common global %struct.art_class* null, align 8

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

2015-10-21 Thread Slava Pestov via cfe-commits
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

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

2015-10-21 Thread John McCall via cfe-commits
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