aboutsummaryrefslogtreecommitdiff
path: root/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-10-31 18:42:27 +0000
committerSteve Naroff <snaroff@apple.com>2007-10-31 18:42:27 +0000
commit8ee529b5671295ea38c249df8b9d3766c905cfa7 (patch)
tree5fbf4dff3848036ed6296b252b87a80c19c5b30b /Lex/Preprocessor.cpp
parente522d85ffcf500681eeca93671b82f565d993300 (diff)
Implement a more sensible strategy for ObjC built-in types (addressing a long standing FIXME in Sema::GetObjcIdType()).
This removes several gross hacks to work around the previous "lazy" behavior. Two notes: - MinimalActions still needs to be taught about the built-in types (This breaks one of the -noop test cases). I started this, then added a FIXME. - I didn't convert Sema::GetObjcProtoType() yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r--Lex/Preprocessor.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index c1f4970f30..0d3ac521d0 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -369,33 +369,7 @@ 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");
- ObjcType = "typedef struct objc_class *Class;\n";
- Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
- ObjcType = "typedef struct objc_object { Class isa; } *id;\n";
- Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
- ObjcType = "typedef struct objc_selector *SEL;\n";
- Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
- ObjcType = "typedef id (*IMP)(id, SEL, ...);\n";
- Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
- ObjcType = "typedef signed char BOOL;\n";
- Buf.insert(Buf.end(), ObjcType, ObjcType+strlen(ObjcType));
- DefineBuiltinMacro(Buf, "YES=(BOOL)1");
- DefineBuiltinMacro(Buf, "NO=(BOOL)0");
- DefineBuiltinMacro(Buf, "Nil=0");
- DefineBuiltinMacro(Buf, "nil=0");
- ObjcType = "extern const char *sel_getName(SEL sel);\n";
- 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));
- }
+
// Add __builtin_va_list typedef.
{
const char *VAList = PP.getTargetInfo().getVAListDeclaration();