RewriteObjC::Initialize(): add function decls used by @synchronized.
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
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index 535cc0b..48cb9df 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -337,6 +337,9 @@
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";