From: Douglas Gregor Date: Thu, 16 Apr 2009 02:45:14 +0000 (+0000) Subject: Eliminate pch::TYPE_ATTR, which is never used X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63f5c2646e75041277657aa1392a5bdd643367a7;p=clang Eliminate pch::TYPE_ATTR, which is never used git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69256 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index a4a0675df0..c8b654c667 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -260,59 +260,54 @@ namespace clang { /// constant describes a record for a specific type class in the /// AST. enum TypeCode { - /// \brief Attributes attached to a type. - /// - /// Note that this has the same value as DECL_ATTR, since - /// attribute blocks are used for both types and declarations. - TYPE_ATTR = 1, /// \brief An ExtQualType record. - TYPE_EXT_QUAL = 2, + TYPE_EXT_QUAL = 1, /// \brief A FixedWidthIntType record. - TYPE_FIXED_WIDTH_INT = 3, + TYPE_FIXED_WIDTH_INT = 2, /// \brief A ComplexType record. - TYPE_COMPLEX = 4, + TYPE_COMPLEX = 3, /// \brief A PointerType record. - TYPE_POINTER = 5, + TYPE_POINTER = 4, /// \brief A BlockPointerType record. - TYPE_BLOCK_POINTER = 6, + TYPE_BLOCK_POINTER = 5, /// \brief An LValueReferenceType record. - TYPE_LVALUE_REFERENCE = 7, + TYPE_LVALUE_REFERENCE = 6, /// \brief An RValueReferenceType record. - TYPE_RVALUE_REFERENCE = 8, + TYPE_RVALUE_REFERENCE = 7, /// \brief A MemberPointerType record. - TYPE_MEMBER_POINTER = 9, + TYPE_MEMBER_POINTER = 8, /// \brief A ConstantArrayType record. - TYPE_CONSTANT_ARRAY = 10, + TYPE_CONSTANT_ARRAY = 9, /// \brief An IncompleteArrayType record. - TYPE_INCOMPLETE_ARRAY = 11, + TYPE_INCOMPLETE_ARRAY = 10, /// \brief A VariableArrayType record. - TYPE_VARIABLE_ARRAY = 12, + TYPE_VARIABLE_ARRAY = 11, /// \brief A VectorType record. - TYPE_VECTOR = 13, + TYPE_VECTOR = 12, /// \brief An ExtVectorType record. - TYPE_EXT_VECTOR = 14, + TYPE_EXT_VECTOR = 13, /// \brief A FunctionNoProtoType record. - TYPE_FUNCTION_NO_PROTO = 15, + TYPE_FUNCTION_NO_PROTO = 14, /// \brief A FunctionProtoType record. - TYPE_FUNCTION_PROTO = 16, + TYPE_FUNCTION_PROTO = 15, /// \brief A TypedefType record. - TYPE_TYPEDEF = 17, + TYPE_TYPEDEF = 16, /// \brief A TypeOfExprType record. - TYPE_TYPEOF_EXPR = 18, + TYPE_TYPEOF_EXPR = 17, /// \brief A TypeOfType record. - TYPE_TYPEOF = 19, + TYPE_TYPEOF = 18, /// \brief A RecordType record. - TYPE_RECORD = 20, + TYPE_RECORD = 19, /// \brief An EnumType record. - TYPE_ENUM = 21, + TYPE_ENUM = 20, /// \brief An ObjCInterfaceType record. - TYPE_OBJC_INTERFACE = 22, + TYPE_OBJC_INTERFACE = 21, /// \brief An ObjCQualifiedInterfaceType record. - TYPE_OBJC_QUALIFIED_INTERFACE = 23, + TYPE_OBJC_QUALIFIED_INTERFACE = 22, /// \brief An ObjCQualifiedIdType record. - TYPE_OBJC_QUALIFIED_ID = 24, + TYPE_OBJC_QUALIFIED_ID = 23, /// \brief An ObjCQualifiedClassType record. - TYPE_OBJC_QUALIFIED_CLASS = 25 + TYPE_OBJC_QUALIFIED_CLASS = 24 }; /// \brief Record codes for each kind of declaration. @@ -323,9 +318,6 @@ namespace clang { /// in the AST. enum DeclCode { /// \brief Attributes attached to a declaration. - /// - /// Note that this has the same value as TYPE_ATTR, since - /// attribute blocks are used for both types and declarations. DECL_ATTR = 1, /// \brief A TranslationUnitDecl record. DECL_TRANSLATION_UNIT, diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index e24a155146..0bc059ed66 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1270,10 +1270,6 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) { RecordData Record; unsigned Code = Stream.ReadCode(); switch ((pch::TypeCode)Stream.ReadRecord(Code, Record)) { - case pch::TYPE_ATTR: - assert(false && "Should never jump to an attribute block"); - return QualType(); - case pch::TYPE_EXT_QUAL: { assert(Record.size() == 3 && "Incorrect encoding of extended qualifier type"); diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index c89e3546bf..8adabafae1 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -1497,8 +1497,6 @@ void PCHWriter::WriteAttributeRecord(const Attr *Attr) { } } - assert((int)pch::DECL_ATTR == (int)pch::TYPE_ATTR && - "DECL_ATTR/TYPE_ATTR mismatch"); S.EmitRecord(pch::DECL_ATTR, Record); }