]> granicus.if.org Git - clang/commitdiff
RewriteObjC::Initialize(): add function decls used by @synchronized.
authorSteve Naroff <snaroff@apple.com>
Wed, 16 Jul 2008 18:58:11 +0000 (18:58 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 16 Jul 2008 18:58:11 +0000 (18:58 +0000)
This fixes <rdar://problem/6040143> clang ObjC rewriter: @synchronized keyword inserts undeclared objc functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53695 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index 535cc0be3dcc8ea706edbd33556630467449b0f2..48cb9df07406eb7cef8e11f30b4d4b95a1d2f9d2 100644 (file)
@@ -337,6 +337,9 @@ void RewriteObjC::Initialize(ASTContext &context) {
   Preamble += "__OBJC_RW_EXTERN struct objc_object *objc_exception_extract(void *);\n";
   Preamble += "__OBJC_RW_EXTERN int objc_exception_match";
   Preamble += "(struct objc_class *, struct objc_object *);\n";
+  // @synchronized hooks.
+  Preamble += "__OBJC_RW_EXTERN void objc_sync_enter(struct objc_object *);\n";
+  Preamble += "__OBJC_RW_EXTERN void objc_sync_exit(struct objc_object *);\n";
   Preamble += "__OBJC_RW_EXTERN Protocol *objc_getProtocol(const char *);\n";
   Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
   Preamble += "struct __objcFastEnumerationState {\n\t";