[cfe-commits] r69256 - in /cfe/trunk: include/clang/Frontend/PCHBitCodes.h lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp

Douglas Gregor dgregor at apple.com
Wed Apr 15 19:45:14 PDT 2009


Author: dgregor
Date: Wed Apr 15 21:45:14 2009
New Revision: 69256

URL: http://llvm.org/viewvc/llvm-project?rev=69256&view=rev
Log:
Eliminate pch::TYPE_ATTR, which is never used

Modified:
    cfe/trunk/include/clang/Frontend/PCHBitCodes.h
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp

Modified: cfe/trunk/include/clang/Frontend/PCHBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHBitCodes.h?rev=69256&r1=69255&r2=69256&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHBitCodes.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHBitCodes.h Wed Apr 15 21:45:14 2009
@@ -260,59 +260,54 @@
     /// 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 @@
     /// 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,

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69256&r1=69255&r2=69256&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Apr 15 21:45:14 2009
@@ -1270,10 +1270,6 @@
   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");

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=69256&r1=69255&r2=69256&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Wed Apr 15 21:45:14 2009
@@ -1497,8 +1497,6 @@
     }
   }
 
-  assert((int)pch::DECL_ATTR == (int)pch::TYPE_ATTR && 
-         "DECL_ATTR/TYPE_ATTR mismatch");
   S.EmitRecord(pch::DECL_ATTR, Record);
 }
 





More information about the cfe-commits mailing list