diff options
author | Anders Carlsson <andersca@mac.com> | 2007-10-31 02:53:19 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2007-10-31 02:53:19 +0000 |
commit | 8baaca50f07d0c10bba69c8d88c1b9078c92d06d (patch) | |
tree | cb6a289add9d8d9e1d53faa13d1125d6fbad17e7 /include/clang | |
parent | 8967e9e6c30b61fa9399dd38d6e383651ddbc54d (diff) |
Encode Class, SEL and Objective-C objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 16 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticKinds.def | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index dda0490f24..043ffb30c9 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -59,6 +59,10 @@ class ASTContext { /// ObjcProtoType - another psuedo built-in typedef type (set by Sema). QualType ObjcProtoType; const RecordType *ProtoStructType; + + /// ObjcClassType - another psuedo built-in typedef type (set by Sema). + QualType ObjcClassType; + const RecordType *ClassStructType; QualType ObjcConstantStringType; RecordDecl *CFConstantStringTypeDecl; @@ -196,6 +200,9 @@ public: void setObjcProtoType(TypedefDecl *Decl); QualType getObjcProtoType() const { return ObjcProtoType; } + void setObjcClassType(TypedefDecl *Decl); + QualType getObjcClassType() const { return ObjcClassType; } + void setBuiltinVaListType(QualType T); QualType getBuiltinVaListType() const { return BuiltinVaListType; } @@ -264,6 +271,15 @@ public: assert(IdStructType && "isObjcIdType used before 'id' type is built"); return T->getAsStructureType() == IdStructType; } + bool isObjcClassType(QualType T) const { + assert(ClassStructType && "isObjcClassType used before 'Class' type is built"); + return T->getAsStructureType() == ClassStructType; + } + bool isObjcSelType(QualType T) const { + assert(SelStructType && "isObjcSelType used before 'SEL' type is built"); + return T->getAsStructureType() == SelStructType; + } + private: ASTContext(const ASTContext&); // DO NOT IMPLEMENT void operator=(const ASTContext&); // DO NOT IMPLEMENT diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def index bbdb6bc517..8a65b7310e 100644 --- a/include/clang/Basic/DiagnosticKinds.def +++ b/include/clang/Basic/DiagnosticKinds.def @@ -450,6 +450,8 @@ DIAG(err_missing_id_definition, ERROR, "cannot find definition of 'id'") DIAG(err_missing_proto_definition, ERROR, "cannot find definition of 'Protocol'") +DIAG(err_missing_class_definition, ERROR, + "cannot find definition of 'Class'") DIAG(warn_previous_alias_decl, WARNING, "previously declared alias is ignored") DIAG(warn_previous_declaration, WARNING, |