diff options
| author | Steve Naroff <snaroff@apple.com> | 2009-07-18 15:33:26 +0000 |
|---|---|---|
| committer | Steve Naroff <snaroff@apple.com> | 2009-07-18 15:33:26 +0000 |
| commit | c277ad10f0bdc6d1710607dce25e10ebb855c31d (patch) | |
| tree | 4501ceba4a97724f3be04a5b1fb7f95444773c60 /clang/lib/Frontend | |
| parent | c88ab62c870f76f6fea1e1edf6b9bc29295a3953 (diff) | |
| download | bcm5719-llvm-c277ad10f0bdc6d1710607dce25e10ebb855c31d.tar.gz bcm5719-llvm-c277ad10f0bdc6d1710607dce25e10ebb855c31d.zip | |
Remove ObjCQualifiedInterfaceType:-)
llvm-svn: 76321
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 34 | ||||
| -rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 11 |
3 files changed, 17 insertions, 39 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 1c3d18732b2..d3c746501a0 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -1918,19 +1918,14 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { assert(Record.size() == 1 && "incorrect encoding of enum type"); return Context->getTypeDeclType(cast<EnumDecl>(GetDecl(Record[0]))); - case pch::TYPE_OBJC_INTERFACE: - assert(Record.size() == 1 && "incorrect encoding of objc interface type"); - return Context->getObjCInterfaceType( - cast<ObjCInterfaceDecl>(GetDecl(Record[0]))); - - case pch::TYPE_OBJC_QUALIFIED_INTERFACE: { + case pch::TYPE_OBJC_INTERFACE: { unsigned Idx = 0; ObjCInterfaceDecl *ItfD = cast<ObjCInterfaceDecl>(GetDecl(Record[Idx++])); unsigned NumProtos = Record[Idx++]; llvm::SmallVector<ObjCProtocolDecl*, 4> Protos; for (unsigned I = 0; I != NumProtos; ++I) Protos.push_back(cast<ObjCProtocolDecl>(GetDecl(Record[Idx++]))); - return Context->getObjCQualifiedInterfaceType(ItfD, Protos.data(), NumProtos); + return Context->getObjCInterfaceType(ItfD, Protos.data(), NumProtos); } case pch::TYPE_OBJC_OBJECT_POINTER: { @@ -1995,7 +1990,7 @@ QualType PCHReader::GetType(pch::TypeID ID) { } Index -= pch::NUM_PREDEF_TYPE_IDS; - assert(Index < TypesLoaded.size() && "Type index out-of-range"); + //assert(Index < TypesLoaded.size() && "Type index out-of-range"); if (!TypesLoaded[Index]) TypesLoaded[Index] = ReadTypeRecord(TypeOffsets[Index]).getTypePtr(); diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 6a17f39f43e..0a0202ba01d 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -239,18 +239,11 @@ void PCHTypeWriter::VisitQualifiedNameType(const QualifiedNameType *T) { void PCHTypeWriter::VisitObjCInterfaceType(const ObjCInterfaceType *T) { Writer.AddDeclRef(T->getDecl(), Record); - Code = pch::TYPE_OBJC_INTERFACE; -} - -void -PCHTypeWriter::VisitObjCQualifiedInterfaceType( - const ObjCQualifiedInterfaceType *T) { - VisitObjCInterfaceType(T); Record.push_back(T->getNumProtocols()); for (ObjCInterfaceType::qual_iterator I = T->qual_begin(), E = T->qual_end(); I != E; ++I) Writer.AddDeclRef(*I, Record); - Code = pch::TYPE_OBJC_QUALIFIED_INTERFACE; + Code = pch::TYPE_OBJC_INTERFACE; } void @@ -433,7 +426,6 @@ void PCHWriter::WriteBlockInfoBlock() { RECORD(TYPE_RECORD); RECORD(TYPE_ENUM); RECORD(TYPE_OBJC_INTERFACE); - RECORD(TYPE_OBJC_QUALIFIED_INTERFACE); RECORD(TYPE_OBJC_OBJECT_POINTER); // Statements and Exprs can occur in the Types block. AddStmtsExprs(Stream, Record); @@ -1844,6 +1836,18 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, WriteSourceManagerBlock(Context.getSourceManager(), PP, isysroot); WritePreprocessor(PP); WriteComments(Context); + // Write the record of special types. + Record.clear(); + + AddTypeRef(Context.getBuiltinVaListType(), Record); + AddTypeRef(Context.getObjCIdType(), Record); + AddTypeRef(Context.getObjCSelType(), Record); + AddTypeRef(Context.getObjCProtoType(), Record); + AddTypeRef(Context.getObjCClassType(), Record); + AddTypeRef(Context.getRawCFConstantStringType(), Record); + AddTypeRef(Context.getRawObjCFastEnumerationStateType(), Record); + AddTypeRef(Context.getFILEType(), Record); + Stream.EmitRecord(pch::SPECIAL_TYPES, Record); // Keep writing types and declarations until all types and // declarations have been written. @@ -1883,18 +1887,6 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, (const char *)&DeclOffsets.front(), DeclOffsets.size() * sizeof(DeclOffsets[0])); - // Write the record of special types. - Record.clear(); - AddTypeRef(Context.getBuiltinVaListType(), Record); - AddTypeRef(Context.getObjCIdType(), Record); - AddTypeRef(Context.getObjCSelType(), Record); - AddTypeRef(Context.getObjCProtoType(), Record); - AddTypeRef(Context.getObjCClassType(), Record); - AddTypeRef(Context.getRawCFConstantStringType(), Record); - AddTypeRef(Context.getRawObjCFastEnumerationStateType(), Record); - AddTypeRef(Context.getFILEType(), Record); - Stream.EmitRecord(pch::SPECIAL_TYPES, Record); - // Write the record containing external, unnamed definitions. if (!ExternalDefinitions.empty()) Stream.EmitRecord(pch::EXTERNAL_DEFINITIONS, ExternalDefinitions); diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 1bc7451a17c..fa1476a690f 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -1820,16 +1820,7 @@ static void scanToNextArgument(const char *&argRef) { } bool RewriteObjC::needToScanForQualifiers(QualType T) { - - if (T->isObjCQualifiedIdType()) - return true; - - if (const PointerType *pType = T->getAsPointerType()) { - Type *pointeeType = pType->getPointeeType().getTypePtr(); - if (isa<ObjCQualifiedInterfaceType>(pointeeType)) - return true; // we have "Class <Protocol> *". - } - return false; + return T->isObjCQualifiedIdType() || T->isObjCQualifiedInterfaceType(); } void RewriteObjC::RewriteObjCQualifiedInterfaceTypes(Expr *E) { |

