[cfe-commits] r113414 - in /cfe/trunk: include/clang/AST/Type.h lib/AST/Type.cpp lib/Sema/SemaType.cpp test/SemaObjCXX/legacy-objc-types.mm
Fariborz Jahanian
fjahanian at apple.com
Wed Sep 8 14:36:35 PDT 2010
Author: fjahanian
Date: Wed Sep 8 16:36:35 2010
New Revision: 113414
URL: http://llvm.org/viewvc/llvm-project?rev=113414&view=rev
Log:
Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.
Modified:
cfe/trunk/include/clang/AST/Type.h
cfe/trunk/lib/AST/Type.cpp
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=113414&r1=113413&r2=113414&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Wed Sep 8 16:36:35 2010
@@ -932,9 +932,7 @@
bool isObjCQualifiedClassType() const; // Class<foo>
bool isObjCObjectOrInterfaceType() const;
bool isObjCIdType() const; // id
- bool isLegacyObjCIdType(ASTContext &) const; // struct_object *
bool isObjCClassType() const; // Class
- bool isLegacyObjCClassType(ASTContext &) const; // struct_class *
bool isObjCSelType() const; // Class
bool isObjCBuiltinType() const; // 'id' or 'Class'
bool isTemplateTypeParmType() const; // C++ template type parameter
Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113414&r1=113413&r2=113414&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Wed Sep 8 16:36:35 2010
@@ -470,24 +470,6 @@
return false;
}
-bool Type::isLegacyObjCIdType(ASTContext &Ctx) const {
- if (const PointerType *PTTo = getAs<PointerType>()) {
- QualType PointeeTy = PTTo->getPointeeType();
- if (const RecordType *RTy = PointeeTy->getAs<RecordType>())
- return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_object");
- }
- return false;
-}
-
-bool Type::isLegacyObjCClassType(ASTContext &Ctx) const {
- if (const PointerType *PTTo = getAs<PointerType>()) {
- QualType PointeeTy = PTTo->getPointeeType();
- if (const RecordType *RTy = PointeeTy->getAs<RecordType>())
- return RTy->getDecl()->getIdentifier() == &Ctx.Idents.get("objc_class");
- }
- return false;
-}
-
bool Type::isEnumeralType() const {
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->isEnum();
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=113414&r1=113413&r2=113414&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Wed Sep 8 16:36:35 2010
@@ -1274,12 +1274,8 @@
if (BTy->getKind() == BuiltinType::Float)
ArgTy = Context.DoubleTy;
}
- } else if (getLangOptions().ObjC1) {
- if (ArgTy->isLegacyObjCIdType(Context))
- ArgTy = Context.getObjCIdType();
- else if (ArgTy->isLegacyObjCClassType(Context))
- ArgTy = Context.getObjCClassType();
}
+
ArgTys.push_back(ArgTy);
}
Modified: cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm?rev=113414&r1=113413&r2=113414&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm (original)
+++ cfe/trunk/test/SemaObjCXX/legacy-objc-types.mm Wed Sep 8 16:36:35 2010
@@ -1,20 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// rdar:// 8400356
-
-struct objc_object;
-
-void f(id ptr) { } // expected-note {{previous definition is here}}
-void f(objc_object* ptr) { } // expected-error {{redefinition of 'f'}}
-
-struct objc_class;
-
-void g(Class ptr) {} // expected-note {{previous definition is here}}
-void g(objc_class* ptr) { } // expected-error {{redefinition of 'g'}}
-
-void h(Class ptr, objc_object* ptr1) {} // expected-note {{previous definition is here}}
-void h(objc_class* ptr, id ptr1) {} // expected-error {{redefinition of 'h'}}
-
-void i(Class ptr, objc_object* ptr1);
-void i(objc_class* ptr, id ptr1) {}
-void i(objc_class* ptr, objc_object* ptr1);
-
More information about the cfe-commits
mailing list