diff options
| author | Steve Naroff <snaroff@apple.com> | 2007-10-30 23:14:51 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2007-10-30 23:14:51 +0000 |
| commit | 5cdcd9b61c8da8f5c543c1073b036bf0991fc161 (patch) | |
| tree | 7b46a25d3fcd342017b2b332d16ed389c9849b51 /clang/Lex/Preprocessor.cpp | |
| parent | 17833d706894e2fe8c0d7ae55ae413225e8a18e6 (diff) | |
| download | bcm5719-llvm-5cdcd9b61c8da8f5c543c1073b036bf0991fc161.tar.gz bcm5719-llvm-5cdcd9b61c8da8f5c543c1073b036bf0991fc161.zip | |
Stop pre-defining objc_msgSend/objc_getClass in the preprocessor. Instead, I generate these declaration on the fly when rewriting a message expression.
llvm-svn: 43529
Diffstat (limited to 'clang/Lex/Preprocessor.cpp')
| -rw-r--r-- | clang/Lex/Preprocessor.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp index 40abfe5cfc3..784fb19e498 100644 --- a/clang/Lex/Preprocessor.cpp +++ b/clang/Lex/Preprocessor.cpp @@ -369,15 +369,14 @@ static void InitializePredefinedMacros(Preprocessor &PP, DefineBuiltinMacro(Buf, "__OBJC__=1"); if (PP.getLangOptions().ObjC2) DefineBuiltinMacro(Buf, "__OBJC2__=1"); - if (PP.getLangOptions().ObjC1) { + const char *ObjcType; // Predefine all the ObjC goodies (traditionally declared in <objc/objc.h>). // We define the following header guard for source compatibility. It has // the effect of ignoring any explicit inclusion of <objc/objc.h>:-) DefineBuiltinMacro(Buf, "_OBJC_OBJC_H_=1"); DefineBuiltinMacro(Buf, "OBJC_EXPORT=extern"); DefineBuiltinMacro(Buf, "OBJC_IMPORT=extern"); - const char *ObjcType; ObjcType = "typedef struct objc_class *Class;\n"; Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); ObjcType = "typedef struct objc_object { Class isa; } *id;\n"; @@ -396,19 +395,6 @@ static void InitializePredefinedMacros(Preprocessor &PP, Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); ObjcType = "extern 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. FIXME: don't predefine these... - ObjcType = "extern id objc_getClass(const char *name);\n"; - Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); - ObjcType = "extern id objc_getMetaClass(const char *name);\n"; - Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); - ObjcType = "extern id objc_msgSend(id self, SEL op, ...);\n"; - Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); - ObjcType = "extern id objc_msgSendSuper(struct objc_super *super, SEL op, ...);\n"; - Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType)); } // Add __builtin_va_list typedef. |

