- Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index c1f14a9..6380544 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -392,6 +392,23 @@
DefineBuiltinMacro(Buf, "NO=(BOOL)0");
DefineBuiltinMacro(Buf, "Nil=0");
DefineBuiltinMacro(Buf, "nil=0");
+ ObjcType = "OBJC_EXPORT const char *sel_getName(SEL sel);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
+ ObjcType = "OBJC_EXPORT SEL sel_getUid(const char *str);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
+
+ // Predefine ObjC primitive functions, traditionally declared in
+ // <objc/objc-runtime.h>. Unlike the declarations above, we don't protect
+ // these with a header guard (since multiple identical function declarations
+ // don't result in an error.
+ ObjcType = "OBJC_EXPORT id objc_getClass(const char *name);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
+ ObjcType = "OBJC_EXPORT id objc_getMetaClass(const char *name);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
+ ObjcType = "OBJC_EXPORT id objc_msgSend(id self, SEL op, ...);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
+ ObjcType = "OBJC_EXPORT id objc_msgSendSuper(struct objc_super *super, SEL op, ...);\n";
+ Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
}
// Add __builtin_va_list typedef.