Closed
Description
After commit 2b4fa53, clang has started emitting unexpected __cxa_guard_acquire
and __cxa_guard_release
checks for static variables in functions in Objective-C code. This breaks a lot of downstream Objective-C code that doesn't have any C++ and doesn't link with libc++/libc++abi.
Patch to partially revert 2b4fa53:
https://reviews.llvm.org/D72411
Test case:
// RUN: %clang_cc1 -triple x86_64-apple-macos10.15 -emit-llvm -fobjc-arc -o - %s | FileCheck %s
@interface I
@end
I *i() {
static I *i = ((void *)0);
return i;
}