[cfe-commits] r111478 - in /cfe/trunk: include/clang/Frontend/ASTUnit.h include/clang/Serialization/ASTBitCodes.h include/clang/Serialization/ASTDeserializationListener.h include/clang/Serialization/ASTReader.h include/clang/Serialization/ASTWriter.h lib/Serialization/ASTReader.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTReaderStmt.cpp lib/Serialization/ASTWriter.cpp lib/Serialization/ASTWriterDecl.cpp lib/Serialization/ASTWriterStmt.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Wed Aug 18 16:57:32 PDT 2010


Author: cornedbee
Date: Wed Aug 18 18:57:32 2010
New Revision: 111478

URL: http://llvm.org/viewvc/llvm-project?rev=111478&view=rev
Log:
Rename pch namespace to serialization.

Modified:
    cfe/trunk/include/clang/Frontend/ASTUnit.h
    cfe/trunk/include/clang/Serialization/ASTBitCodes.h
    cfe/trunk/include/clang/Serialization/ASTDeserializationListener.h
    cfe/trunk/include/clang/Serialization/ASTReader.h
    cfe/trunk/include/clang/Serialization/ASTWriter.h
    cfe/trunk/lib/Serialization/ASTReader.cpp
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
    cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
    cfe/trunk/lib/Serialization/ASTWriter.cpp
    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
    cfe/trunk/lib/Serialization/ASTWriterStmt.cpp

Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTUnit.h Wed Aug 18 18:57:32 2010
@@ -198,7 +198,7 @@
 
   /// \brief A list of the serialization ID numbers for each of the top-level
   /// declarations parsed within the precompiled preamble.
-  std::vector<pch::DeclID> TopLevelDeclsInPreamble;
+  std::vector<serialization::DeclID> TopLevelDeclsInPreamble;
 
   ///
   /// \defgroup CodeCompleteCaching Code-completion caching
@@ -409,7 +409,7 @@
 
   /// \brief Add a new top-level declaration, identified by its ID in
   /// the precompiled preamble.
-  void addTopLevelDeclFromPreamble(pch::DeclID D) {
+  void addTopLevelDeclFromPreamble(serialization::DeclID D) {
     TopLevelDeclsInPreamble.push_back(D);
   }
 

Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Wed Aug 18 18:57:32 2010
@@ -21,7 +21,7 @@
 #include "llvm/System/DataTypes.h"
 
 namespace clang {
-  namespace pch {
+  namespace serialization {
     /// \brief AST file major version number supported by this version of
     /// Clang.
     ///

Modified: cfe/trunk/include/clang/Serialization/ASTDeserializationListener.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTDeserializationListener.h?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTDeserializationListener.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTDeserializationListener.h Wed Aug 18 18:57:32 2010
@@ -32,15 +32,16 @@
   virtual void SetReader(ASTReader *Reader) = 0;
 
   /// \brief An identifier was deserialized from the AST file.
-  virtual void IdentifierRead(pch::IdentID ID, IdentifierInfo *II) = 0;
+  virtual void IdentifierRead(serialization::IdentID ID,
+                              IdentifierInfo *II) = 0;
   /// \brief A type was deserialized from the AST file. The ID here has the
   ///        qualifier bits already removed, and T is guaranteed to be locally
   ///        unqualified.
-  virtual void TypeRead(pch::TypeID ID, QualType T) = 0;
+  virtual void TypeRead(serialization::TypeID ID, QualType T) = 0;
   /// \brief A decl was deserialized from the AST file.
-  virtual void DeclRead(pch::DeclID ID, const Decl *D) = 0;
+  virtual void DeclRead(serialization::DeclID ID, const Decl *D) = 0;
   /// \brief A selector was read from the AST file.
-  virtual void SelectorRead(pch::SelectorID iD, Selector Sel) = 0;
+  virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) = 0;
 };
 
 }

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Wed Aug 18 18:57:32 2010
@@ -10,7 +10,7 @@
 //  This file defines the ASTReader class, which reads AST files.
 //
 //===----------------------------------------------------------------------===//
-
+                                                                          
 #ifndef LLVM_CLANG_FRONTEND_AST_READER_H
 #define LLVM_CLANG_FRONTEND_AST_READER_H
 
@@ -321,7 +321,8 @@
   /// = I + 1 has already been loaded.
   std::vector<Decl *> DeclsLoaded;
 
-  typedef llvm::DenseMap<pch::DeclID, std::pair<PerFileData *, uint64_t> >
+  typedef llvm::DenseMap<serialization::DeclID,
+                         std::pair<PerFileData *, uint64_t> >
       DeclReplacementMap;
   /// \brief Declarations that have been replaced in a later file in the chain.
   DeclReplacementMap ReplacedDecls;
@@ -330,7 +331,7 @@
   struct DeclContextInfo {
     llvm::BitstreamCursor *Stream;
     uint64_t OffsetToVisibleDecls;
-    const pch::DeclID *LexicalDecls;
+    const serialization::DeclID *LexicalDecls;
     unsigned NumLexicalDecls;
   };
   typedef llvm::SmallVector<DeclContextInfo, 1> DeclContextInfos;
@@ -341,7 +342,8 @@
   /// DeclContext.
   DeclContextOffsetsMap DeclContextOffsets;
 
-  typedef llvm::DenseMap<pch::DeclID, pch::DeclID> FirstLatestDeclIDMap;
+  typedef llvm::DenseMap<serialization::DeclID, serialization::DeclID>
+      FirstLatestDeclIDMap;
   /// \brief Map of first declarations from a chained PCH that point to the
   /// most recent declarations in another AST file.
   FirstLatestDeclIDMap FirstLatestDeclIDs;
@@ -574,8 +576,8 @@
   QualType ReadTypeRecord(unsigned Index);
   RecordLocation TypeCursorForIndex(unsigned Index);
   void LoadedDecl(unsigned Index, Decl *D);
-  Decl *ReadDeclRecord(unsigned Index, pch::DeclID ID);
-  RecordLocation DeclCursorForIndex(unsigned Index, pch::DeclID ID);
+  Decl *ReadDeclRecord(unsigned Index, serialization::DeclID ID);
+  RecordLocation DeclCursorForIndex(unsigned Index, serialization::DeclID ID);
 
   void PassInterestingDeclsToConsumer();
 
@@ -716,11 +718,11 @@
 
   /// \brief Resolve a type ID into a type, potentially building a new
   /// type.
-  QualType GetType(pch::TypeID ID);
+  QualType GetType(serialization::TypeID ID);
 
   /// \brief Resolve a declaration ID into a declaration, potentially
   /// building a new declaration.
-  Decl *GetDecl(pch::DeclID ID);
+  Decl *GetDecl(serialization::DeclID ID);
   virtual Decl *GetExternalDecl(uint32_t ID);
 
   /// \brief Resolve the offset of a statement into a statement.
@@ -927,7 +929,7 @@
   virtual void ReadDefinedMacros();
 
   /// \brief Retrieve the macro definition with the given ID.
-  MacroDefinition *getMacroDefinition(pch::IdentID ID);
+  MacroDefinition *getMacroDefinition(serialization::IdentID ID);
 
   /// \brief Retrieve the AST context that this AST reader supplements.
   ASTContext *getContext() { return Context; }

Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Wed Aug 18 18:57:32 2010
@@ -114,10 +114,10 @@
   std::queue<DeclOrType> DeclTypesToEmit;
 
   /// \brief The first ID number we can use for our own declarations.
-  pch::DeclID FirstDeclID;
+  serialization::DeclID FirstDeclID;
 
   /// \brief The decl ID that will be assigned to the next new decl.
-  pch::DeclID NextDeclID;
+  serialization::DeclID NextDeclID;
 
   /// \brief Map that provides the ID numbers of each declaration within
   /// the output stream, as well as those deserialized from a chained PCH.
@@ -125,17 +125,17 @@
   /// The ID numbers of declarations are consecutive (in order of
   /// discovery) and start at 2. 1 is reserved for the translation
   /// unit, while 0 is reserved for NULL.
-  llvm::DenseMap<const Decl *, pch::DeclID> DeclIDs;
+  llvm::DenseMap<const Decl *, serialization::DeclID> DeclIDs;
 
   /// \brief Offset of each declaration in the bitstream, indexed by
   /// the declaration's ID.
   std::vector<uint32_t> DeclOffsets;
 
   /// \brief The first ID number we can use for our own types.
-  pch::TypeID FirstTypeID;
+  serialization::TypeID FirstTypeID;
 
   /// \brief The type ID that will be assigned to the next new type.
-  pch::TypeID NextTypeID;
+  serialization::TypeID NextTypeID;
 
   /// \brief Map that provides the ID numbers of each type within the
   /// output stream, plus those deserialized from a chained PCH.
@@ -146,17 +146,18 @@
   /// allow for the const/volatile qualifiers.
   ///
   /// Keys in the map never have const/volatile qualifiers.
-  llvm::DenseMap<QualType, pch::TypeID, UnsafeQualTypeDenseMapInfo> TypeIDs;
+  llvm::DenseMap<QualType, serialization::TypeID, UnsafeQualTypeDenseMapInfo>
+      TypeIDs;
 
   /// \brief Offset of each type in the bitstream, indexed by
   /// the type's ID.
   std::vector<uint32_t> TypeOffsets;
 
   /// \brief The first ID number we can use for our own identifiers.
-  pch::IdentID FirstIdentID;
+  serialization::IdentID FirstIdentID;
 
   /// \brief The identifier ID that will be assigned to the next new identifier.
-  pch::IdentID NextIdentID;
+  serialization::IdentID NextIdentID;
 
   /// \brief Map that provides the ID numbers of each identifier in
   /// the output stream.
@@ -164,20 +165,20 @@
   /// The ID numbers for identifiers are consecutive (in order of
   /// discovery), starting at 1. An ID of zero refers to a NULL
   /// IdentifierInfo.
-  llvm::DenseMap<const IdentifierInfo *, pch::IdentID> IdentifierIDs;
+  llvm::DenseMap<const IdentifierInfo *, serialization::IdentID> IdentifierIDs;
 
   /// \brief Offsets of each of the identifier IDs into the identifier
   /// table.
   std::vector<uint32_t> IdentifierOffsets;
 
   /// \brief The first ID number we can use for our own selectors.
-  pch::SelectorID FirstSelectorID;
+  serialization::SelectorID FirstSelectorID;
 
   /// \brief The selector ID that will be assigned to the next new identifier.
-  pch::SelectorID NextSelectorID;
+  serialization::SelectorID NextSelectorID;
 
   /// \brief Map that provides the ID numbers of each Selector.
-  llvm::DenseMap<Selector, pch::SelectorID> SelectorIDs;
+  llvm::DenseMap<Selector, serialization::SelectorID> SelectorIDs;
 
   /// \brief Offset of each selector within the method pool/selector
   /// table, indexed by the Selector ID (-1).
@@ -193,7 +194,8 @@
 
   /// \brief Mapping from macro definitions (as they occur in the preprocessing
   /// record) to the index into the macro definitions table.
-  llvm::DenseMap<const MacroDefinition *, pch::IdentID> MacroDefinitions;
+  llvm::DenseMap<const MacroDefinition *, serialization::IdentID>
+      MacroDefinitions;
   
   /// \brief Mapping from the macro definition indices in \c MacroDefinitions
   /// to the corresponding offsets within the preprocessor block.
@@ -232,7 +234,8 @@
   /// happen, but the ObjC AST nodes are designed this way), it will be
   /// serialized again. In this case, it is registered here, so that the reader
   /// knows to read the updated version.
-  llvm::SmallVector<std::pair<pch::DeclID, uint64_t>, 16> ReplacedDecls;
+  llvm::SmallVector<std::pair<serialization::DeclID, uint64_t>, 16>
+      ReplacedDecls;
 
   /// \brief Statements that we've encountered while serializing a
   /// declaration or type.
@@ -339,10 +342,10 @@
   void AddCXXTemporary(const CXXTemporary *Temp, RecordData &Record);
 
   /// \brief Get the unique number used to refer to the given selector.
-  pch::SelectorID getSelectorRef(Selector Sel);
+  serialization::SelectorID getSelectorRef(Selector Sel);
   
   /// \brief Get the unique number used to refer to the given identifier.
-  pch::IdentID getIdentifierRef(const IdentifierInfo *II);
+  serialization::IdentID getIdentifierRef(const IdentifierInfo *II);
 
   /// \brief Retrieve the offset of the macro definition for the given
   /// identifier.
@@ -356,7 +359,7 @@
 
   /// \brief Retrieve the ID number corresponding to the given macro 
   /// definition.
-  pch::IdentID getMacroDefinitionID(MacroDefinition *MD);
+  serialization::IdentID getMacroDefinitionID(MacroDefinition *MD);
   
   /// \brief Emit a reference to a type.
   void AddTypeRef(QualType T, RecordData &Record);
@@ -377,11 +380,11 @@
   void AddDeclRef(const Decl *D, RecordData &Record);
 
   /// \brief Force a declaration to be emitted and get its ID.
-  pch::DeclID GetDeclRef(const Decl *D);
+  serialization::DeclID GetDeclRef(const Decl *D);
 
   /// \brief Determine the declaration ID of an already-emitted
   /// declaration.
-  pch::DeclID getDeclID(const Decl *D);
+  serialization::DeclID getDeclID(const Decl *D);
 
   /// \brief Emit a declaration name.
   void AddDeclarationName(DeclarationName Name, RecordData &Record);
@@ -462,10 +465,10 @@
 
   // ASTDeserializationListener implementation
   void SetReader(ASTReader *Reader);
-  void IdentifierRead(pch::IdentID ID, IdentifierInfo *II);
-  void TypeRead(pch::TypeID ID, QualType T);
-  void DeclRead(pch::DeclID ID, const Decl *D);
-  void SelectorRead(pch::SelectorID iD, Selector Sel);
+  void IdentifierRead(serialization::IdentID ID, IdentifierInfo *II);
+  void TypeRead(serialization::TypeID ID, QualType T);
+  void DeclRead(serialization::DeclID ID, const Decl *D);
+  void SelectorRead(serialization::SelectorID iD, Selector Sel);
 };
 
 /// \brief AST and semantic-analysis consumer that generates a

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Aug 18 18:57:32 2010
@@ -41,6 +41,7 @@
 #include <cstdio>
 #include <sys/stat.h>
 using namespace clang;
+using namespace clang::serialization;
 
 //===----------------------------------------------------------------------===//
 // PCH validator implementation
@@ -470,7 +471,7 @@
 
 public:
   struct data_type {
-    pch::SelectorID ID;
+    SelectorID ID;
     ObjCMethodList Instance, Factory;
   };
 
@@ -634,7 +635,7 @@
                            const unsigned char* d,
                            unsigned DataLen) {
     using namespace clang::io;
-    pch::IdentID ID = ReadUnalignedLE32(d);
+    IdentID ID = ReadUnalignedLE32(d);
     bool IsInteresting = ID & 0x01;
 
     // Wipe out the "is interesting" bit.
@@ -907,7 +908,7 @@
   }
 
   // Enter the source manager block.
-  if (SLocEntryCursor.EnterSubBlock(pch::SOURCE_MANAGER_BLOCK_ID)) {
+  if (SLocEntryCursor.EnterSubBlock(SOURCE_MANAGER_BLOCK_ID)) {
     Error("malformed source manager block record in AST file");
     return Failure;
   }
@@ -946,14 +947,14 @@
     default:  // Default behavior: ignore.
       break;
 
-    case pch::SM_LINE_TABLE:
+    case SM_LINE_TABLE:
       if (ParseLineTable(Record))
         return Failure;
       break;
 
-    case pch::SM_SLOC_FILE_ENTRY:
-    case pch::SM_SLOC_BUFFER_ENTRY:
-    case pch::SM_SLOC_INSTANTIATION_ENTRY:
+    case SM_SLOC_FILE_ENTRY:
+    case SM_SLOC_BUFFER_ENTRY:
+    case SM_SLOC_INSTANTIATION_ENTRY:
       // Once we hit one of the source location entries, we're done.
       return Success;
     }
@@ -1009,7 +1010,7 @@
     Error("incorrectly-formatted source location entry in AST file");
     return Failure;
 
-  case pch::SM_SLOC_FILE_ENTRY: {
+  case SM_SLOC_FILE_ENTRY: {
     std::string Filename(BlobStart, BlobStart + BlobLen);
     MaybeAddSystemRootToFilename(Filename);
     const FileEntry *File = FileMgr.getFile(Filename);
@@ -1059,7 +1060,7 @@
     break;
   }
 
-  case pch::SM_SLOC_BUFFER_ENTRY: {
+  case SM_SLOC_BUFFER_ENTRY: {
     const char *Name = BlobStart;
     unsigned Offset = Record[0];
     unsigned Code = SLocEntryCursor.ReadCode();
@@ -1067,7 +1068,7 @@
     unsigned RecCode
       = SLocEntryCursor.ReadRecord(Code, Record, &BlobStart, &BlobLen);
 
-    if (RecCode != pch::SM_SLOC_BUFFER_BLOB) {
+    if (RecCode != SM_SLOC_BUFFER_BLOB) {
       Error("AST record has invalid code");
       return Failure;
     }
@@ -1088,7 +1089,7 @@
     break;
   }
 
-  case pch::SM_SLOC_INSTANTIATION_ENTRY: {
+  case SM_SLOC_INSTANTIATION_ENTRY: {
     SourceLocation SpellingLoc
       = SourceLocation::getFromRawEncoding(Record[1]);
     SourceMgr.createInstantiationLoc(SpellingLoc,
@@ -1159,11 +1160,11 @@
 
     // Read a record.
     Record.clear();
-    pch::PreprocessorRecordTypes RecType =
-      (pch::PreprocessorRecordTypes)Stream.ReadRecord(Code, Record);
+    PreprocessorRecordTypes RecType =
+      (PreprocessorRecordTypes)Stream.ReadRecord(Code, Record);
     switch (RecType) {
-    case pch::PP_MACRO_OBJECT_LIKE:
-    case pch::PP_MACRO_FUNCTION_LIKE: {
+    case PP_MACRO_OBJECT_LIKE:
+    case PP_MACRO_FUNCTION_LIKE: {
       // If we already have a macro, that means that we've hit the end
       // of the definition of the macro we were looking for. We're
       // done.
@@ -1183,7 +1184,7 @@
       MI->setIsFromAST();
 
       unsigned NextIndex = 3;
-      if (RecType == pch::PP_MACRO_FUNCTION_LIKE) {
+      if (RecType == PP_MACRO_FUNCTION_LIKE) {
         // Decode function-like macro info.
         bool isC99VarArgs = Record[3];
         bool isGNUVarArgs = Record[4];
@@ -1218,7 +1219,7 @@
       break;
     }
 
-    case pch::PP_TOKEN: {
+    case PP_TOKEN: {
       // If we see a TOKEN before a PP_MACRO_*, then the file is
       // erroneous, just pretend we didn't see this.
       if (Macro == 0) break;
@@ -1235,7 +1236,7 @@
       break;
     }
         
-    case pch::PP_MACRO_INSTANTIATION: {
+    case PP_MACRO_INSTANTIATION: {
       // If we already have a macro, that means that we've hit the end
       // of the definition of the macro we were looking for. We're
       // done.
@@ -1261,7 +1262,7 @@
       return;
     }
 
-    case pch::PP_MACRO_DEFINITION: {
+    case PP_MACRO_DEFINITION: {
       // If we already have a macro, that means that we've hit the end
       // of the definition of the macro we were looking for. We're
       // done.
@@ -1305,7 +1306,7 @@
       continue;
 
     llvm::BitstreamCursor Cursor = MacroCursor;
-    if (Cursor.EnterSubBlock(pch::PREPROCESSOR_BLOCK_ID)) {
+    if (Cursor.EnterSubBlock(PREPROCESSOR_BLOCK_ID)) {
       Error("malformed preprocessor block record in AST file");
       return;
     }
@@ -1344,17 +1345,17 @@
       default:  // Default behavior: ignore.
         break;
 
-      case pch::PP_MACRO_OBJECT_LIKE:
-      case pch::PP_MACRO_FUNCTION_LIKE:
+      case PP_MACRO_OBJECT_LIKE:
+      case PP_MACRO_FUNCTION_LIKE:
         DecodeIdentifierInfo(Record[0]);
         break;
 
-      case pch::PP_TOKEN:
+      case PP_TOKEN:
         // Ignore tokens.
         break;
         
-      case pch::PP_MACRO_INSTANTIATION:
-      case pch::PP_MACRO_DEFINITION:
+      case PP_MACRO_INSTANTIATION:
+      case PP_MACRO_DEFINITION:
         // Read the macro record.
         ReadMacroRecord(Chain[N - I - 1]->Stream, Cursor.GetCurrentBitNo());
         break;
@@ -1363,7 +1364,7 @@
   }
 }
 
-MacroDefinition *ASTReader::getMacroDefinition(pch::IdentID ID) {
+MacroDefinition *ASTReader::getMacroDefinition(IdentID ID) {
   if (ID == 0 || ID >= MacroDefinitionsLoaded.size())
     return 0;
 
@@ -1411,7 +1412,7 @@
 ASTReader::ReadASTBlock(PerFileData &F) {
   llvm::BitstreamCursor &Stream = F.Stream;
 
-  if (Stream.EnterSubBlock(pch::AST_BLOCK_ID)) {
+  if (Stream.EnterSubBlock(AST_BLOCK_ID)) {
     Error("malformed block record in AST file");
     return Failure;
   }
@@ -1432,7 +1433,7 @@
 
     if (Code == llvm::bitc::ENTER_SUBBLOCK) {
       switch (Stream.ReadSubBlockID()) {
-      case pch::DECLTYPES_BLOCK_ID:
+      case DECLTYPES_BLOCK_ID:
         // We lazily load the decls block, but we want to set up the
         // DeclsCursor cursor to point into it.  Clone our current bitcode
         // cursor to it, enter the block and read the abbrevs in that block.
@@ -1440,13 +1441,13 @@
         F.DeclsCursor = Stream;
         if (Stream.SkipBlock() ||  // Skip with the main cursor.
             // Read the abbrevs.
-            ReadBlockAbbrevs(F.DeclsCursor, pch::DECLTYPES_BLOCK_ID)) {
+            ReadBlockAbbrevs(F.DeclsCursor, DECLTYPES_BLOCK_ID)) {
           Error("malformed block record in AST file");
           return Failure;
         }
         break;
 
-      case pch::PREPROCESSOR_BLOCK_ID:
+      case PREPROCESSOR_BLOCK_ID:
         F.MacroCursor = Stream;
         if (PP)
           PP->setExternalSource(this);
@@ -1457,7 +1458,7 @@
         }
         break;
 
-      case pch::SOURCE_MANAGER_BLOCK_ID:
+      case SOURCE_MANAGER_BLOCK_ID:
         switch (ReadSourceManagerBlock(F)) {
         case Success:
           break;
@@ -1484,14 +1485,14 @@
     Record.clear();
     const char *BlobStart = 0;
     unsigned BlobLen = 0;
-    switch ((pch::ASTRecordTypes)Stream.ReadRecord(Code, Record,
+    switch ((ASTRecordTypes)Stream.ReadRecord(Code, Record,
                                                    &BlobStart, &BlobLen)) {
     default:  // Default behavior: ignore.
       break;
 
-    case pch::METADATA: {
-      if (Record[0] != pch::VERSION_MAJOR && !DisableValidation) {
-        Diag(Record[0] < pch::VERSION_MAJOR? diag::warn_pch_version_too_old
+    case METADATA: {
+      if (Record[0] != VERSION_MAJOR && !DisableValidation) {
+        Diag(Record[0] < VERSION_MAJOR? diag::warn_pch_version_too_old
                                            : diag::warn_pch_version_too_new);
         return IgnorePCH;
       }
@@ -1505,13 +1506,13 @@
       break;
     }
 
-    case pch::CHAINED_METADATA: {
+    case CHAINED_METADATA: {
       if (!First) {
         Error("CHAINED_METADATA is not first record in block");
         return Failure;
       }
-      if (Record[0] != pch::VERSION_MAJOR && !DisableValidation) {
-        Diag(Record[0] < pch::VERSION_MAJOR? diag::warn_pch_version_too_old
+      if (Record[0] != VERSION_MAJOR && !DisableValidation) {
+        Diag(Record[0] < VERSION_MAJOR? diag::warn_pch_version_too_old
                                            : diag::warn_pch_version_too_new);
         return IgnorePCH;
       }
@@ -1526,7 +1527,7 @@
       break;
     }
 
-    case pch::TYPE_OFFSET:
+    case TYPE_OFFSET:
       if (F.LocalNumTypes != 0) {
         Error("duplicate TYPE_OFFSET record in AST file");
         return Failure;
@@ -1535,7 +1536,7 @@
       F.LocalNumTypes = Record[0];
       break;
 
-    case pch::DECL_OFFSET:
+    case DECL_OFFSET:
       if (F.LocalNumDecls != 0) {
         Error("duplicate DECL_OFFSET record in AST file");
         return Failure;
@@ -1544,20 +1545,20 @@
       F.LocalNumDecls = Record[0];
       break;
 
-    case pch::TU_UPDATE_LEXICAL: {
+    case TU_UPDATE_LEXICAL: {
       DeclContextInfo Info = {
         /* No visible information */ 0, 0,
-        reinterpret_cast<const pch::DeclID *>(BlobStart),
-        BlobLen / sizeof(pch::DeclID)
+        reinterpret_cast<const DeclID *>(BlobStart),
+        BlobLen / sizeof(DeclID)
       };
       DeclContextOffsets[Context->getTranslationUnitDecl()].push_back(Info);
       break;
     }
 
-    case pch::REDECLS_UPDATE_LATEST: {
+    case REDECLS_UPDATE_LATEST: {
       assert(Record.size() % 2 == 0 && "Expected pairs of DeclIDs");
       for (unsigned i = 0, e = Record.size(); i < e; i += 2) {
-        pch::DeclID First = Record[i], Latest = Record[i+1];
+        DeclID First = Record[i], Latest = Record[i+1];
         assert((FirstLatestDeclIDs.find(First) == FirstLatestDeclIDs.end() ||
                 Latest > FirstLatestDeclIDs[First]) &&
                "The new latest is supposed to come after the previous latest");
@@ -1566,12 +1567,12 @@
       break;
     }
 
-    case pch::LANGUAGE_OPTIONS:
+    case LANGUAGE_OPTIONS:
       if (ParseLanguageOptions(Record) && !DisableValidation)
         return IgnorePCH;
       break;
 
-    case pch::IDENTIFIER_TABLE:
+    case IDENTIFIER_TABLE:
       F.IdentifierTableData = BlobStart;
       if (Record[0]) {
         F.IdentifierLookupTable
@@ -1584,7 +1585,7 @@
       }
       break;
 
-    case pch::IDENTIFIER_OFFSET:
+    case IDENTIFIER_OFFSET:
       if (F.LocalNumIdentifiers != 0) {
         Error("duplicate IDENTIFIER_OFFSET record in AST file");
         return Failure;
@@ -1593,7 +1594,7 @@
       F.LocalNumIdentifiers = Record[0];
       break;
 
-    case pch::EXTERNAL_DEFINITIONS:
+    case EXTERNAL_DEFINITIONS:
       // Optimization for the first block.
       if (ExternalDefinitions.empty())
         ExternalDefinitions.swap(Record);
@@ -1602,7 +1603,7 @@
                                    Record.begin(), Record.end());
       break;
 
-    case pch::SPECIAL_TYPES:
+    case SPECIAL_TYPES:
       // Optimization for the first block
       if (SpecialTypes.empty())
         SpecialTypes.swap(Record);
@@ -1610,14 +1611,14 @@
         SpecialTypes.insert(SpecialTypes.end(), Record.begin(), Record.end());
       break;
 
-    case pch::STATISTICS:
+    case STATISTICS:
       TotalNumStatements += Record[0];
       TotalNumMacros += Record[1];
       TotalLexicalDeclContexts += Record[2];
       TotalVisibleDeclContexts += Record[3];
       break;
 
-    case pch::TENTATIVE_DEFINITIONS:
+    case TENTATIVE_DEFINITIONS:
       // Optimization for the first block.
       if (TentativeDefinitions.empty())
         TentativeDefinitions.swap(Record);
@@ -1626,7 +1627,7 @@
                                     Record.begin(), Record.end());
       break;
 
-    case pch::UNUSED_FILESCOPED_DECLS:
+    case UNUSED_FILESCOPED_DECLS:
       // Optimization for the first block.
       if (UnusedFileScopedDecls.empty())
         UnusedFileScopedDecls.swap(Record);
@@ -1635,12 +1636,12 @@
                                      Record.begin(), Record.end());
       break;
 
-    case pch::WEAK_UNDECLARED_IDENTIFIERS:
+    case WEAK_UNDECLARED_IDENTIFIERS:
       // Later blocks overwrite earlier ones.
       WeakUndeclaredIdentifiers.swap(Record);
       break;
 
-    case pch::LOCALLY_SCOPED_EXTERNAL_DECLS:
+    case LOCALLY_SCOPED_EXTERNAL_DECLS:
       // Optimization for the first block.
       if (LocallyScopedExternalDecls.empty())
         LocallyScopedExternalDecls.swap(Record);
@@ -1649,12 +1650,12 @@
                                           Record.begin(), Record.end());
       break;
 
-    case pch::SELECTOR_OFFSETS:
+    case SELECTOR_OFFSETS:
       F.SelectorOffsets = (const uint32_t *)BlobStart;
       F.LocalNumSelectors = Record[0];
       break;
 
-    case pch::METHOD_POOL:
+    case METHOD_POOL:
       F.SelectorLookupTableData = (const unsigned char *)BlobStart;
       if (Record[0])
         F.SelectorLookupTable
@@ -1665,18 +1666,18 @@
       TotalNumMethodPoolEntries += Record[1];
       break;
 
-    case pch::REFERENCED_SELECTOR_POOL: {
+    case REFERENCED_SELECTOR_POOL: {
       ReferencedSelectorsData.insert(ReferencedSelectorsData.end(),
           Record.begin(), Record.end());
       break;
     }
 
-    case pch::PP_COUNTER_VALUE:
+    case PP_COUNTER_VALUE:
       if (!Record.empty() && Listener)
         Listener->ReadCounter(Record[0]);
       break;
 
-    case pch::SOURCE_LOCATION_OFFSETS:
+    case SOURCE_LOCATION_OFFSETS:
       F.SLocOffsets = (const uint32_t *)BlobStart;
       F.LocalNumSLocEntries = Record[0];
       // We cannot delay this until the entire chain is loaded, because then
@@ -1686,7 +1687,7 @@
       SourceMgr.PreallocateSLocEntries(this, TotalNumSLocEntries, Record[1]);
       break;
 
-    case pch::SOURCE_LOCATION_PRELOADS:
+    case SOURCE_LOCATION_PRELOADS:
       for (unsigned I = 0, N = Record.size(); I != N; ++I) {
         ASTReadResult Result = ReadSLocEntryRecord(Record[I]);
         if (Result != Success)
@@ -1694,7 +1695,7 @@
       }
       break;
 
-    case pch::STAT_CACHE: {
+    case STAT_CACHE: {
       ASTStatCache *MyStatCache =
         new ASTStatCache((const unsigned char *)BlobStart + Record[0],
                          (const unsigned char *)BlobStart,
@@ -1704,7 +1705,7 @@
       break;
     }
 
-    case pch::EXT_VECTOR_DECLS:
+    case EXT_VECTOR_DECLS:
       // Optimization for the first block.
       if (ExtVectorDecls.empty())
         ExtVectorDecls.swap(Record);
@@ -1713,12 +1714,12 @@
                               Record.begin(), Record.end());
       break;
 
-    case pch::VTABLE_USES:
+    case VTABLE_USES:
       // Later tables overwrite earlier ones.
       VTableUses.swap(Record);
       break;
 
-    case pch::DYNAMIC_CLASSES:
+    case DYNAMIC_CLASSES:
       // Optimization for the first block.
       if (DynamicClasses.empty())
         DynamicClasses.swap(Record);
@@ -1727,7 +1728,7 @@
                               Record.begin(), Record.end());
       break;
 
-    case pch::PENDING_IMPLICIT_INSTANTIATIONS:
+    case PENDING_IMPLICIT_INSTANTIATIONS:
       // Optimization for the first block.
       if (PendingImplicitInstantiations.empty())
         PendingImplicitInstantiations.swap(Record);
@@ -1736,12 +1737,12 @@
              PendingImplicitInstantiations.end(), Record.begin(), Record.end());
       break;
 
-    case pch::SEMA_DECL_REFS:
+    case SEMA_DECL_REFS:
       // Later tables overwrite earlier ones.
       SemaDeclRefs.swap(Record);
       break;
 
-    case pch::ORIGINAL_FILE_NAME:
+    case ORIGINAL_FILE_NAME:
       // The primary AST will be the last to get here, so it will be the one
       // that's used.
       ActualOriginalFileName.assign(BlobStart, BlobLen);
@@ -1749,7 +1750,7 @@
       MaybeAddSystemRootToFilename(OriginalFileName);
       break;
 
-    case pch::VERSION_CONTROL_BRANCH_REVISION: {
+    case VERSION_CONTROL_BRANCH_REVISION: {
       const std::string &CurBranch = getClangFullRepositoryVersion();
       llvm::StringRef ASTBranch(BlobStart, BlobLen);
       if (llvm::StringRef(CurBranch) != ASTBranch && !DisableValidation) {
@@ -1759,19 +1760,19 @@
       break;
     }
 
-    case pch::MACRO_DEFINITION_OFFSETS:
+    case MACRO_DEFINITION_OFFSETS:
       F.MacroDefinitionOffsets = (const uint32_t *)BlobStart;
       F.NumPreallocatedPreprocessingEntities = Record[0];
       F.LocalNumMacroDefinitions = Record[1];
       break;
 
-    case pch::DECL_REPLACEMENTS: {
+    case DECL_REPLACEMENTS: {
       if (Record.size() % 2 != 0) {
         Error("invalid DECL_REPLACEMENTS block in AST file");
         return Failure;
       }
       for (unsigned I = 0, N = Record.size(); I != N; I += 2)
-        ReplacedDecls[static_cast<pch::DeclID>(Record[I])] =
+        ReplacedDecls[static_cast<DeclID>(Record[I])] =
             std::make_pair(&F, Record[I+1]);
       break;
     }
@@ -1923,7 +1924,7 @@
         return Failure;
       }
       break;
-    case pch::AST_BLOCK_ID:
+    case AST_BLOCK_ID:
       switch (ReadASTBlock(F)) {
       case Success:
         break;
@@ -1986,22 +1987,22 @@
 
   // Load the special types.
   Context->setBuiltinVaListType(
-    GetType(SpecialTypes[pch::SPECIAL_TYPE_BUILTIN_VA_LIST]));
-  if (unsigned Id = SpecialTypes[pch::SPECIAL_TYPE_OBJC_ID])
+    GetType(SpecialTypes[SPECIAL_TYPE_BUILTIN_VA_LIST]));
+  if (unsigned Id = SpecialTypes[SPECIAL_TYPE_OBJC_ID])
     Context->setObjCIdType(GetType(Id));
-  if (unsigned Sel = SpecialTypes[pch::SPECIAL_TYPE_OBJC_SELECTOR])
+  if (unsigned Sel = SpecialTypes[SPECIAL_TYPE_OBJC_SELECTOR])
     Context->setObjCSelType(GetType(Sel));
-  if (unsigned Proto = SpecialTypes[pch::SPECIAL_TYPE_OBJC_PROTOCOL])
+  if (unsigned Proto = SpecialTypes[SPECIAL_TYPE_OBJC_PROTOCOL])
     Context->setObjCProtoType(GetType(Proto));
-  if (unsigned Class = SpecialTypes[pch::SPECIAL_TYPE_OBJC_CLASS])
+  if (unsigned Class = SpecialTypes[SPECIAL_TYPE_OBJC_CLASS])
     Context->setObjCClassType(GetType(Class));
 
-  if (unsigned String = SpecialTypes[pch::SPECIAL_TYPE_CF_CONSTANT_STRING])
+  if (unsigned String = SpecialTypes[SPECIAL_TYPE_CF_CONSTANT_STRING])
     Context->setCFConstantStringType(GetType(String));
   if (unsigned FastEnum
-        = SpecialTypes[pch::SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE])
+        = SpecialTypes[SPECIAL_TYPE_OBJC_FAST_ENUMERATION_STATE])
     Context->setObjCFastEnumerationStateType(GetType(FastEnum));
-  if (unsigned File = SpecialTypes[pch::SPECIAL_TYPE_FILE]) {
+  if (unsigned File = SpecialTypes[SPECIAL_TYPE_FILE]) {
     QualType FileType = GetType(File);
     if (FileType.isNull()) {
       Error("FILE type is NULL");
@@ -2018,7 +2019,7 @@
       Context->setFILEDecl(Tag->getDecl());
     }
   }
-  if (unsigned Jmp_buf = SpecialTypes[pch::SPECIAL_TYPE_jmp_buf]) {
+  if (unsigned Jmp_buf = SpecialTypes[SPECIAL_TYPE_jmp_buf]) {
     QualType Jmp_bufType = GetType(Jmp_buf);
     if (Jmp_bufType.isNull()) {
       Error("jmp_bug type is NULL");
@@ -2035,7 +2036,7 @@
       Context->setjmp_bufDecl(Tag->getDecl());
     }
   }
-  if (unsigned Sigjmp_buf = SpecialTypes[pch::SPECIAL_TYPE_sigjmp_buf]) {
+  if (unsigned Sigjmp_buf = SpecialTypes[SPECIAL_TYPE_sigjmp_buf]) {
     QualType Sigjmp_bufType = GetType(Sigjmp_buf);
     if (Sigjmp_bufType.isNull()) {
       Error("sigjmp_buf type is NULL");
@@ -2050,23 +2051,23 @@
     }
   }
   if (unsigned ObjCIdRedef
-        = SpecialTypes[pch::SPECIAL_TYPE_OBJC_ID_REDEFINITION])
+        = SpecialTypes[SPECIAL_TYPE_OBJC_ID_REDEFINITION])
     Context->ObjCIdRedefinitionType = GetType(ObjCIdRedef);
   if (unsigned ObjCClassRedef
-      = SpecialTypes[pch::SPECIAL_TYPE_OBJC_CLASS_REDEFINITION])
+      = SpecialTypes[SPECIAL_TYPE_OBJC_CLASS_REDEFINITION])
     Context->ObjCClassRedefinitionType = GetType(ObjCClassRedef);
-  if (unsigned String = SpecialTypes[pch::SPECIAL_TYPE_BLOCK_DESCRIPTOR])
+  if (unsigned String = SpecialTypes[SPECIAL_TYPE_BLOCK_DESCRIPTOR])
     Context->setBlockDescriptorType(GetType(String));
   if (unsigned String
-      = SpecialTypes[pch::SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR])
+      = SpecialTypes[SPECIAL_TYPE_BLOCK_EXTENDED_DESCRIPTOR])
     Context->setBlockDescriptorExtendedType(GetType(String));
   if (unsigned ObjCSelRedef
-      = SpecialTypes[pch::SPECIAL_TYPE_OBJC_SEL_REDEFINITION])
+      = SpecialTypes[SPECIAL_TYPE_OBJC_SEL_REDEFINITION])
     Context->ObjCSelRedefinitionType = GetType(ObjCSelRedef);
-  if (unsigned String = SpecialTypes[pch::SPECIAL_TYPE_NS_CONSTANT_STRING])
+  if (unsigned String = SpecialTypes[SPECIAL_TYPE_NS_CONSTANT_STRING])
     Context->setNSConstantStringType(GetType(String));
 
-  if (SpecialTypes[pch::SPECIAL_TYPE_INT128_INSTALLED])
+  if (SpecialTypes[SPECIAL_TYPE_INT128_INSTALLED])
     Context->setInt128Installed();
 }
 
@@ -2109,8 +2110,8 @@
 
       // We only know the AST subblock ID.
       switch (BlockID) {
-      case pch::AST_BLOCK_ID:
-        if (Stream.EnterSubBlock(pch::AST_BLOCK_ID)) {
+      case AST_BLOCK_ID:
+        if (Stream.EnterSubBlock(AST_BLOCK_ID)) {
           Diags.Report(diag::err_fe_pch_malformed_block) << ASTFileName;
           return std::string();
         }
@@ -2143,7 +2144,7 @@
     const char *BlobStart = 0;
     unsigned BlobLen = 0;
     if (Stream.ReadRecord(Code, Record, &BlobStart, &BlobLen)
-          == pch::ORIGINAL_FILE_NAME)
+          == ORIGINAL_FILE_NAME)
       return std::string(BlobStart, BlobLen);
   }
 
@@ -2267,8 +2268,8 @@
   DeclsCursor.JumpToBit(Loc.second);
   RecordData Record;
   unsigned Code = DeclsCursor.ReadCode();
-  switch ((pch::TypeCode)DeclsCursor.ReadRecord(Code, Record)) {
-  case pch::TYPE_EXT_QUAL: {
+  switch ((TypeCode)DeclsCursor.ReadRecord(Code, Record)) {
+  case TYPE_EXT_QUAL: {
     if (Record.size() != 2) {
       Error("Incorrect encoding of extended qualifier type");
       return QualType();
@@ -2278,7 +2279,7 @@
     return Context->getQualifiedType(Base, Quals);
   }
 
-  case pch::TYPE_COMPLEX: {
+  case TYPE_COMPLEX: {
     if (Record.size() != 1) {
       Error("Incorrect encoding of complex type");
       return QualType();
@@ -2287,7 +2288,7 @@
     return Context->getComplexType(ElemType);
   }
 
-  case pch::TYPE_POINTER: {
+  case TYPE_POINTER: {
     if (Record.size() != 1) {
       Error("Incorrect encoding of pointer type");
       return QualType();
@@ -2296,7 +2297,7 @@
     return Context->getPointerType(PointeeType);
   }
 
-  case pch::TYPE_BLOCK_POINTER: {
+  case TYPE_BLOCK_POINTER: {
     if (Record.size() != 1) {
       Error("Incorrect encoding of block pointer type");
       return QualType();
@@ -2305,7 +2306,7 @@
     return Context->getBlockPointerType(PointeeType);
   }
 
-  case pch::TYPE_LVALUE_REFERENCE: {
+  case TYPE_LVALUE_REFERENCE: {
     if (Record.size() != 1) {
       Error("Incorrect encoding of lvalue reference type");
       return QualType();
@@ -2314,7 +2315,7 @@
     return Context->getLValueReferenceType(PointeeType);
   }
 
-  case pch::TYPE_RVALUE_REFERENCE: {
+  case TYPE_RVALUE_REFERENCE: {
     if (Record.size() != 1) {
       Error("Incorrect encoding of rvalue reference type");
       return QualType();
@@ -2323,7 +2324,7 @@
     return Context->getRValueReferenceType(PointeeType);
   }
 
-  case pch::TYPE_MEMBER_POINTER: {
+  case TYPE_MEMBER_POINTER: {
     if (Record.size() != 2) {
       Error("Incorrect encoding of member pointer type");
       return QualType();
@@ -2333,7 +2334,7 @@
     return Context->getMemberPointerType(PointeeType, ClassType.getTypePtr());
   }
 
-  case pch::TYPE_CONSTANT_ARRAY: {
+  case TYPE_CONSTANT_ARRAY: {
     QualType ElementType = GetType(Record[0]);
     ArrayType::ArraySizeModifier ASM = (ArrayType::ArraySizeModifier)Record[1];
     unsigned IndexTypeQuals = Record[2];
@@ -2343,14 +2344,14 @@
                                          ASM, IndexTypeQuals);
   }
 
-  case pch::TYPE_INCOMPLETE_ARRAY: {
+  case TYPE_INCOMPLETE_ARRAY: {
     QualType ElementType = GetType(Record[0]);
     ArrayType::ArraySizeModifier ASM = (ArrayType::ArraySizeModifier)Record[1];
     unsigned IndexTypeQuals = Record[2];
     return Context->getIncompleteArrayType(ElementType, ASM, IndexTypeQuals);
   }
 
-  case pch::TYPE_VARIABLE_ARRAY: {
+  case TYPE_VARIABLE_ARRAY: {
     QualType ElementType = GetType(Record[0]);
     ArrayType::ArraySizeModifier ASM = (ArrayType::ArraySizeModifier)Record[1];
     unsigned IndexTypeQuals = Record[2];
@@ -2361,7 +2362,7 @@
                                          SourceRange(LBLoc, RBLoc));
   }
 
-  case pch::TYPE_VECTOR: {
+  case TYPE_VECTOR: {
     if (Record.size() != 3) {
       Error("incorrect encoding of vector type in AST file");
       return QualType();
@@ -2374,7 +2375,7 @@
                                   (VectorType::AltiVecSpecific)AltiVecSpec);
   }
 
-  case pch::TYPE_EXT_VECTOR: {
+  case TYPE_EXT_VECTOR: {
     if (Record.size() != 3) {
       Error("incorrect encoding of extended vector type in AST file");
       return QualType();
@@ -2385,7 +2386,7 @@
     return Context->getExtVectorType(ElementType, NumElements);
   }
 
-  case pch::TYPE_FUNCTION_NO_PROTO: {
+  case TYPE_FUNCTION_NO_PROTO: {
     if (Record.size() != 4) {
       Error("incorrect encoding of no-proto function type");
       return QualType();
@@ -2395,7 +2396,7 @@
     return Context->getFunctionNoProtoType(ResultType, Info);
   }
 
-  case pch::TYPE_FUNCTION_PROTO: {
+  case TYPE_FUNCTION_PROTO: {
     QualType ResultType = GetType(Record[0]);
     bool NoReturn = Record[1];
     unsigned RegParm = Record[2];
@@ -2421,11 +2422,11 @@
                                                           CallConv));
   }
 
-  case pch::TYPE_UNRESOLVED_USING:
+  case TYPE_UNRESOLVED_USING:
     return Context->getTypeDeclType(
              cast<UnresolvedUsingTypenameDecl>(GetDecl(Record[0])));
 
-  case pch::TYPE_TYPEDEF: {
+  case TYPE_TYPEDEF: {
     if (Record.size() != 2) {
       Error("incorrect encoding of typedef type");
       return QualType();
@@ -2435,10 +2436,10 @@
     return Context->getTypedefType(Decl, Canonical);
   }
 
-  case pch::TYPE_TYPEOF_EXPR:
+  case TYPE_TYPEOF_EXPR:
     return Context->getTypeOfExprType(ReadExpr(DeclsCursor));
 
-  case pch::TYPE_TYPEOF: {
+  case TYPE_TYPEOF: {
     if (Record.size() != 1) {
       Error("incorrect encoding of typeof(type) in AST file");
       return QualType();
@@ -2447,10 +2448,10 @@
     return Context->getTypeOfType(UnderlyingType);
   }
 
-  case pch::TYPE_DECLTYPE:
+  case TYPE_DECLTYPE:
     return Context->getDecltypeType(ReadExpr(DeclsCursor));
 
-  case pch::TYPE_RECORD: {
+  case TYPE_RECORD: {
     if (Record.size() != 2) {
       Error("incorrect encoding of record type");
       return QualType();
@@ -2461,7 +2462,7 @@
     return T;
   }
 
-  case pch::TYPE_ENUM: {
+  case TYPE_ENUM: {
     if (Record.size() != 2) {
       Error("incorrect encoding of enum type");
       return QualType();
@@ -2472,7 +2473,7 @@
     return T;
   }
 
-  case pch::TYPE_ELABORATED: {
+  case TYPE_ELABORATED: {
     unsigned Idx = 0;
     ElaboratedTypeKeyword Keyword = (ElaboratedTypeKeyword)Record[Idx++];
     NestedNameSpecifier *NNS = ReadNestedNameSpecifier(Record, Idx);
@@ -2480,13 +2481,13 @@
     return Context->getElaboratedType(Keyword, NNS, NamedType);
   }
 
-  case pch::TYPE_OBJC_INTERFACE: {
+  case TYPE_OBJC_INTERFACE: {
     unsigned Idx = 0;
     ObjCInterfaceDecl *ItfD = cast<ObjCInterfaceDecl>(GetDecl(Record[Idx++]));
     return Context->getObjCInterfaceType(ItfD);
   }
 
-  case pch::TYPE_OBJC_OBJECT: {
+  case TYPE_OBJC_OBJECT: {
     unsigned Idx = 0;
     QualType Base = GetType(Record[Idx++]);
     unsigned NumProtos = Record[Idx++];
@@ -2496,13 +2497,13 @@
     return Context->getObjCObjectType(Base, Protos.data(), NumProtos);    
   }
 
-  case pch::TYPE_OBJC_OBJECT_POINTER: {
+  case TYPE_OBJC_OBJECT_POINTER: {
     unsigned Idx = 0;
     QualType Pointee = GetType(Record[Idx++]);
     return Context->getObjCObjectPointerType(Pointee);
   }
 
-  case pch::TYPE_SUBST_TEMPLATE_TYPE_PARM: {
+  case TYPE_SUBST_TEMPLATE_TYPE_PARM: {
     unsigned Idx = 0;
     QualType Parm = GetType(Record[Idx++]);
     QualType Replacement = GetType(Record[Idx++]);
@@ -2511,7 +2512,7 @@
                                             Replacement);
   }
 
-  case pch::TYPE_INJECTED_CLASS_NAME: {
+  case TYPE_INJECTED_CLASS_NAME: {
     CXXRecordDecl *D = cast<CXXRecordDecl>(GetDecl(Record[0]));
     QualType TST = GetType(Record[1]); // probably derivable
     // FIXME: ASTContext::getInjectedClassNameType is not currently suitable
@@ -2520,7 +2521,7 @@
       QualType(new (*Context, TypeAlignment) InjectedClassNameType(D, TST), 0);
   }
   
-  case pch::TYPE_TEMPLATE_TYPE_PARM: {
+  case TYPE_TEMPLATE_TYPE_PARM: {
     unsigned Idx = 0;
     unsigned Depth = Record[Idx++];
     unsigned Index = Record[Idx++];
@@ -2529,7 +2530,7 @@
     return Context->getTemplateTypeParmType(Depth, Index, Pack, Name);
   }
   
-  case pch::TYPE_DEPENDENT_NAME: {
+  case TYPE_DEPENDENT_NAME: {
     unsigned Idx = 0;
     ElaboratedTypeKeyword Keyword = (ElaboratedTypeKeyword)Record[Idx++];
     NestedNameSpecifier *NNS = ReadNestedNameSpecifier(Record, Idx);
@@ -2538,7 +2539,7 @@
     return Context->getDependentNameType(Keyword, NNS, Name, Canon);
   }
   
-  case pch::TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION: {
+  case TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION: {
     unsigned Idx = 0;
     ElaboratedTypeKeyword Keyword = (ElaboratedTypeKeyword)Record[Idx++];
     NestedNameSpecifier *NNS = ReadNestedNameSpecifier(Record, Idx);
@@ -2552,7 +2553,7 @@
                                                       Args.size(), Args.data());
   }
   
-  case pch::TYPE_DEPENDENT_SIZED_ARRAY: {
+  case TYPE_DEPENDENT_SIZED_ARRAY: {
     unsigned Idx = 0;
 
     // ArrayType
@@ -2569,7 +2570,7 @@
                                                IndexTypeQuals, Brackets);
   }
 
-  case pch::TYPE_TEMPLATE_SPECIALIZATION: {
+  case TYPE_TEMPLATE_SPECIALIZATION: {
     unsigned Idx = 0;
     bool IsDependent = Record[Idx++];
     TemplateName Name = ReadTemplateName(Record, Idx);
@@ -2787,54 +2788,54 @@
   return TInfo;
 }
 
-QualType ASTReader::GetType(pch::TypeID ID) {
+QualType ASTReader::GetType(TypeID ID) {
   unsigned FastQuals = ID & Qualifiers::FastMask;
   unsigned Index = ID >> Qualifiers::FastWidth;
 
-  if (Index < pch::NUM_PREDEF_TYPE_IDS) {
+  if (Index < NUM_PREDEF_TYPE_IDS) {
     QualType T;
-    switch ((pch::PredefinedTypeIDs)Index) {
-    case pch::PREDEF_TYPE_NULL_ID: return QualType();
-    case pch::PREDEF_TYPE_VOID_ID: T = Context->VoidTy; break;
-    case pch::PREDEF_TYPE_BOOL_ID: T = Context->BoolTy; break;
+    switch ((PredefinedTypeIDs)Index) {
+    case PREDEF_TYPE_NULL_ID: return QualType();
+    case PREDEF_TYPE_VOID_ID: T = Context->VoidTy; break;
+    case PREDEF_TYPE_BOOL_ID: T = Context->BoolTy; break;
 
-    case pch::PREDEF_TYPE_CHAR_U_ID:
-    case pch::PREDEF_TYPE_CHAR_S_ID:
+    case PREDEF_TYPE_CHAR_U_ID:
+    case PREDEF_TYPE_CHAR_S_ID:
       // FIXME: Check that the signedness of CharTy is correct!
       T = Context->CharTy;
       break;
 
-    case pch::PREDEF_TYPE_UCHAR_ID:      T = Context->UnsignedCharTy;     break;
-    case pch::PREDEF_TYPE_USHORT_ID:     T = Context->UnsignedShortTy;    break;
-    case pch::PREDEF_TYPE_UINT_ID:       T = Context->UnsignedIntTy;      break;
-    case pch::PREDEF_TYPE_ULONG_ID:      T = Context->UnsignedLongTy;     break;
-    case pch::PREDEF_TYPE_ULONGLONG_ID:  T = Context->UnsignedLongLongTy; break;
-    case pch::PREDEF_TYPE_UINT128_ID:    T = Context->UnsignedInt128Ty;   break;
-    case pch::PREDEF_TYPE_SCHAR_ID:      T = Context->SignedCharTy;       break;
-    case pch::PREDEF_TYPE_WCHAR_ID:      T = Context->WCharTy;            break;
-    case pch::PREDEF_TYPE_SHORT_ID:      T = Context->ShortTy;            break;
-    case pch::PREDEF_TYPE_INT_ID:        T = Context->IntTy;              break;
-    case pch::PREDEF_TYPE_LONG_ID:       T = Context->LongTy;             break;
-    case pch::PREDEF_TYPE_LONGLONG_ID:   T = Context->LongLongTy;         break;
-    case pch::PREDEF_TYPE_INT128_ID:     T = Context->Int128Ty;           break;
-    case pch::PREDEF_TYPE_FLOAT_ID:      T = Context->FloatTy;            break;
-    case pch::PREDEF_TYPE_DOUBLE_ID:     T = Context->DoubleTy;           break;
-    case pch::PREDEF_TYPE_LONGDOUBLE_ID: T = Context->LongDoubleTy;       break;
-    case pch::PREDEF_TYPE_OVERLOAD_ID:   T = Context->OverloadTy;         break;
-    case pch::PREDEF_TYPE_DEPENDENT_ID:  T = Context->DependentTy;        break;
-    case pch::PREDEF_TYPE_NULLPTR_ID:    T = Context->NullPtrTy;          break;
-    case pch::PREDEF_TYPE_CHAR16_ID:     T = Context->Char16Ty;           break;
-    case pch::PREDEF_TYPE_CHAR32_ID:     T = Context->Char32Ty;           break;
-    case pch::PREDEF_TYPE_OBJC_ID:       T = Context->ObjCBuiltinIdTy;    break;
-    case pch::PREDEF_TYPE_OBJC_CLASS:    T = Context->ObjCBuiltinClassTy; break;
-    case pch::PREDEF_TYPE_OBJC_SEL:      T = Context->ObjCBuiltinSelTy;   break;
+    case PREDEF_TYPE_UCHAR_ID:      T = Context->UnsignedCharTy;     break;
+    case PREDEF_TYPE_USHORT_ID:     T = Context->UnsignedShortTy;    break;
+    case PREDEF_TYPE_UINT_ID:       T = Context->UnsignedIntTy;      break;
+    case PREDEF_TYPE_ULONG_ID:      T = Context->UnsignedLongTy;     break;
+    case PREDEF_TYPE_ULONGLONG_ID:  T = Context->UnsignedLongLongTy; break;
+    case PREDEF_TYPE_UINT128_ID:    T = Context->UnsignedInt128Ty;   break;
+    case PREDEF_TYPE_SCHAR_ID:      T = Context->SignedCharTy;       break;
+    case PREDEF_TYPE_WCHAR_ID:      T = Context->WCharTy;            break;
+    case PREDEF_TYPE_SHORT_ID:      T = Context->ShortTy;            break;
+    case PREDEF_TYPE_INT_ID:        T = Context->IntTy;              break;
+    case PREDEF_TYPE_LONG_ID:       T = Context->LongTy;             break;
+    case PREDEF_TYPE_LONGLONG_ID:   T = Context->LongLongTy;         break;
+    case PREDEF_TYPE_INT128_ID:     T = Context->Int128Ty;           break;
+    case PREDEF_TYPE_FLOAT_ID:      T = Context->FloatTy;            break;
+    case PREDEF_TYPE_DOUBLE_ID:     T = Context->DoubleTy;           break;
+    case PREDEF_TYPE_LONGDOUBLE_ID: T = Context->LongDoubleTy;       break;
+    case PREDEF_TYPE_OVERLOAD_ID:   T = Context->OverloadTy;         break;
+    case PREDEF_TYPE_DEPENDENT_ID:  T = Context->DependentTy;        break;
+    case PREDEF_TYPE_NULLPTR_ID:    T = Context->NullPtrTy;          break;
+    case PREDEF_TYPE_CHAR16_ID:     T = Context->Char16Ty;           break;
+    case PREDEF_TYPE_CHAR32_ID:     T = Context->Char32Ty;           break;
+    case PREDEF_TYPE_OBJC_ID:       T = Context->ObjCBuiltinIdTy;    break;
+    case PREDEF_TYPE_OBJC_CLASS:    T = Context->ObjCBuiltinClassTy; break;
+    case PREDEF_TYPE_OBJC_SEL:      T = Context->ObjCBuiltinSelTy;   break;
     }
 
     assert(!T.isNull() && "Unknown predefined type");
     return T.withFastQualifiers(FastQuals);
   }
 
-  Index -= pch::NUM_PREDEF_TYPE_IDS;
+  Index -= NUM_PREDEF_TYPE_IDS;
   assert(Index < TypesLoaded.size() && "Type index out-of-range");
   if (TypesLoaded[Index].isNull()) {
     TypesLoaded[Index] = ReadTypeRecord(Index);
@@ -2900,7 +2901,7 @@
   return cast<TranslationUnitDecl>(DeclsLoaded[0]);
 }
 
-Decl *ASTReader::GetDecl(pch::DeclID ID) {
+Decl *ASTReader::GetDecl(DeclID ID) {
   if (ID == 0)
     return 0;
 
@@ -2954,7 +2955,7 @@
       continue;
 
     // Load all of the declaration IDs
-    for (const pch::DeclID *ID = I->LexicalDecls,
+    for (const DeclID *ID = I->LexicalDecls,
                            *IDE = ID + I->NumLexicalDecls;
          ID != IDE; ++ID)
       Decls.push_back(GetDecl(*ID));
@@ -2992,7 +2993,7 @@
     RecordData Record;
     unsigned Code = DeclsCursor.ReadCode();
     unsigned RecCode = DeclsCursor.ReadRecord(Code, Record);
-    if (RecCode != pch::DECL_CONTEXT_VISIBLE) {
+    if (RecCode != DECL_CONTEXT_VISIBLE) {
       Error("Expected visible block");
       return DeclContext::lookup_result(DeclContext::lookup_iterator(),
                                         DeclContext::lookup_iterator());

Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Aug 18 18:57:32 2010
@@ -21,7 +21,7 @@
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/Expr.h"
 using namespace clang;
-
+using namespace clang::serialization;
 
 //===----------------------------------------------------------------------===//
 // Declaration deserialization
@@ -31,16 +31,16 @@
   class ASTDeclReader : public DeclVisitor<ASTDeclReader, void> {
     ASTReader &Reader;
     llvm::BitstreamCursor &Cursor;
-    const pch::DeclID ThisDeclID;
+    const DeclID ThisDeclID;
     const ASTReader::RecordData &Record;
     unsigned &Idx;
-    pch::TypeID TypeIDForTypeDecl;
+    TypeID TypeIDForTypeDecl;
 
     uint64_t GetCurrentCursorOffset();
 
   public:
     ASTDeclReader(ASTReader &Reader, llvm::BitstreamCursor &Cursor,
-                  pch::DeclID thisDeclID, const ASTReader::RecordData &Record,
+                  DeclID thisDeclID, const ASTReader::RecordData &Record,
                   unsigned &Idx)
       : Reader(Reader), Cursor(Cursor), ThisDeclID(thisDeclID), Record(Record),
         Idx(Idx), TypeIDForTypeDecl(0) { }
@@ -1103,7 +1103,7 @@
   RecordData Record;
   unsigned Idx = 0;
   unsigned RecCode = DeclsCursor.ReadRecord(Code, Record);
-  assert(RecCode == pch::DECL_ATTR && "Expected attribute record");
+  assert(RecCode == DECL_ATTR && "Expected attribute record");
   (void)RecCode;
 
   while (Idx < Record.size()) {
@@ -1155,7 +1155,7 @@
 
 /// \brief Get the correct cursor and offset for loading a type.
 ASTReader::RecordLocation
-ASTReader::DeclCursorForIndex(unsigned Index, pch::DeclID ID) {
+ASTReader::DeclCursorForIndex(unsigned Index, DeclID ID) {
   // See if there's an override.
   DeclReplacementMap::iterator It = ReplacedDecls.find(ID);
   if (It != ReplacedDecls.end())
@@ -1173,7 +1173,7 @@
 }
 
 /// \brief Read the declaration at the given offset from the AST file.
-Decl *ASTReader::ReadDeclRecord(unsigned Index, pch::DeclID ID) {
+Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
   RecordLocation Loc = DeclCursorForIndex(Index, ID);
   llvm::BitstreamCursor &DeclsCursor = *Loc.first;
   // Keep track of where we are in the stream, then jump back there
@@ -1192,191 +1192,191 @@
   ASTDeclReader Reader(*this, DeclsCursor, ID, Record, Idx);
 
   Decl *D = 0;
-  switch ((pch::DeclCode)DeclsCursor.ReadRecord(Code, Record)) {
-  case pch::DECL_ATTR:
-  case pch::DECL_CONTEXT_LEXICAL:
-  case pch::DECL_CONTEXT_VISIBLE:
+  switch ((DeclCode)DeclsCursor.ReadRecord(Code, Record)) {
+  case DECL_ATTR:
+  case DECL_CONTEXT_LEXICAL:
+  case DECL_CONTEXT_VISIBLE:
     assert(false && "Record cannot be de-serialized with ReadDeclRecord");
     break;
-  case pch::DECL_TRANSLATION_UNIT:
+  case DECL_TRANSLATION_UNIT:
     assert(Index == 0 && "Translation unit must be at index 0");
     D = Context->getTranslationUnitDecl();
     break;
-  case pch::DECL_TYPEDEF:
+  case DECL_TYPEDEF:
     D = TypedefDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
-  case pch::DECL_ENUM:
+  case DECL_ENUM:
     D = EnumDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_RECORD:
+  case DECL_RECORD:
     D = RecordDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_ENUM_CONSTANT:
+  case DECL_ENUM_CONSTANT:
     D = EnumConstantDecl::Create(*Context, 0, SourceLocation(), 0, QualType(),
                                  0, llvm::APSInt());
     break;
-  case pch::DECL_FUNCTION:
+  case DECL_FUNCTION:
     D = FunctionDecl::Create(*Context, 0, SourceLocation(), DeclarationName(),
                              QualType(), 0);
     break;
-  case pch::DECL_LINKAGE_SPEC:
+  case DECL_LINKAGE_SPEC:
     D = LinkageSpecDecl::Create(*Context, 0, SourceLocation(),
                                 (LinkageSpecDecl::LanguageIDs)0,
                                 false);
     break;
-  case pch::DECL_NAMESPACE:
+  case DECL_NAMESPACE:
     D = NamespaceDecl::Create(*Context, 0, SourceLocation(), 0);
     break;
-  case pch::DECL_NAMESPACE_ALIAS:
+  case DECL_NAMESPACE_ALIAS:
     D = NamespaceAliasDecl::Create(*Context, 0, SourceLocation(),
                                    SourceLocation(), 0, SourceRange(), 0,
                                    SourceLocation(), 0);
     break;
-  case pch::DECL_USING:
+  case DECL_USING:
     D = UsingDecl::Create(*Context, 0, SourceRange(), SourceLocation(),
                           0, DeclarationNameInfo(), false);
     break;
-  case pch::DECL_USING_SHADOW:
+  case DECL_USING_SHADOW:
     D = UsingShadowDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
-  case pch::DECL_USING_DIRECTIVE:
+  case DECL_USING_DIRECTIVE:
     D = UsingDirectiveDecl::Create(*Context, 0, SourceLocation(),
                                    SourceLocation(), SourceRange(), 0,
                                    SourceLocation(), 0, 0);
     break;
-  case pch::DECL_UNRESOLVED_USING_VALUE:
+  case DECL_UNRESOLVED_USING_VALUE:
     D = UnresolvedUsingValueDecl::Create(*Context, 0, SourceLocation(),
                                          SourceRange(), 0,
                                          DeclarationNameInfo());
     break;
-  case pch::DECL_UNRESOLVED_USING_TYPENAME:
+  case DECL_UNRESOLVED_USING_TYPENAME:
     D = UnresolvedUsingTypenameDecl::Create(*Context, 0, SourceLocation(),
                                             SourceLocation(), SourceRange(),
                                             0, SourceLocation(),
                                             DeclarationName());
     break;
-  case pch::DECL_CXX_RECORD:
+  case DECL_CXX_RECORD:
     D = CXXRecordDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_CXX_METHOD:
+  case DECL_CXX_METHOD:
     D = CXXMethodDecl::Create(*Context, 0, DeclarationNameInfo(),
                               QualType(), 0);
     break;
-  case pch::DECL_CXX_CONSTRUCTOR:
+  case DECL_CXX_CONSTRUCTOR:
     D = CXXConstructorDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_CXX_DESTRUCTOR:
+  case DECL_CXX_DESTRUCTOR:
     D = CXXDestructorDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_CXX_CONVERSION:
+  case DECL_CXX_CONVERSION:
     D = CXXConversionDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_ACCESS_SPEC:
+  case DECL_ACCESS_SPEC:
     D = AccessSpecDecl::Create(*Context, AS_none, 0, SourceLocation(),
                                SourceLocation());
     break;
-  case pch::DECL_FRIEND:
+  case DECL_FRIEND:
     D = FriendDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_FRIEND_TEMPLATE:
+  case DECL_FRIEND_TEMPLATE:
     D = FriendTemplateDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_CLASS_TEMPLATE:
+  case DECL_CLASS_TEMPLATE:
     D = ClassTemplateDecl::Create(*Context, 0, SourceLocation(),
                                   DeclarationName(), 0, 0, 0);
     break;
-  case pch::DECL_CLASS_TEMPLATE_SPECIALIZATION:
+  case DECL_CLASS_TEMPLATE_SPECIALIZATION:
     D = ClassTemplateSpecializationDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION:
+  case DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION:
     D = ClassTemplatePartialSpecializationDecl::Create(*Context,
                                                             Decl::EmptyShell());
     break;
-  case pch::DECL_FUNCTION_TEMPLATE:
+  case DECL_FUNCTION_TEMPLATE:
     D = FunctionTemplateDecl::Create(*Context, 0, SourceLocation(),
                                      DeclarationName(), 0, 0);
     break;
-  case pch::DECL_TEMPLATE_TYPE_PARM:
+  case DECL_TEMPLATE_TYPE_PARM:
     D = TemplateTypeParmDecl::Create(*Context, Decl::EmptyShell());
     break;
-  case pch::DECL_NON_TYPE_TEMPLATE_PARM:
+  case DECL_NON_TYPE_TEMPLATE_PARM:
     D = NonTypeTemplateParmDecl::Create(*Context, 0, SourceLocation(), 0,0,0,
                                         QualType(),0);
     break;
-  case pch::DECL_TEMPLATE_TEMPLATE_PARM:
+  case DECL_TEMPLATE_TEMPLATE_PARM:
     D = TemplateTemplateParmDecl::Create(*Context, 0, SourceLocation(),0,0,0,0);
     break;
-  case pch::DECL_STATIC_ASSERT:
+  case DECL_STATIC_ASSERT:
     D = StaticAssertDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
 
-  case pch::DECL_OBJC_METHOD:
+  case DECL_OBJC_METHOD:
     D = ObjCMethodDecl::Create(*Context, SourceLocation(), SourceLocation(),
                                Selector(), QualType(), 0, 0);
     break;
-  case pch::DECL_OBJC_INTERFACE:
+  case DECL_OBJC_INTERFACE:
     D = ObjCInterfaceDecl::Create(*Context, 0, SourceLocation(), 0);
     break;
-  case pch::DECL_OBJC_IVAR:
+  case DECL_OBJC_IVAR:
     D = ObjCIvarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
                              ObjCIvarDecl::None);
     break;
-  case pch::DECL_OBJC_PROTOCOL:
+  case DECL_OBJC_PROTOCOL:
     D = ObjCProtocolDecl::Create(*Context, 0, SourceLocation(), 0);
     break;
-  case pch::DECL_OBJC_AT_DEFS_FIELD:
+  case DECL_OBJC_AT_DEFS_FIELD:
     D = ObjCAtDefsFieldDecl::Create(*Context, 0, SourceLocation(), 0,
                                     QualType(), 0);
     break;
-  case pch::DECL_OBJC_CLASS:
+  case DECL_OBJC_CLASS:
     D = ObjCClassDecl::Create(*Context, 0, SourceLocation());
     break;
-  case pch::DECL_OBJC_FORWARD_PROTOCOL:
+  case DECL_OBJC_FORWARD_PROTOCOL:
     D = ObjCForwardProtocolDecl::Create(*Context, 0, SourceLocation());
     break;
-  case pch::DECL_OBJC_CATEGORY:
+  case DECL_OBJC_CATEGORY:
     D = ObjCCategoryDecl::Create(*Context, 0, SourceLocation(), 
                                  SourceLocation(), SourceLocation(), 0);
     break;
-  case pch::DECL_OBJC_CATEGORY_IMPL:
+  case DECL_OBJC_CATEGORY_IMPL:
     D = ObjCCategoryImplDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
-  case pch::DECL_OBJC_IMPLEMENTATION:
+  case DECL_OBJC_IMPLEMENTATION:
     D = ObjCImplementationDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
-  case pch::DECL_OBJC_COMPATIBLE_ALIAS:
+  case DECL_OBJC_COMPATIBLE_ALIAS:
     D = ObjCCompatibleAliasDecl::Create(*Context, 0, SourceLocation(), 0, 0);
     break;
-  case pch::DECL_OBJC_PROPERTY:
+  case DECL_OBJC_PROPERTY:
     D = ObjCPropertyDecl::Create(*Context, 0, SourceLocation(), 0, SourceLocation(),
                                  0);
     break;
-  case pch::DECL_OBJC_PROPERTY_IMPL:
+  case DECL_OBJC_PROPERTY_IMPL:
     D = ObjCPropertyImplDecl::Create(*Context, 0, SourceLocation(),
                                      SourceLocation(), 0,
                                      ObjCPropertyImplDecl::Dynamic, 0);
     break;
-  case pch::DECL_FIELD:
+  case DECL_FIELD:
     D = FieldDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0, 0,
                           false);
     break;
-  case pch::DECL_VAR:
+  case DECL_VAR:
     D = VarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
                         VarDecl::None, VarDecl::None);
     break;
 
-  case pch::DECL_IMPLICIT_PARAM:
+  case DECL_IMPLICIT_PARAM:
     D = ImplicitParamDecl::Create(*Context, 0, SourceLocation(), 0, QualType());
     break;
 
-  case pch::DECL_PARM_VAR:
+  case DECL_PARM_VAR:
     D = ParmVarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
                             VarDecl::None, VarDecl::None, 0);
     break;
-  case pch::DECL_FILE_SCOPE_ASM:
+  case DECL_FILE_SCOPE_ASM:
     D = FileScopeAsmDecl::Create(*Context, 0, SourceLocation(), 0);
     break;
-  case pch::DECL_BLOCK:
+  case DECL_BLOCK:
     D = BlockDecl::Create(*Context, 0, SourceLocation());
     break;
   }
@@ -1427,13 +1427,13 @@
     unsigned BlobLen;
     unsigned Code = Cursor.ReadCode();
     unsigned RecCode = Cursor.ReadRecord(Code, Record, &Blob, &BlobLen);
-    if (RecCode != pch::DECL_CONTEXT_LEXICAL) {
+    if (RecCode != DECL_CONTEXT_LEXICAL) {
       Error("Expected lexical block");
       return true;
     }
 
-    Info.LexicalDecls = reinterpret_cast<const pch::DeclID*>(Blob);
-    Info.NumLexicalDecls = BlobLen / sizeof(pch::DeclID);
+    Info.LexicalDecls = reinterpret_cast<const DeclID*>(Blob);
+    Info.NumLexicalDecls = BlobLen / sizeof(DeclID);
   } else {
     Info.LexicalDecls = 0;
     Info.NumLexicalDecls = 0;

Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Wed Aug 18 18:57:32 2010
@@ -16,6 +16,7 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/StmtVisitor.h"
 using namespace clang;
+using namespace clang::serialization;
 
 namespace clang {
 
@@ -653,8 +654,8 @@
 
   llvm::SmallVector<Designator, 4> Designators;
   while (Idx < Record.size()) {
-    switch ((pch::DesignatorTypes)Record[Idx++]) {
-    case pch::DESIG_FIELD_DECL: {
+    switch ((DesignatorTypes)Record[Idx++]) {
+    case DESIG_FIELD_DECL: {
       FieldDecl *Field = cast<FieldDecl>(Reader.GetDecl(Record[Idx++]));
       SourceLocation DotLoc
         = SourceLocation::getFromRawEncoding(Record[Idx++]);
@@ -666,7 +667,7 @@
       break;
     }
 
-    case pch::DESIG_FIELD_NAME: {
+    case DESIG_FIELD_NAME: {
       const IdentifierInfo *Name = Reader.GetIdentifierInfo(Record, Idx);
       SourceLocation DotLoc
         = SourceLocation::getFromRawEncoding(Record[Idx++]);
@@ -676,7 +677,7 @@
       break;
     }
 
-    case pch::DESIG_ARRAY: {
+    case DESIG_ARRAY: {
       unsigned Index = Record[Idx++];
       SourceLocation LBracketLoc
         = SourceLocation::getFromRawEncoding(Record[Idx++]);
@@ -686,7 +687,7 @@
       break;
     }
 
-    case pch::DESIG_ARRAY_RANGE: {
+    case DESIG_ARRAY_RANGE: {
       unsigned Index = Record[Idx++];
       SourceLocation LBracketLoc
         = SourceLocation::getFromRawEncoding(Record[Idx++]);
@@ -1312,145 +1313,145 @@
     Idx = 0;
     Record.clear();
     bool Finished = false;
-    switch ((pch::StmtCode)Cursor.ReadRecord(Code, Record)) {
-    case pch::STMT_STOP:
+    switch ((StmtCode)Cursor.ReadRecord(Code, Record)) {
+    case STMT_STOP:
       Finished = true;
       break;
 
-    case pch::STMT_NULL_PTR:
+    case STMT_NULL_PTR:
       S = 0;
       break;
 
-    case pch::STMT_NULL:
+    case STMT_NULL:
       S = new (Context) NullStmt(Empty);
       break;
 
-    case pch::STMT_COMPOUND:
+    case STMT_COMPOUND:
       S = new (Context) CompoundStmt(Empty);
       break;
 
-    case pch::STMT_CASE:
+    case STMT_CASE:
       S = new (Context) CaseStmt(Empty);
       break;
 
-    case pch::STMT_DEFAULT:
+    case STMT_DEFAULT:
       S = new (Context) DefaultStmt(Empty);
       break;
 
-    case pch::STMT_LABEL:
+    case STMT_LABEL:
       S = new (Context) LabelStmt(Empty);
       break;
 
-    case pch::STMT_IF:
+    case STMT_IF:
       S = new (Context) IfStmt(Empty);
       break;
 
-    case pch::STMT_SWITCH:
+    case STMT_SWITCH:
       S = new (Context) SwitchStmt(Empty);
       break;
 
-    case pch::STMT_WHILE:
+    case STMT_WHILE:
       S = new (Context) WhileStmt(Empty);
       break;
 
-    case pch::STMT_DO:
+    case STMT_DO:
       S = new (Context) DoStmt(Empty);
       break;
 
-    case pch::STMT_FOR:
+    case STMT_FOR:
       S = new (Context) ForStmt(Empty);
       break;
 
-    case pch::STMT_GOTO:
+    case STMT_GOTO:
       S = new (Context) GotoStmt(Empty);
       break;
 
-    case pch::STMT_INDIRECT_GOTO:
+    case STMT_INDIRECT_GOTO:
       S = new (Context) IndirectGotoStmt(Empty);
       break;
 
-    case pch::STMT_CONTINUE:
+    case STMT_CONTINUE:
       S = new (Context) ContinueStmt(Empty);
       break;
 
-    case pch::STMT_BREAK:
+    case STMT_BREAK:
       S = new (Context) BreakStmt(Empty);
       break;
 
-    case pch::STMT_RETURN:
+    case STMT_RETURN:
       S = new (Context) ReturnStmt(Empty);
       break;
 
-    case pch::STMT_DECL:
+    case STMT_DECL:
       S = new (Context) DeclStmt(Empty);
       break;
 
-    case pch::STMT_ASM:
+    case STMT_ASM:
       S = new (Context) AsmStmt(Empty);
       break;
 
-    case pch::EXPR_PREDEFINED:
+    case EXPR_PREDEFINED:
       S = new (Context) PredefinedExpr(Empty);
       break;
 
-    case pch::EXPR_DECL_REF:
+    case EXPR_DECL_REF:
       S = DeclRefExpr::CreateEmpty(*Context,
                          /*HasQualifier=*/Record[ASTStmtReader::NumExprFields],
                   /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields + 1]);
       break;
 
-    case pch::EXPR_INTEGER_LITERAL:
+    case EXPR_INTEGER_LITERAL:
       S = new (Context) IntegerLiteral(Empty);
       break;
 
-    case pch::EXPR_FLOATING_LITERAL:
+    case EXPR_FLOATING_LITERAL:
       S = new (Context) FloatingLiteral(Empty);
       break;
 
-    case pch::EXPR_IMAGINARY_LITERAL:
+    case EXPR_IMAGINARY_LITERAL:
       S = new (Context) ImaginaryLiteral(Empty);
       break;
 
-    case pch::EXPR_STRING_LITERAL:
+    case EXPR_STRING_LITERAL:
       S = StringLiteral::CreateEmpty(*Context,
                                      Record[ASTStmtReader::NumExprFields + 1]);
       break;
 
-    case pch::EXPR_CHARACTER_LITERAL:
+    case EXPR_CHARACTER_LITERAL:
       S = new (Context) CharacterLiteral(Empty);
       break;
 
-    case pch::EXPR_PAREN:
+    case EXPR_PAREN:
       S = new (Context) ParenExpr(Empty);
       break;
 
-    case pch::EXPR_PAREN_LIST:
+    case EXPR_PAREN_LIST:
       S = new (Context) ParenListExpr(Empty);
       break;
 
-    case pch::EXPR_UNARY_OPERATOR:
+    case EXPR_UNARY_OPERATOR:
       S = new (Context) UnaryOperator(Empty);
       break;
 
-    case pch::EXPR_OFFSETOF:
+    case EXPR_OFFSETOF:
       S = OffsetOfExpr::CreateEmpty(*Context, 
                                     Record[ASTStmtReader::NumExprFields],
                                     Record[ASTStmtReader::NumExprFields + 1]);
       break;
         
-    case pch::EXPR_SIZEOF_ALIGN_OF:
+    case EXPR_SIZEOF_ALIGN_OF:
       S = new (Context) SizeOfAlignOfExpr(Empty);
       break;
 
-    case pch::EXPR_ARRAY_SUBSCRIPT:
+    case EXPR_ARRAY_SUBSCRIPT:
       S = new (Context) ArraySubscriptExpr(Empty);
       break;
 
-    case pch::EXPR_CALL:
+    case EXPR_CALL:
       S = new (Context) CallExpr(*Context, Stmt::CallExprClass, Empty);
       break;
 
-    case pch::EXPR_MEMBER: {
+    case EXPR_MEMBER: {
       // We load everything here and fully initialize it at creation.
       // That way we can use MemberExpr::Create and don't have to duplicate its
       // logic with a MemberExpr::CreateEmpty.
@@ -1490,207 +1491,207 @@
       break;
     }
 
-    case pch::EXPR_BINARY_OPERATOR:
+    case EXPR_BINARY_OPERATOR:
       S = new (Context) BinaryOperator(Empty);
       break;
 
-    case pch::EXPR_COMPOUND_ASSIGN_OPERATOR:
+    case EXPR_COMPOUND_ASSIGN_OPERATOR:
       S = new (Context) CompoundAssignOperator(Empty);
       break;
 
-    case pch::EXPR_CONDITIONAL_OPERATOR:
+    case EXPR_CONDITIONAL_OPERATOR:
       S = new (Context) ConditionalOperator(Empty);
       break;
 
-    case pch::EXPR_IMPLICIT_CAST:
+    case EXPR_IMPLICIT_CAST:
       S = ImplicitCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_CSTYLE_CAST:
+    case EXPR_CSTYLE_CAST:
       S = CStyleCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_COMPOUND_LITERAL:
+    case EXPR_COMPOUND_LITERAL:
       S = new (Context) CompoundLiteralExpr(Empty);
       break;
 
-    case pch::EXPR_EXT_VECTOR_ELEMENT:
+    case EXPR_EXT_VECTOR_ELEMENT:
       S = new (Context) ExtVectorElementExpr(Empty);
       break;
 
-    case pch::EXPR_INIT_LIST:
+    case EXPR_INIT_LIST:
       S = new (Context) InitListExpr(*getContext(), Empty);
       break;
 
-    case pch::EXPR_DESIGNATED_INIT:
+    case EXPR_DESIGNATED_INIT:
       S = DesignatedInitExpr::CreateEmpty(*Context,
                                      Record[ASTStmtReader::NumExprFields] - 1);
 
       break;
 
-    case pch::EXPR_IMPLICIT_VALUE_INIT:
+    case EXPR_IMPLICIT_VALUE_INIT:
       S = new (Context) ImplicitValueInitExpr(Empty);
       break;
 
-    case pch::EXPR_VA_ARG:
+    case EXPR_VA_ARG:
       S = new (Context) VAArgExpr(Empty);
       break;
 
-    case pch::EXPR_ADDR_LABEL:
+    case EXPR_ADDR_LABEL:
       S = new (Context) AddrLabelExpr(Empty);
       break;
 
-    case pch::EXPR_STMT:
+    case EXPR_STMT:
       S = new (Context) StmtExpr(Empty);
       break;
 
-    case pch::EXPR_TYPES_COMPATIBLE:
+    case EXPR_TYPES_COMPATIBLE:
       S = new (Context) TypesCompatibleExpr(Empty);
       break;
 
-    case pch::EXPR_CHOOSE:
+    case EXPR_CHOOSE:
       S = new (Context) ChooseExpr(Empty);
       break;
 
-    case pch::EXPR_GNU_NULL:
+    case EXPR_GNU_NULL:
       S = new (Context) GNUNullExpr(Empty);
       break;
 
-    case pch::EXPR_SHUFFLE_VECTOR:
+    case EXPR_SHUFFLE_VECTOR:
       S = new (Context) ShuffleVectorExpr(Empty);
       break;
 
-    case pch::EXPR_BLOCK:
+    case EXPR_BLOCK:
       S = new (Context) BlockExpr(Empty);
       break;
 
-    case pch::EXPR_BLOCK_DECL_REF:
+    case EXPR_BLOCK_DECL_REF:
       S = new (Context) BlockDeclRefExpr(Empty);
       break;
 
-    case pch::EXPR_OBJC_STRING_LITERAL:
+    case EXPR_OBJC_STRING_LITERAL:
       S = new (Context) ObjCStringLiteral(Empty);
       break;
-    case pch::EXPR_OBJC_ENCODE:
+    case EXPR_OBJC_ENCODE:
       S = new (Context) ObjCEncodeExpr(Empty);
       break;
-    case pch::EXPR_OBJC_SELECTOR_EXPR:
+    case EXPR_OBJC_SELECTOR_EXPR:
       S = new (Context) ObjCSelectorExpr(Empty);
       break;
-    case pch::EXPR_OBJC_PROTOCOL_EXPR:
+    case EXPR_OBJC_PROTOCOL_EXPR:
       S = new (Context) ObjCProtocolExpr(Empty);
       break;
-    case pch::EXPR_OBJC_IVAR_REF_EXPR:
+    case EXPR_OBJC_IVAR_REF_EXPR:
       S = new (Context) ObjCIvarRefExpr(Empty);
       break;
-    case pch::EXPR_OBJC_PROPERTY_REF_EXPR:
+    case EXPR_OBJC_PROPERTY_REF_EXPR:
       S = new (Context) ObjCPropertyRefExpr(Empty);
       break;
-    case pch::EXPR_OBJC_KVC_REF_EXPR:
+    case EXPR_OBJC_KVC_REF_EXPR:
       S = new (Context) ObjCImplicitSetterGetterRefExpr(Empty);
       break;
-    case pch::EXPR_OBJC_MESSAGE_EXPR:
+    case EXPR_OBJC_MESSAGE_EXPR:
       S = ObjCMessageExpr::CreateEmpty(*Context,
                                      Record[ASTStmtReader::NumExprFields]);
       break;
-    case pch::EXPR_OBJC_SUPER_EXPR:
+    case EXPR_OBJC_SUPER_EXPR:
       S = new (Context) ObjCSuperExpr(Empty);
       break;
-    case pch::EXPR_OBJC_ISA:
+    case EXPR_OBJC_ISA:
       S = new (Context) ObjCIsaExpr(Empty);
       break;
-    case pch::STMT_OBJC_FOR_COLLECTION:
+    case STMT_OBJC_FOR_COLLECTION:
       S = new (Context) ObjCForCollectionStmt(Empty);
       break;
-    case pch::STMT_OBJC_CATCH:
+    case STMT_OBJC_CATCH:
       S = new (Context) ObjCAtCatchStmt(Empty);
       break;
-    case pch::STMT_OBJC_FINALLY:
+    case STMT_OBJC_FINALLY:
       S = new (Context) ObjCAtFinallyStmt(Empty);
       break;
-    case pch::STMT_OBJC_AT_TRY:
+    case STMT_OBJC_AT_TRY:
       S = ObjCAtTryStmt::CreateEmpty(*Context, 
                                      Record[ASTStmtReader::NumStmtFields],
                                      Record[ASTStmtReader::NumStmtFields + 1]);
       break;
-    case pch::STMT_OBJC_AT_SYNCHRONIZED:
+    case STMT_OBJC_AT_SYNCHRONIZED:
       S = new (Context) ObjCAtSynchronizedStmt(Empty);
       break;
-    case pch::STMT_OBJC_AT_THROW:
+    case STMT_OBJC_AT_THROW:
       S = new (Context) ObjCAtThrowStmt(Empty);
       break;
 
-    case pch::STMT_CXX_CATCH:
+    case STMT_CXX_CATCH:
       S = new (Context) CXXCatchStmt(Empty);
       break;
 
-    case pch::STMT_CXX_TRY:
+    case STMT_CXX_TRY:
       S = CXXTryStmt::Create(*Context, Empty,
              /*NumHandlers=*/Record[ASTStmtReader::NumStmtFields]);
       break;
 
-    case pch::EXPR_CXX_OPERATOR_CALL:
+    case EXPR_CXX_OPERATOR_CALL:
       S = new (Context) CXXOperatorCallExpr(*Context, Empty);
       break;
 
-    case pch::EXPR_CXX_MEMBER_CALL:
+    case EXPR_CXX_MEMBER_CALL:
       S = new (Context) CXXMemberCallExpr(*Context, Empty);
       break;
         
-    case pch::EXPR_CXX_CONSTRUCT:
+    case EXPR_CXX_CONSTRUCT:
       S = new (Context) CXXConstructExpr(Empty);
       break;
       
-    case pch::EXPR_CXX_TEMPORARY_OBJECT:
+    case EXPR_CXX_TEMPORARY_OBJECT:
       S = new (Context) CXXTemporaryObjectExpr(Empty);
       break;
 
-    case pch::EXPR_CXX_STATIC_CAST:
+    case EXPR_CXX_STATIC_CAST:
       S = CXXStaticCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_CXX_DYNAMIC_CAST:
+    case EXPR_CXX_DYNAMIC_CAST:
       S = CXXDynamicCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_CXX_REINTERPRET_CAST:
+    case EXPR_CXX_REINTERPRET_CAST:
       S = CXXReinterpretCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_CXX_CONST_CAST:
+    case EXPR_CXX_CONST_CAST:
       S = CXXConstCastExpr::CreateEmpty(*Context);
       break;
 
-    case pch::EXPR_CXX_FUNCTIONAL_CAST:
+    case EXPR_CXX_FUNCTIONAL_CAST:
       S = CXXFunctionalCastExpr::CreateEmpty(*Context,
                        /*PathSize*/ Record[ASTStmtReader::NumExprFields]);
       break;
 
-    case pch::EXPR_CXX_BOOL_LITERAL:
+    case EXPR_CXX_BOOL_LITERAL:
       S = new (Context) CXXBoolLiteralExpr(Empty);
       break;
 
-    case pch::EXPR_CXX_NULL_PTR_LITERAL:
+    case EXPR_CXX_NULL_PTR_LITERAL:
       S = new (Context) CXXNullPtrLiteralExpr(Empty);
       break;
-    case pch::EXPR_CXX_TYPEID_EXPR:
+    case EXPR_CXX_TYPEID_EXPR:
       S = new (Context) CXXTypeidExpr(Empty, true);
       break;
-    case pch::EXPR_CXX_TYPEID_TYPE:
+    case EXPR_CXX_TYPEID_TYPE:
       S = new (Context) CXXTypeidExpr(Empty, false);
       break;
-    case pch::EXPR_CXX_THIS:
+    case EXPR_CXX_THIS:
       S = new (Context) CXXThisExpr(Empty);
       break;
-    case pch::EXPR_CXX_THROW:
+    case EXPR_CXX_THROW:
       S = new (Context) CXXThrowExpr(Empty);
       break;
-    case pch::EXPR_CXX_DEFAULT_ARG: {
+    case EXPR_CXX_DEFAULT_ARG: {
       bool HasOtherExprStored = Record[ASTStmtReader::NumExprFields];
       if (HasOtherExprStored) {
         Expr *SubExpr = ReadSubExpr();
@@ -1699,56 +1700,56 @@
         S = new (Context) CXXDefaultArgExpr(Empty);
       break;
     }
-    case pch::EXPR_CXX_BIND_TEMPORARY:
+    case EXPR_CXX_BIND_TEMPORARY:
       S = new (Context) CXXBindTemporaryExpr(Empty);
       break;
-    case pch::EXPR_CXX_BIND_REFERENCE:
+    case EXPR_CXX_BIND_REFERENCE:
       S = new (Context) CXXBindReferenceExpr(Empty);
       break;
 
-    case pch::EXPR_CXX_SCALAR_VALUE_INIT:
+    case EXPR_CXX_SCALAR_VALUE_INIT:
       S = new (Context) CXXScalarValueInitExpr(Empty);
       break;
-    case pch::EXPR_CXX_NEW:
+    case EXPR_CXX_NEW:
       S = new (Context) CXXNewExpr(Empty);
       break;
-    case pch::EXPR_CXX_DELETE:
+    case EXPR_CXX_DELETE:
       S = new (Context) CXXDeleteExpr(Empty);
       break;
-    case pch::EXPR_CXX_PSEUDO_DESTRUCTOR:
+    case EXPR_CXX_PSEUDO_DESTRUCTOR:
       S = new (Context) CXXPseudoDestructorExpr(Empty);
       break;
         
-    case pch::EXPR_CXX_EXPR_WITH_TEMPORARIES:
+    case EXPR_CXX_EXPR_WITH_TEMPORARIES:
       S = new (Context) CXXExprWithTemporaries(Empty);
       break;
       
-    case pch::EXPR_CXX_DEPENDENT_SCOPE_MEMBER:
+    case EXPR_CXX_DEPENDENT_SCOPE_MEMBER:
       S = CXXDependentScopeMemberExpr::CreateEmpty(*Context,
                       /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
       break;
       
-    case pch::EXPR_CXX_DEPENDENT_SCOPE_DECL_REF:
+    case EXPR_CXX_DEPENDENT_SCOPE_DECL_REF:
       S = DependentScopeDeclRefExpr::CreateEmpty(*Context,
                       /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
       break;
       
-    case pch::EXPR_CXX_UNRESOLVED_CONSTRUCT:
+    case EXPR_CXX_UNRESOLVED_CONSTRUCT:
       S = CXXUnresolvedConstructExpr::CreateEmpty(*Context,
                               /*NumArgs=*/Record[ASTStmtReader::NumExprFields]);
       break;
       
-    case pch::EXPR_CXX_UNRESOLVED_MEMBER:
+    case EXPR_CXX_UNRESOLVED_MEMBER:
       S = UnresolvedMemberExpr::CreateEmpty(*Context,
                       /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
       break;
       
-    case pch::EXPR_CXX_UNRESOLVED_LOOKUP:
+    case EXPR_CXX_UNRESOLVED_LOOKUP:
       S = UnresolvedLookupExpr::CreateEmpty(*Context,
                       /*NumTemplateArgs=*/Record[ASTStmtReader::NumExprFields]);
       break;
       
-    case pch::EXPR_CXX_UNARY_TYPE_TRAIT:
+    case EXPR_CXX_UNARY_TYPE_TRAIT:
       S = new (Context) UnaryTypeTraitExpr(Empty);
       break;
     }

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Aug 18 18:57:32 2010
@@ -39,6 +39,7 @@
 #include "llvm/System/Path.h"
 #include <cstdio>
 using namespace clang;
+using namespace clang::serialization;
 
 template <typename T, typename Allocator>
 T *data(std::vector<T, Allocator> &v) {
@@ -60,10 +61,10 @@
 
   public:
     /// \brief Type code that corresponds to the record generated.
-    pch::TypeCode Code;
+    TypeCode Code;
 
     ASTTypeWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
-      : Writer(Writer), Record(Record), Code(pch::TYPE_EXT_QUAL) { }
+      : Writer(Writer), Record(Record), Code(TYPE_EXT_QUAL) { }
 
     void VisitArrayType(const ArrayType *T);
     void VisitFunctionType(const FunctionType *T);
@@ -81,33 +82,33 @@
 
 void ASTTypeWriter::VisitComplexType(const ComplexType *T) {
   Writer.AddTypeRef(T->getElementType(), Record);
-  Code = pch::TYPE_COMPLEX;
+  Code = TYPE_COMPLEX;
 }
 
 void ASTTypeWriter::VisitPointerType(const PointerType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
-  Code = pch::TYPE_POINTER;
+  Code = TYPE_POINTER;
 }
 
 void ASTTypeWriter::VisitBlockPointerType(const BlockPointerType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
-  Code = pch::TYPE_BLOCK_POINTER;
+  Code = TYPE_BLOCK_POINTER;
 }
 
 void ASTTypeWriter::VisitLValueReferenceType(const LValueReferenceType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
-  Code = pch::TYPE_LVALUE_REFERENCE;
+  Code = TYPE_LVALUE_REFERENCE;
 }
 
 void ASTTypeWriter::VisitRValueReferenceType(const RValueReferenceType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
-  Code = pch::TYPE_RVALUE_REFERENCE;
+  Code = TYPE_RVALUE_REFERENCE;
 }
 
 void ASTTypeWriter::VisitMemberPointerType(const MemberPointerType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
   Writer.AddTypeRef(QualType(T->getClass(), 0), Record);
-  Code = pch::TYPE_MEMBER_POINTER;
+  Code = TYPE_MEMBER_POINTER;
 }
 
 void ASTTypeWriter::VisitArrayType(const ArrayType *T) {
@@ -119,12 +120,12 @@
 void ASTTypeWriter::VisitConstantArrayType(const ConstantArrayType *T) {
   VisitArrayType(T);
   Writer.AddAPInt(T->getSize(), Record);
-  Code = pch::TYPE_CONSTANT_ARRAY;
+  Code = TYPE_CONSTANT_ARRAY;
 }
 
 void ASTTypeWriter::VisitIncompleteArrayType(const IncompleteArrayType *T) {
   VisitArrayType(T);
-  Code = pch::TYPE_INCOMPLETE_ARRAY;
+  Code = TYPE_INCOMPLETE_ARRAY;
 }
 
 void ASTTypeWriter::VisitVariableArrayType(const VariableArrayType *T) {
@@ -132,19 +133,19 @@
   Writer.AddSourceLocation(T->getLBracketLoc(), Record);
   Writer.AddSourceLocation(T->getRBracketLoc(), Record);
   Writer.AddStmt(T->getSizeExpr());
-  Code = pch::TYPE_VARIABLE_ARRAY;
+  Code = TYPE_VARIABLE_ARRAY;
 }
 
 void ASTTypeWriter::VisitVectorType(const VectorType *T) {
   Writer.AddTypeRef(T->getElementType(), Record);
   Record.push_back(T->getNumElements());
   Record.push_back(T->getAltiVecSpecific());
-  Code = pch::TYPE_VECTOR;
+  Code = TYPE_VECTOR;
 }
 
 void ASTTypeWriter::VisitExtVectorType(const ExtVectorType *T) {
   VisitVectorType(T);
-  Code = pch::TYPE_EXT_VECTOR;
+  Code = TYPE_EXT_VECTOR;
 }
 
 void ASTTypeWriter::VisitFunctionType(const FunctionType *T) {
@@ -158,7 +159,7 @@
 
 void ASTTypeWriter::VisitFunctionNoProtoType(const FunctionNoProtoType *T) {
   VisitFunctionType(T);
-  Code = pch::TYPE_FUNCTION_NO_PROTO;
+  Code = TYPE_FUNCTION_NO_PROTO;
 }
 
 void ASTTypeWriter::VisitFunctionProtoType(const FunctionProtoType *T) {
@@ -173,34 +174,34 @@
   Record.push_back(T->getNumExceptions());
   for (unsigned I = 0, N = T->getNumExceptions(); I != N; ++I)
     Writer.AddTypeRef(T->getExceptionType(I), Record);
-  Code = pch::TYPE_FUNCTION_PROTO;
+  Code = TYPE_FUNCTION_PROTO;
 }
 
 void ASTTypeWriter::VisitUnresolvedUsingType(const UnresolvedUsingType *T) {
   Writer.AddDeclRef(T->getDecl(), Record);
-  Code = pch::TYPE_UNRESOLVED_USING;
+  Code = TYPE_UNRESOLVED_USING;
 }
 
 void ASTTypeWriter::VisitTypedefType(const TypedefType *T) {
   Writer.AddDeclRef(T->getDecl(), Record);
   assert(!T->isCanonicalUnqualified() && "Invalid typedef ?");
   Writer.AddTypeRef(T->getCanonicalTypeInternal(), Record);
-  Code = pch::TYPE_TYPEDEF;
+  Code = TYPE_TYPEDEF;
 }
 
 void ASTTypeWriter::VisitTypeOfExprType(const TypeOfExprType *T) {
   Writer.AddStmt(T->getUnderlyingExpr());
-  Code = pch::TYPE_TYPEOF_EXPR;
+  Code = TYPE_TYPEOF_EXPR;
 }
 
 void ASTTypeWriter::VisitTypeOfType(const TypeOfType *T) {
   Writer.AddTypeRef(T->getUnderlyingType(), Record);
-  Code = pch::TYPE_TYPEOF;
+  Code = TYPE_TYPEOF;
 }
 
 void ASTTypeWriter::VisitDecltypeType(const DecltypeType *T) {
   Writer.AddStmt(T->getUnderlyingExpr());
-  Code = pch::TYPE_DECLTYPE;
+  Code = TYPE_DECLTYPE;
 }
 
 void ASTTypeWriter::VisitTagType(const TagType *T) {
@@ -212,12 +213,12 @@
 
 void ASTTypeWriter::VisitRecordType(const RecordType *T) {
   VisitTagType(T);
-  Code = pch::TYPE_RECORD;
+  Code = TYPE_RECORD;
 }
 
 void ASTTypeWriter::VisitEnumType(const EnumType *T) {
   VisitTagType(T);
-  Code = pch::TYPE_ENUM;
+  Code = TYPE_ENUM;
 }
 
 void
@@ -225,7 +226,7 @@
                                         const SubstTemplateTypeParmType *T) {
   Writer.AddTypeRef(QualType(T->getReplacedParameter(), 0), Record);
   Writer.AddTypeRef(T->getReplacementType(), Record);
-  Code = pch::TYPE_SUBST_TEMPLATE_TYPE_PARM;
+  Code = TYPE_SUBST_TEMPLATE_TYPE_PARM;
 }
 
 void
@@ -240,7 +241,7 @@
   Writer.AddTypeRef(T->isCanonicalUnqualified() ? QualType()
                                                 : T->getCanonicalTypeInternal(),
                     Record);
-  Code = pch::TYPE_TEMPLATE_SPECIALIZATION;
+  Code = TYPE_TEMPLATE_SPECIALIZATION;
 }
 
 void
@@ -248,7 +249,7 @@
   VisitArrayType(T);
   Writer.AddStmt(T->getSizeExpr());
   Writer.AddSourceRange(T->getBracketsRange(), Record);
-  Code = pch::TYPE_DEPENDENT_SIZED_ARRAY;
+  Code = TYPE_DEPENDENT_SIZED_ARRAY;
 }
 
 void
@@ -264,7 +265,7 @@
   Record.push_back(T->getIndex());
   Record.push_back(T->isParameterPack());
   Writer.AddIdentifierRef(T->getName(), Record);
-  Code = pch::TYPE_TEMPLATE_TYPE_PARM;
+  Code = TYPE_TEMPLATE_TYPE_PARM;
 }
 
 void
@@ -275,7 +276,7 @@
   Writer.AddTypeRef(T->isCanonicalUnqualified() ? QualType()
                                                 : T->getCanonicalTypeInternal(),
                     Record);
-  Code = pch::TYPE_DEPENDENT_NAME;
+  Code = TYPE_DEPENDENT_NAME;
 }
 
 void
@@ -288,25 +289,25 @@
   for (DependentTemplateSpecializationType::iterator
          I = T->begin(), E = T->end(); I != E; ++I)
     Writer.AddTemplateArgument(*I, Record);
-  Code = pch::TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION;
+  Code = TYPE_DEPENDENT_TEMPLATE_SPECIALIZATION;
 }
 
 void ASTTypeWriter::VisitElaboratedType(const ElaboratedType *T) {
   Record.push_back(T->getKeyword());
   Writer.AddNestedNameSpecifier(T->getQualifier(), Record);
   Writer.AddTypeRef(T->getNamedType(), Record);
-  Code = pch::TYPE_ELABORATED;
+  Code = TYPE_ELABORATED;
 }
 
 void ASTTypeWriter::VisitInjectedClassNameType(const InjectedClassNameType *T) {
   Writer.AddDeclRef(T->getDecl(), Record);
   Writer.AddTypeRef(T->getInjectedSpecializationType(), Record);
-  Code = pch::TYPE_INJECTED_CLASS_NAME;
+  Code = TYPE_INJECTED_CLASS_NAME;
 }
 
 void ASTTypeWriter::VisitObjCInterfaceType(const ObjCInterfaceType *T) {
   Writer.AddDeclRef(T->getDecl(), Record);
-  Code = pch::TYPE_OBJC_INTERFACE;
+  Code = TYPE_OBJC_INTERFACE;
 }
 
 void ASTTypeWriter::VisitObjCObjectType(const ObjCObjectType *T) {
@@ -315,13 +316,13 @@
   for (ObjCObjectType::qual_iterator I = T->qual_begin(),
        E = T->qual_end(); I != E; ++I)
     Writer.AddDeclRef(*I, Record);
-  Code = pch::TYPE_OBJC_OBJECT;
+  Code = TYPE_OBJC_OBJECT;
 }
 
 void
 ASTTypeWriter::VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
   Writer.AddTypeRef(T->getPointeeType(), Record);
-  Code = pch::TYPE_OBJC_OBJECT_POINTER;
+  Code = TYPE_OBJC_OBJECT_POINTER;
 }
 
 namespace {
@@ -527,7 +528,7 @@
 
 static void AddStmtsExprs(llvm::BitstreamWriter &Stream,
                           ASTWriter::RecordData &Record) {
-#define RECORD(X) EmitRecordID(pch::X, #X, Stream, Record)
+#define RECORD(X) EmitRecordID(X, #X, Stream, Record)
   RECORD(STMT_STOP);
   RECORD(STMT_NULL_PTR);
   RECORD(STMT_NULL);
@@ -610,8 +611,8 @@
   RecordData Record;
   Stream.EnterSubblock(llvm::bitc::BLOCKINFO_BLOCK_ID, 3);
 
-#define BLOCK(X) EmitBlockID(pch::X ## _ID, #X, Stream, Record)
-#define RECORD(X) EmitRecordID(pch::X, #X, Stream, Record)
+#define BLOCK(X) EmitBlockID(X ## _ID, #X, Stream, Record)
+#define RECORD(X) EmitRecordID(X, #X, Stream, Record)
 
   // AST Top-Level Block.
   BLOCK(AST_BLOCK);
@@ -759,7 +760,7 @@
   const TargetInfo &Target = Context.Target;
   BitCodeAbbrev *MetaAbbrev = new BitCodeAbbrev();
   MetaAbbrev->Add(BitCodeAbbrevOp(
-                    Chain ? pch::CHAINED_METADATA : pch::METADATA));
+                    Chain ? CHAINED_METADATA : METADATA));
   MetaAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 16)); // AST major
   MetaAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 16)); // AST minor
   MetaAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 16)); // Clang major
@@ -770,9 +771,9 @@
   unsigned MetaAbbrevCode = Stream.EmitAbbrev(MetaAbbrev);
 
   RecordData Record;
-  Record.push_back(Chain ? pch::CHAINED_METADATA : pch::METADATA);
-  Record.push_back(pch::VERSION_MAJOR);
-  Record.push_back(pch::VERSION_MINOR);
+  Record.push_back(Chain ? CHAINED_METADATA : METADATA);
+  Record.push_back(VERSION_MAJOR);
+  Record.push_back(VERSION_MINOR);
   Record.push_back(CLANG_VERSION_MAJOR);
   Record.push_back(CLANG_VERSION_MINOR);
   Record.push_back(isysroot != 0);
@@ -784,7 +785,7 @@
   SourceManager &SM = Context.getSourceManager();
   if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) {
     BitCodeAbbrev *FileAbbrev = new BitCodeAbbrev();
-    FileAbbrev->Add(BitCodeAbbrevOp(pch::ORIGINAL_FILE_NAME));
+    FileAbbrev->Add(BitCodeAbbrevOp(ORIGINAL_FILE_NAME));
     FileAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // File name
     unsigned FileAbbrevCode = Stream.EmitAbbrev(FileAbbrev);
 
@@ -796,17 +797,17 @@
     MainFileNameStr = adjustFilenameForRelocatablePCH(MainFileNameStr,
                                                       isysroot);
     RecordData Record;
-    Record.push_back(pch::ORIGINAL_FILE_NAME);
+    Record.push_back(ORIGINAL_FILE_NAME);
     Stream.EmitRecordWithBlob(FileAbbrevCode, Record, MainFileNameStr);
   }
 
   // Repository branch/version information.
   BitCodeAbbrev *RepoAbbrev = new BitCodeAbbrev();
-  RepoAbbrev->Add(BitCodeAbbrevOp(pch::VERSION_CONTROL_BRANCH_REVISION));
+  RepoAbbrev->Add(BitCodeAbbrevOp(VERSION_CONTROL_BRANCH_REVISION));
   RepoAbbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // SVN branch/tag
   unsigned RepoAbbrevCode = Stream.EmitAbbrev(RepoAbbrev);
   Record.clear();
-  Record.push_back(pch::VERSION_CONTROL_BRANCH_REVISION);
+  Record.push_back(VERSION_CONTROL_BRANCH_REVISION);
   Stream.EmitRecordWithBlob(RepoAbbrevCode, Record,
                             getClangFullRepositoryVersion());
 }
@@ -883,7 +884,7 @@
   Record.push_back(LangOpts.CatchUndefined);
   Record.push_back(LangOpts.ElideConstructors);
   Record.push_back(LangOpts.SpellChecking);
-  Stream.EmitRecord(pch::LANGUAGE_OPTIONS, Record);
+  Stream.EmitRecord(LANGUAGE_OPTIONS, Record);
 }
 
 //===----------------------------------------------------------------------===//
@@ -967,7 +968,7 @@
   // Create a blob abbreviation
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::STAT_CACHE));
+  Abbrev->Add(BitCodeAbbrevOp(STAT_CACHE));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
@@ -975,7 +976,7 @@
 
   // Write the stat cache
   RecordData Record;
-  Record.push_back(pch::STAT_CACHE);
+  Record.push_back(STAT_CACHE);
   Record.push_back(BucketOffset);
   Record.push_back(NumStatEntries);
   Stream.EmitRecordWithBlob(StatCacheAbbrev, Record, StatCacheData.str());
@@ -990,7 +991,7 @@
 static unsigned CreateSLocFileAbbrev(llvm::BitstreamWriter &Stream) {
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::SM_SLOC_FILE_ENTRY));
+  Abbrev->Add(BitCodeAbbrevOp(SM_SLOC_FILE_ENTRY));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Offset
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Include location
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Characteristic
@@ -1012,7 +1013,7 @@
 static unsigned CreateSLocBufferAbbrev(llvm::BitstreamWriter &Stream) {
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::SM_SLOC_BUFFER_ENTRY));
+  Abbrev->Add(BitCodeAbbrevOp(SM_SLOC_BUFFER_ENTRY));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Offset
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Include location
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Characteristic
@@ -1026,7 +1027,7 @@
 static unsigned CreateSLocBufferBlobAbbrev(llvm::BitstreamWriter &Stream) {
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::SM_SLOC_BUFFER_BLOB));
+  Abbrev->Add(BitCodeAbbrevOp(SM_SLOC_BUFFER_BLOB));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Blob
   return Stream.EmitAbbrev(Abbrev);
 }
@@ -1036,7 +1037,7 @@
 static unsigned CreateSLocInstantiationAbbrev(llvm::BitstreamWriter &Stream) {
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::SM_SLOC_INSTANTIATION_ENTRY));
+  Abbrev->Add(BitCodeAbbrevOp(SM_SLOC_INSTANTIATION_ENTRY));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Offset
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Spelling location
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Start location
@@ -1059,7 +1060,7 @@
   RecordData Record;
 
   // Enter the source manager block.
-  Stream.EnterSubblock(pch::SOURCE_MANAGER_BLOCK_ID, 3);
+  Stream.EnterSubblock(SOURCE_MANAGER_BLOCK_ID, 3);
 
   // Abbreviations for the various kinds of source-location entries.
   unsigned SLocFileAbbrv = CreateSLocFileAbbrev(Stream);
@@ -1101,7 +1102,7 @@
         Record.push_back(LE->IncludeOffset);
       }
     }
-    Stream.EmitRecord(pch::SM_LINE_TABLE, Record);
+    Stream.EmitRecord(SM_LINE_TABLE, Record);
   }
 
   // Write out the source location entry table. We skip the first
@@ -1122,11 +1123,11 @@
     unsigned Code;
     if (SLoc->isFile()) {
       if (SLoc->getFile().getContentCache()->Entry)
-        Code = pch::SM_SLOC_FILE_ENTRY;
+        Code = SM_SLOC_FILE_ENTRY;
       else
-        Code = pch::SM_SLOC_BUFFER_ENTRY;
+        Code = SM_SLOC_BUFFER_ENTRY;
     } else
-      Code = pch::SM_SLOC_INSTANTIATION_ENTRY;
+      Code = SM_SLOC_INSTANTIATION_ENTRY;
     Record.clear();
     Record.push_back(Code);
 
@@ -1182,7 +1183,7 @@
         Stream.EmitRecordWithBlob(SLocBufferAbbrv, Record,
                                   llvm::StringRef(Name, strlen(Name) + 1));
         Record.clear();
-        Record.push_back(pch::SM_SLOC_BUFFER_BLOB);
+        Record.push_back(SM_SLOC_BUFFER_BLOB);
         Stream.EmitRecordWithBlob(SLocBufferBlobAbbrv, Record,
                                   llvm::StringRef(Buffer->getBufferStart(),
                                                   Buffer->getBufferSize() + 1));
@@ -1215,14 +1216,14 @@
   // table is used for lazily loading source-location information.
   using namespace llvm;
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::SOURCE_LOCATION_OFFSETS));
+  Abbrev->Add(BitCodeAbbrevOp(SOURCE_LOCATION_OFFSETS));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 16)); // # of slocs
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 16)); // next offset
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // offsets
   unsigned SLocOffsetsAbbrev = Stream.EmitAbbrev(Abbrev);
 
   Record.clear();
-  Record.push_back(pch::SOURCE_LOCATION_OFFSETS);
+  Record.push_back(SOURCE_LOCATION_OFFSETS);
   Record.push_back(SLocEntryOffsets.size());
   Record.push_back(SourceMgr.getNextOffset());
   Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record,
@@ -1231,7 +1232,7 @@
 
   // Write the source location entry preloads array, telling the AST
   // reader which source locations entries it should load eagerly.
-  Stream.EmitRecord(pch::SOURCE_LOCATION_PRELOADS, PreloadSLocs);
+  Stream.EmitRecord(SOURCE_LOCATION_PRELOADS, PreloadSLocs);
 }
 
 //===----------------------------------------------------------------------===//
@@ -1247,12 +1248,12 @@
   // If the preprocessor __COUNTER__ value has been bumped, remember it.
   if (PP.getCounterValue() != 0) {
     Record.push_back(PP.getCounterValue());
-    Stream.EmitRecord(pch::PP_COUNTER_VALUE, Record);
+    Stream.EmitRecord(PP_COUNTER_VALUE, Record);
     Record.clear();
   }
 
   // Enter the preprocessor block.
-  Stream.EnterSubblock(pch::PREPROCESSOR_BLOCK_ID, 2);
+  Stream.EnterSubblock(PREPROCESSOR_BLOCK_ID, 2);
 
   // If the AST file contains __DATE__ or __TIME__ emit a warning about this.
   // FIXME: use diagnostics subsystem for localization etc.
@@ -1281,9 +1282,9 @@
 
     unsigned Code;
     if (MI->isObjectLike()) {
-      Code = pch::PP_MACRO_OBJECT_LIKE;
+      Code = PP_MACRO_OBJECT_LIKE;
     } else {
-      Code = pch::PP_MACRO_FUNCTION_LIKE;
+      Code = PP_MACRO_FUNCTION_LIKE;
 
       Record.push_back(MI->isC99Varargs());
       Record.push_back(MI->isGNUVarargs());
@@ -1320,7 +1321,7 @@
       // FIXME: Should translate token flags to a stable encoding.
       Record.push_back(Tok.getFlags());
 
-      Stream.EmitRecord(pch::PP_TOKEN, Record);
+      Stream.EmitRecord(PP_TOKEN, Record);
       Record.clear();
     }
     ++NumMacros;
@@ -1339,13 +1340,13 @@
         AddSourceLocation(MI->getSourceRange().getEnd(), Record);
         AddIdentifierRef(MI->getName(), Record);
         Record.push_back(getMacroDefinitionID(MI->getDefinition()));
-        Stream.EmitRecord(pch::PP_MACRO_INSTANTIATION, Record);
+        Stream.EmitRecord(PP_MACRO_INSTANTIATION, Record);
         continue;
       }
       
       if (MacroDefinition *MD = dyn_cast<MacroDefinition>(*E)) {
         // Record this macro definition's location.
-        pch::IdentID ID = getMacroDefinitionID(MD);
+        IdentID ID = getMacroDefinitionID(MD);
         if (ID != MacroDefinitionOffsets.size()) {
           if (ID > MacroDefinitionOffsets.size())
             MacroDefinitionOffsets.resize(ID + 1);
@@ -1360,7 +1361,7 @@
         AddSourceLocation(MD->getSourceRange().getEnd(), Record);
         AddIdentifierRef(MD->getName(), Record);
         AddSourceLocation(MD->getLocation(), Record);
-        Stream.EmitRecord(pch::PP_MACRO_DEFINITION, Record);
+        Stream.EmitRecord(PP_MACRO_DEFINITION, Record);
         continue;
       }
     }
@@ -1373,14 +1374,14 @@
     // Write the offsets table for identifier IDs.
     using namespace llvm;
     BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-    Abbrev->Add(BitCodeAbbrevOp(pch::MACRO_DEFINITION_OFFSETS));
+    Abbrev->Add(BitCodeAbbrevOp(MACRO_DEFINITION_OFFSETS));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // # of records
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // # of macro defs
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
     unsigned MacroDefOffsetAbbrev = Stream.EmitAbbrev(Abbrev);
     
     Record.clear();
-    Record.push_back(pch::MACRO_DEFINITION_OFFSETS);
+    Record.push_back(MACRO_DEFINITION_OFFSETS);
     Record.push_back(NumPreprocessingRecords);
     Record.push_back(MacroDefinitionOffsets.size());
     Stream.EmitRecordWithBlob(MacroDefOffsetAbbrev, Record,
@@ -1395,7 +1396,7 @@
 
 /// \brief Write the representation of a type to the AST stream.
 void ASTWriter::WriteType(QualType T) {
-  pch::TypeID &ID = TypeIDs[T];
+  TypeID &ID = TypeIDs[T];
   if (ID == 0) // we haven't seen this type before.
     ID = NextTypeID++;
 
@@ -1417,7 +1418,7 @@
     Qualifiers Qs = T.getLocalQualifiers();
     AddTypeRef(T.getLocalUnqualifiedType(), Record);
     Record.push_back(Qs.getAsOpaqueValue());
-    W.Code = pch::TYPE_EXT_QUAL;
+    W.Code = TYPE_EXT_QUAL;
   } else {
     switch (T->getTypeClass()) {
       // For all of the concrete, non-dependent types, call the
@@ -1452,15 +1453,15 @@
 
   uint64_t Offset = Stream.GetCurrentBitNo();
   RecordData Record;
-  Record.push_back(pch::DECL_CONTEXT_LEXICAL);
-  llvm::SmallVector<pch::DeclID, 64> Decls;
+  Record.push_back(DECL_CONTEXT_LEXICAL);
+  llvm::SmallVector<DeclID, 64> Decls;
   for (DeclContext::decl_iterator D = DC->decls_begin(), DEnd = DC->decls_end();
          D != DEnd; ++D)
     Decls.push_back(GetDeclRef(*D));
 
   ++NumLexicalDeclContexts;
   Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record,
-     reinterpret_cast<char*>(Decls.data()), Decls.size() * sizeof(pch::DeclID));
+     reinterpret_cast<char*>(Decls.data()), Decls.size() * sizeof(DeclID));
   return Offset;
 }
 
@@ -1512,7 +1513,7 @@
   if (Record.size() == 0)
     return 0;
 
-  Stream.EmitRecord(pch::DECL_CONTEXT_VISIBLE, Record);
+  Stream.EmitRecord(DECL_CONTEXT_VISIBLE, Record);
   ++NumVisibleDeclContexts;
   return Offset;
 }
@@ -1523,12 +1524,12 @@
 
   // Write the type offsets array
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::TYPE_OFFSET));
+  Abbrev->Add(BitCodeAbbrevOp(TYPE_OFFSET));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // # of types
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // types block
   unsigned TypeOffsetAbbrev = Stream.EmitAbbrev(Abbrev);
   Record.clear();
-  Record.push_back(pch::TYPE_OFFSET);
+  Record.push_back(TYPE_OFFSET);
   Record.push_back(TypeOffsets.size());
   Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record,
                             (const char *)data(TypeOffsets),
@@ -1536,12 +1537,12 @@
 
   // Write the declaration offsets array
   Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::DECL_OFFSET));
+  Abbrev->Add(BitCodeAbbrevOp(DECL_OFFSET));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // # of declarations
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // declarations block
   unsigned DeclOffsetAbbrev = Stream.EmitAbbrev(Abbrev);
   Record.clear();
-  Record.push_back(pch::DECL_OFFSET);
+  Record.push_back(DECL_OFFSET);
   Record.push_back(DeclOffsets.size());
   Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record,
                             (const char *)data(DeclOffsets),
@@ -1562,7 +1563,7 @@
   typedef key_type key_type_ref;
 
   struct data_type {
-    pch::SelectorID ID;
+    SelectorID ID;
     ObjCMethodList Instance, Factory;
   };
   typedef const data_type& data_type_ref;
@@ -1662,7 +1663,7 @@
     // Create the on-disk hash table representation. We walk through every
     // selector we've seen and look it up in the method pool.
     SelectorOffsets.resize(NextSelectorID - FirstSelectorID);
-    for (llvm::DenseMap<Selector, pch::SelectorID>::iterator
+    for (llvm::DenseMap<Selector, SelectorID>::iterator
              I = SelectorIDs.begin(), E = SelectorIDs.end();
          I != E; ++I) {
       Selector S = I->first;
@@ -1713,7 +1714,7 @@
 
     // Create a blob abbreviation
     BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-    Abbrev->Add(BitCodeAbbrevOp(pch::METHOD_POOL));
+    Abbrev->Add(BitCodeAbbrevOp(METHOD_POOL));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
@@ -1721,21 +1722,21 @@
 
     // Write the method pool
     RecordData Record;
-    Record.push_back(pch::METHOD_POOL);
+    Record.push_back(METHOD_POOL);
     Record.push_back(BucketOffset);
     Record.push_back(NumTableEntries);
     Stream.EmitRecordWithBlob(MethodPoolAbbrev, Record, MethodPool.str());
 
     // Create a blob abbreviation for the selector table offsets.
     Abbrev = new BitCodeAbbrev();
-    Abbrev->Add(BitCodeAbbrevOp(pch::SELECTOR_OFFSETS));
+    Abbrev->Add(BitCodeAbbrevOp(SELECTOR_OFFSETS));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // index
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
     unsigned SelectorOffsetAbbrev = Stream.EmitAbbrev(Abbrev);
 
     // Write the selector offsets table.
     Record.clear();
-    Record.push_back(pch::SELECTOR_OFFSETS);
+    Record.push_back(SELECTOR_OFFSETS);
     Record.push_back(SelectorOffsets.size());
     Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,
                               (const char *)data(SelectorOffsets),
@@ -1762,7 +1763,7 @@
     AddSelectorRef(Sel, Record);
     AddSourceLocation(Loc, Record);
   }
-  Stream.EmitRecord(pch::REFERENCED_SELECTOR_POOL, Record);
+  Stream.EmitRecord(REFERENCED_SELECTOR_POOL, Record);
 }
 
 //===----------------------------------------------------------------------===//
@@ -1789,7 +1790,7 @@
   typedef const IdentifierInfo* key_type;
   typedef key_type  key_type_ref;
 
-  typedef pch::IdentID data_type;
+  typedef IdentID data_type;
   typedef data_type data_type_ref;
 
   ASTIdentifierTableTrait(ASTWriter &Writer, Preprocessor &PP)
@@ -1801,7 +1802,7 @@
 
   std::pair<unsigned,unsigned>
     EmitKeyDataLength(llvm::raw_ostream& Out, const IdentifierInfo* II,
-                      pch::IdentID ID) {
+                      IdentID ID) {
     unsigned KeyLen = II->getLength() + 1;
     unsigned DataLen = 4; // 4 bytes for the persistent ID << 1
     if (isInterestingIdentifier(II)) {
@@ -1812,7 +1813,7 @@
       for (IdentifierResolver::iterator D = IdentifierResolver::begin(II),
                                      DEnd = IdentifierResolver::end();
            D != DEnd; ++D)
-        DataLen += sizeof(pch::DeclID);
+        DataLen += sizeof(DeclID);
     }
     clang::io::Emit16(Out, DataLen);
     // We emit the key length after the data length so that every
@@ -1831,7 +1832,7 @@
   }
 
   void EmitData(llvm::raw_ostream& Out, const IdentifierInfo* II,
-                pch::IdentID ID, unsigned) {
+                IdentID ID, unsigned) {
     if (!isInterestingIdentifier(II)) {
       clang::io::Emit32(Out, ID << 1);
       return;
@@ -1896,7 +1897,7 @@
     // Create the on-disk hash table representation. We only store offsets
     // for identifiers that appear here for the first time.
     IdentifierOffsets.resize(NextIdentID - FirstIdentID);
-    for (llvm::DenseMap<const IdentifierInfo *, pch::IdentID>::iterator
+    for (llvm::DenseMap<const IdentifierInfo *, IdentID>::iterator
            ID = IdentifierIDs.begin(), IDEnd = IdentifierIDs.end();
          ID != IDEnd; ++ID) {
       assert(ID->first && "NULL identifier in identifier table");
@@ -1917,27 +1918,27 @@
 
     // Create a blob abbreviation
     BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-    Abbrev->Add(BitCodeAbbrevOp(pch::IDENTIFIER_TABLE));
+    Abbrev->Add(BitCodeAbbrevOp(IDENTIFIER_TABLE));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
     Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
     unsigned IDTableAbbrev = Stream.EmitAbbrev(Abbrev);
 
     // Write the identifier table
     RecordData Record;
-    Record.push_back(pch::IDENTIFIER_TABLE);
+    Record.push_back(IDENTIFIER_TABLE);
     Record.push_back(BucketOffset);
     Stream.EmitRecordWithBlob(IDTableAbbrev, Record, IdentifierTable.str());
   }
 
   // Write the offsets table for identifier IDs.
   BitCodeAbbrev *Abbrev = new BitCodeAbbrev();
-  Abbrev->Add(BitCodeAbbrevOp(pch::IDENTIFIER_OFFSET));
+  Abbrev->Add(BitCodeAbbrevOp(IDENTIFIER_OFFSET));
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // # of identifiers
   Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
   unsigned IdentifierOffsetAbbrev = Stream.EmitAbbrev(Abbrev);
 
   RecordData Record;
-  Record.push_back(pch::IDENTIFIER_OFFSET);
+  Record.push_back(IDENTIFIER_OFFSET);
   Record.push_back(IdentifierOffsets.size());
   Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record,
                             (const char *)data(IdentifierOffsets),
@@ -1961,7 +1962,7 @@
 
   }
 
-  Stream.EmitRecord(pch::DECL_ATTR, Record);
+  Stream.EmitRecord(DECL_ATTR, Record);
 }
 
 void ASTWriter::AddString(const std::string &Str, RecordData &Record) {
@@ -1972,7 +1973,7 @@
 /// \brief Note that the identifier II occurs at the given offset
 /// within the identifier table.
 void ASTWriter::SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset) {
-  pch::IdentID ID = IdentifierIDs[II];
+  IdentID ID = IdentifierIDs[II];
   // Only store offsets new to this AST file. Other identifier names are looked
   // up earlier in the chain and thus don't need an offset.
   if (ID >= FirstIdentID)
@@ -1993,7 +1994,7 @@
 
 ASTWriter::ASTWriter(llvm::BitstreamWriter &Stream)
   : Stream(Stream), Chain(0), FirstDeclID(1), NextDeclID(FirstDeclID),
-    FirstTypeID(pch::NUM_PREDEF_TYPE_IDS), NextTypeID(FirstTypeID),
+    FirstTypeID(NUM_PREDEF_TYPE_IDS), NextTypeID(FirstTypeID),
     FirstIdentID(1), NextIdentID(FirstIdentID), FirstSelectorID(1),
     NextSelectorID(FirstSelectorID), CollectedStmts(&StmtsToEmit),
     NumStatements(0), NumMacros(0), NumLexicalDeclContexts(0),
@@ -2119,7 +2120,7 @@
 
   // Write the remaining AST contents.
   RecordData Record;
-  Stream.EnterSubblock(pch::AST_BLOCK_ID, 5);
+  Stream.EnterSubblock(AST_BLOCK_ID, 5);
   WriteMetadata(Context, isysroot);
   WriteLanguageOptions(Context.getLangOptions());
   if (StatCalls && !isysroot)
@@ -2145,11 +2146,11 @@
   AddTypeRef(Context.ObjCSelRedefinitionType, Record);
   AddTypeRef(Context.getRawNSConstantStringType(), Record);
   Record.push_back(Context.isInt128Installed());
-  Stream.EmitRecord(pch::SPECIAL_TYPES, Record);
+  Stream.EmitRecord(SPECIAL_TYPES, Record);
 
   // Keep writing types and declarations until all types and
   // declarations have been written.
-  Stream.EnterSubblock(pch::DECLTYPES_BLOCK_ID, 3);
+  Stream.EnterSubblock(DECLTYPES_BLOCK_ID, 3);
   WriteDeclsBlockAbbrevs();
   while (!DeclTypesToEmit.empty()) {
     DeclOrType DOT = DeclTypesToEmit.front();
@@ -2170,46 +2171,46 @@
 
   // Write the record containing external, unnamed definitions.
   if (!ExternalDefinitions.empty())
-    Stream.EmitRecord(pch::EXTERNAL_DEFINITIONS, ExternalDefinitions);
+    Stream.EmitRecord(EXTERNAL_DEFINITIONS, ExternalDefinitions);
 
   // Write the record containing tentative definitions.
   if (!TentativeDefinitions.empty())
-    Stream.EmitRecord(pch::TENTATIVE_DEFINITIONS, TentativeDefinitions);
+    Stream.EmitRecord(TENTATIVE_DEFINITIONS, TentativeDefinitions);
 
   // Write the record containing unused file scoped decls.
   if (!UnusedFileScopedDecls.empty())
-    Stream.EmitRecord(pch::UNUSED_FILESCOPED_DECLS, UnusedFileScopedDecls);
+    Stream.EmitRecord(UNUSED_FILESCOPED_DECLS, UnusedFileScopedDecls);
 
   // Write the record containing weak undeclared identifiers.
   if (!WeakUndeclaredIdentifiers.empty())
-    Stream.EmitRecord(pch::WEAK_UNDECLARED_IDENTIFIERS,
+    Stream.EmitRecord(WEAK_UNDECLARED_IDENTIFIERS,
                       WeakUndeclaredIdentifiers);
 
   // Write the record containing locally-scoped external definitions.
   if (!LocallyScopedExternalDecls.empty())
-    Stream.EmitRecord(pch::LOCALLY_SCOPED_EXTERNAL_DECLS,
+    Stream.EmitRecord(LOCALLY_SCOPED_EXTERNAL_DECLS,
                       LocallyScopedExternalDecls);
 
   // Write the record containing ext_vector type names.
   if (!ExtVectorDecls.empty())
-    Stream.EmitRecord(pch::EXT_VECTOR_DECLS, ExtVectorDecls);
+    Stream.EmitRecord(EXT_VECTOR_DECLS, ExtVectorDecls);
 
   // Write the record containing VTable uses information.
   if (!VTableUses.empty())
-    Stream.EmitRecord(pch::VTABLE_USES, VTableUses);
+    Stream.EmitRecord(VTABLE_USES, VTableUses);
 
   // Write the record containing dynamic classes declarations.
   if (!DynamicClasses.empty())
-    Stream.EmitRecord(pch::DYNAMIC_CLASSES, DynamicClasses);
+    Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses);
 
   // Write the record containing pending implicit instantiations.
   if (!PendingImplicitInstantiations.empty())
-    Stream.EmitRecord(pch::PENDING_IMPLICIT_INSTANTIATIONS,
+    Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS,
                       PendingImplicitInstantiations);
 
   // Write the record containing declaration references of Sema.
   if (!SemaDeclRefs.empty())
-    Stream.EmitRecord(pch::SEMA_DECL_REFS, SemaDeclRefs);
+    Stream.EmitRecord(SEMA_DECL_REFS, SemaDeclRefs);
 
   // Some simple statistics
   Record.clear();
@@ -2217,7 +2218,7 @@
   Record.push_back(NumMacros);
   Record.push_back(NumLexicalDeclContexts);
   Record.push_back(NumVisibleDeclContexts);
-  Stream.EmitRecord(pch::STATISTICS, Record);
+  Stream.EmitRecord(STATISTICS, Record);
   Stream.ExitBlock();
 }
 
@@ -2238,7 +2239,7 @@
   Preprocessor &PP = SemaRef.PP;
 
   RecordData Record;
-  Stream.EnterSubblock(pch::AST_BLOCK_ID, 5);
+  Stream.EnterSubblock(AST_BLOCK_ID, 5);
   WriteMetadata(Context, isysroot);
   if (StatCalls && !isysroot)
     WriteStatCache(*StatCalls);
@@ -2251,7 +2252,7 @@
   // We don't start with the translation unit, but with its decls that
   // don't come from the chained PCH.
   const TranslationUnitDecl *TU = Context.getTranslationUnitDecl();
-  llvm::SmallVector<pch::DeclID, 64> NewGlobalDecls;
+  llvm::SmallVector<DeclID, 64> NewGlobalDecls;
   for (DeclContext::decl_iterator I = TU->noload_decls_begin(),
                                   E = TU->noload_decls_end();
        I != E; ++I) {
@@ -2262,14 +2263,14 @@
   }
   // We also need to write a lexical updates block for the TU.
   llvm::BitCodeAbbrev *Abv = new llvm::BitCodeAbbrev();
-  Abv->Add(llvm::BitCodeAbbrevOp(pch::TU_UPDATE_LEXICAL));
+  Abv->Add(llvm::BitCodeAbbrevOp(TU_UPDATE_LEXICAL));
   Abv->Add(llvm::BitCodeAbbrevOp(llvm::BitCodeAbbrevOp::Blob));
   unsigned TuUpdateLexicalAbbrev = Stream.EmitAbbrev(Abv);
   Record.clear();
-  Record.push_back(pch::TU_UPDATE_LEXICAL);
+  Record.push_back(TU_UPDATE_LEXICAL);
   Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,
                           reinterpret_cast<const char*>(NewGlobalDecls.data()),
-                          NewGlobalDecls.size() * sizeof(pch::DeclID));
+                          NewGlobalDecls.size() * sizeof(DeclID));
 
   // Build a record containing all of the new tentative definitions in this
   // file, in TentativeDefinitions order.
@@ -2362,7 +2363,7 @@
     AddDeclRef(SemaRef.getStdBadAlloc(), SemaDeclRefs);
   }
 
-  Stream.EnterSubblock(pch::DECLTYPES_BLOCK_ID, 3);
+  Stream.EnterSubblock(DECLTYPES_BLOCK_ID, 3);
   WriteDeclsBlockAbbrevs();
   while (!DeclTypesToEmit.empty()) {
     DeclOrType DOT = DeclTypesToEmit.front();
@@ -2391,50 +2392,50 @@
     AddDeclRef(I->second, FirstLatestDeclIDs);
   }
   if (!FirstLatestDeclIDs.empty())
-    Stream.EmitRecord(pch::REDECLS_UPDATE_LATEST, FirstLatestDeclIDs);
+    Stream.EmitRecord(REDECLS_UPDATE_LATEST, FirstLatestDeclIDs);
 
   // Write the record containing external, unnamed definitions.
   if (!ExternalDefinitions.empty())
-    Stream.EmitRecord(pch::EXTERNAL_DEFINITIONS, ExternalDefinitions);
+    Stream.EmitRecord(EXTERNAL_DEFINITIONS, ExternalDefinitions);
 
   // Write the record containing tentative definitions.
   if (!TentativeDefinitions.empty())
-    Stream.EmitRecord(pch::TENTATIVE_DEFINITIONS, TentativeDefinitions);
+    Stream.EmitRecord(TENTATIVE_DEFINITIONS, TentativeDefinitions);
 
   // Write the record containing unused file scoped decls.
   if (!UnusedFileScopedDecls.empty())
-    Stream.EmitRecord(pch::UNUSED_FILESCOPED_DECLS, UnusedFileScopedDecls);
+    Stream.EmitRecord(UNUSED_FILESCOPED_DECLS, UnusedFileScopedDecls);
 
   // Write the record containing weak undeclared identifiers.
   if (!WeakUndeclaredIdentifiers.empty())
-    Stream.EmitRecord(pch::WEAK_UNDECLARED_IDENTIFIERS,
+    Stream.EmitRecord(WEAK_UNDECLARED_IDENTIFIERS,
                       WeakUndeclaredIdentifiers);
 
   // Write the record containing locally-scoped external definitions.
   if (!LocallyScopedExternalDecls.empty())
-    Stream.EmitRecord(pch::LOCALLY_SCOPED_EXTERNAL_DECLS,
+    Stream.EmitRecord(LOCALLY_SCOPED_EXTERNAL_DECLS,
                       LocallyScopedExternalDecls);
 
   // Write the record containing ext_vector type names.
   if (!ExtVectorDecls.empty())
-    Stream.EmitRecord(pch::EXT_VECTOR_DECLS, ExtVectorDecls);
+    Stream.EmitRecord(EXT_VECTOR_DECLS, ExtVectorDecls);
 
   // Write the record containing VTable uses information.
   if (!VTableUses.empty())
-    Stream.EmitRecord(pch::VTABLE_USES, VTableUses);
+    Stream.EmitRecord(VTABLE_USES, VTableUses);
 
   // Write the record containing dynamic classes declarations.
   if (!DynamicClasses.empty())
-    Stream.EmitRecord(pch::DYNAMIC_CLASSES, DynamicClasses);
+    Stream.EmitRecord(DYNAMIC_CLASSES, DynamicClasses);
 
   // Write the record containing pending implicit instantiations.
   if (!PendingImplicitInstantiations.empty())
-    Stream.EmitRecord(pch::PENDING_IMPLICIT_INSTANTIATIONS,
+    Stream.EmitRecord(PENDING_IMPLICIT_INSTANTIATIONS,
                       PendingImplicitInstantiations);
 
   // Write the record containing declaration references of Sema.
   if (!SemaDeclRefs.empty())
-    Stream.EmitRecord(pch::SEMA_DECL_REFS, SemaDeclRefs);
+    Stream.EmitRecord(SEMA_DECL_REFS, SemaDeclRefs);
 
   Record.clear();
   Record.push_back(NumStatements);
@@ -2442,7 +2443,7 @@
   Record.push_back(NumLexicalDeclContexts);
   Record.push_back(NumVisibleDeclContexts);
   WriteDeclUpdateBlock();
-  Stream.EmitRecord(pch::STATISTICS, Record);
+  Stream.EmitRecord(STATISTICS, Record);
   Stream.ExitBlock();
 }
 
@@ -2451,12 +2452,12 @@
     return;
 
   RecordData Record;
-  for (llvm::SmallVector<std::pair<pch::DeclID, uint64_t>, 16>::iterator
+  for (llvm::SmallVector<std::pair<DeclID, uint64_t>, 16>::iterator
            I = ReplacedDecls.begin(), E = ReplacedDecls.end(); I != E; ++I) {
     Record.push_back(I->first);
     Record.push_back(I->second);
   }
-  Stream.EmitRecord(pch::DECL_REPLACEMENTS, Record);
+  Stream.EmitRecord(DECL_REPLACEMENTS, Record);
 }
 
 void ASTWriter::AddSourceLocation(SourceLocation Loc, RecordData &Record) {
@@ -2489,21 +2490,21 @@
   Record.push_back(getIdentifierRef(II));
 }
 
-pch::IdentID ASTWriter::getIdentifierRef(const IdentifierInfo *II) {
+IdentID ASTWriter::getIdentifierRef(const IdentifierInfo *II) {
   if (II == 0)
     return 0;
 
-  pch::IdentID &ID = IdentifierIDs[II];
+  IdentID &ID = IdentifierIDs[II];
   if (ID == 0)
     ID = NextIdentID++;
   return ID;
 }
 
-pch::IdentID ASTWriter::getMacroDefinitionID(MacroDefinition *MD) {
+IdentID ASTWriter::getMacroDefinitionID(MacroDefinition *MD) {
   if (MD == 0)
     return 0;
   
-  pch::IdentID &ID = MacroDefinitions[MD];
+  IdentID &ID = MacroDefinitions[MD];
   if (ID == 0)
     ID = MacroDefinitions.size();
   return ID;
@@ -2513,12 +2514,12 @@
   Record.push_back(getSelectorRef(SelRef));
 }
 
-pch::SelectorID ASTWriter::getSelectorRef(Selector Sel) {
+SelectorID ASTWriter::getSelectorRef(Selector Sel) {
   if (Sel.getAsOpaquePtr() == 0) {
     return 0;
   }
 
-  pch::SelectorID &SID = SelectorIDs[Sel];
+  SelectorID &SID = SelectorIDs[Sel];
   if (SID == 0 && Chain) {
     // This might trigger a ReadSelector callback, which will set the ID for
     // this selector.
@@ -2585,7 +2586,7 @@
 
 void ASTWriter::AddTypeRef(QualType T, RecordData &Record) {
   if (T.isNull()) {
-    Record.push_back(pch::PREDEF_TYPE_NULL_ID);
+    Record.push_back(PREDEF_TYPE_NULL_ID);
     return;
   }
 
@@ -2593,7 +2594,7 @@
   T.removeFastQualifiers();
 
   if (T.hasLocalNonFastQualifiers()) {
-    pch::TypeID &ID = TypeIDs[T];
+    TypeID &ID = TypeIDs[T];
     if (ID == 0) {
       // We haven't seen these qualifiers applied to this type before.
       // Assign it a new ID.  This is the only time we enqueue a
@@ -2610,36 +2611,36 @@
   assert(!T.hasLocalQualifiers());
 
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(T.getTypePtr())) {
-    pch::TypeID ID = 0;
+    TypeID ID = 0;
     switch (BT->getKind()) {
-    case BuiltinType::Void:       ID = pch::PREDEF_TYPE_VOID_ID;       break;
-    case BuiltinType::Bool:       ID = pch::PREDEF_TYPE_BOOL_ID;       break;
-    case BuiltinType::Char_U:     ID = pch::PREDEF_TYPE_CHAR_U_ID;     break;
-    case BuiltinType::UChar:      ID = pch::PREDEF_TYPE_UCHAR_ID;      break;
-    case BuiltinType::UShort:     ID = pch::PREDEF_TYPE_USHORT_ID;     break;
-    case BuiltinType::UInt:       ID = pch::PREDEF_TYPE_UINT_ID;       break;
-    case BuiltinType::ULong:      ID = pch::PREDEF_TYPE_ULONG_ID;      break;
-    case BuiltinType::ULongLong:  ID = pch::PREDEF_TYPE_ULONGLONG_ID;  break;
-    case BuiltinType::UInt128:    ID = pch::PREDEF_TYPE_UINT128_ID;    break;
-    case BuiltinType::Char_S:     ID = pch::PREDEF_TYPE_CHAR_S_ID;     break;
-    case BuiltinType::SChar:      ID = pch::PREDEF_TYPE_SCHAR_ID;      break;
-    case BuiltinType::WChar:      ID = pch::PREDEF_TYPE_WCHAR_ID;      break;
-    case BuiltinType::Short:      ID = pch::PREDEF_TYPE_SHORT_ID;      break;
-    case BuiltinType::Int:        ID = pch::PREDEF_TYPE_INT_ID;        break;
-    case BuiltinType::Long:       ID = pch::PREDEF_TYPE_LONG_ID;       break;
-    case BuiltinType::LongLong:   ID = pch::PREDEF_TYPE_LONGLONG_ID;   break;
-    case BuiltinType::Int128:     ID = pch::PREDEF_TYPE_INT128_ID;     break;
-    case BuiltinType::Float:      ID = pch::PREDEF_TYPE_FLOAT_ID;      break;
-    case BuiltinType::Double:     ID = pch::PREDEF_TYPE_DOUBLE_ID;     break;
-    case BuiltinType::LongDouble: ID = pch::PREDEF_TYPE_LONGDOUBLE_ID; break;
-    case BuiltinType::NullPtr:    ID = pch::PREDEF_TYPE_NULLPTR_ID;    break;
-    case BuiltinType::Char16:     ID = pch::PREDEF_TYPE_CHAR16_ID;     break;
-    case BuiltinType::Char32:     ID = pch::PREDEF_TYPE_CHAR32_ID;     break;
-    case BuiltinType::Overload:   ID = pch::PREDEF_TYPE_OVERLOAD_ID;   break;
-    case BuiltinType::Dependent:  ID = pch::PREDEF_TYPE_DEPENDENT_ID;  break;
-    case BuiltinType::ObjCId:     ID = pch::PREDEF_TYPE_OBJC_ID;       break;
-    case BuiltinType::ObjCClass:  ID = pch::PREDEF_TYPE_OBJC_CLASS;    break;
-    case BuiltinType::ObjCSel:    ID = pch::PREDEF_TYPE_OBJC_SEL;      break;
+    case BuiltinType::Void:       ID = PREDEF_TYPE_VOID_ID;       break;
+    case BuiltinType::Bool:       ID = PREDEF_TYPE_BOOL_ID;       break;
+    case BuiltinType::Char_U:     ID = PREDEF_TYPE_CHAR_U_ID;     break;
+    case BuiltinType::UChar:      ID = PREDEF_TYPE_UCHAR_ID;      break;
+    case BuiltinType::UShort:     ID = PREDEF_TYPE_USHORT_ID;     break;
+    case BuiltinType::UInt:       ID = PREDEF_TYPE_UINT_ID;       break;
+    case BuiltinType::ULong:      ID = PREDEF_TYPE_ULONG_ID;      break;
+    case BuiltinType::ULongLong:  ID = PREDEF_TYPE_ULONGLONG_ID;  break;
+    case BuiltinType::UInt128:    ID = PREDEF_TYPE_UINT128_ID;    break;
+    case BuiltinType::Char_S:     ID = PREDEF_TYPE_CHAR_S_ID;     break;
+    case BuiltinType::SChar:      ID = PREDEF_TYPE_SCHAR_ID;      break;
+    case BuiltinType::WChar:      ID = PREDEF_TYPE_WCHAR_ID;      break;
+    case BuiltinType::Short:      ID = PREDEF_TYPE_SHORT_ID;      break;
+    case BuiltinType::Int:        ID = PREDEF_TYPE_INT_ID;        break;
+    case BuiltinType::Long:       ID = PREDEF_TYPE_LONG_ID;       break;
+    case BuiltinType::LongLong:   ID = PREDEF_TYPE_LONGLONG_ID;   break;
+    case BuiltinType::Int128:     ID = PREDEF_TYPE_INT128_ID;     break;
+    case BuiltinType::Float:      ID = PREDEF_TYPE_FLOAT_ID;      break;
+    case BuiltinType::Double:     ID = PREDEF_TYPE_DOUBLE_ID;     break;
+    case BuiltinType::LongDouble: ID = PREDEF_TYPE_LONGDOUBLE_ID; break;
+    case BuiltinType::NullPtr:    ID = PREDEF_TYPE_NULLPTR_ID;    break;
+    case BuiltinType::Char16:     ID = PREDEF_TYPE_CHAR16_ID;     break;
+    case BuiltinType::Char32:     ID = PREDEF_TYPE_CHAR32_ID;     break;
+    case BuiltinType::Overload:   ID = PREDEF_TYPE_OVERLOAD_ID;   break;
+    case BuiltinType::Dependent:  ID = PREDEF_TYPE_DEPENDENT_ID;  break;
+    case BuiltinType::ObjCId:     ID = PREDEF_TYPE_OBJC_ID;       break;
+    case BuiltinType::ObjCClass:  ID = PREDEF_TYPE_OBJC_CLASS;    break;
+    case BuiltinType::ObjCSel:    ID = PREDEF_TYPE_OBJC_SEL;      break;
     case BuiltinType::UndeducedAuto:
       assert(0 && "Should not see undeduced auto here");
       break;
@@ -2649,7 +2650,7 @@
     return;
   }
 
-  pch::TypeID &ID = TypeIDs[T];
+  TypeID &ID = TypeIDs[T];
   if (ID == 0) {
     // We haven't seen this type before. Assign it a new ID and put it
     // into the queue of types to emit.
@@ -2665,12 +2666,12 @@
   Record.push_back(GetDeclRef(D));
 }
 
-pch::DeclID ASTWriter::GetDeclRef(const Decl *D) {
+DeclID ASTWriter::GetDeclRef(const Decl *D) {
   if (D == 0) {
     return 0;
   }
 
-  pch::DeclID &ID = DeclIDs[D];
+  DeclID &ID = DeclIDs[D];
   if (ID == 0) {
     // We haven't seen this declaration before. Give it a new ID and
     // enqueue it in the list of declarations to emit.
@@ -2687,7 +2688,7 @@
   return ID;
 }
 
-pch::DeclID ASTWriter::getDeclID(const Decl *D) {
+DeclID ASTWriter::getDeclID(const Decl *D) {
   if (D == 0)
     return 0;
 
@@ -2921,18 +2922,18 @@
   Chain = Reader;
 }
 
-void ASTWriter::IdentifierRead(pch::IdentID ID, IdentifierInfo *II) {
+void ASTWriter::IdentifierRead(IdentID ID, IdentifierInfo *II) {
   IdentifierIDs[II] = ID;
 }
 
-void ASTWriter::TypeRead(pch::TypeID ID, QualType T) {
+void ASTWriter::TypeRead(TypeID ID, QualType T) {
   TypeIDs[T] = ID;
 }
 
-void ASTWriter::DeclRead(pch::DeclID ID, const Decl *D) {
+void ASTWriter::DeclRead(DeclID ID, const Decl *D) {
   DeclIDs[D] = ID;
 }
 
-void ASTWriter::SelectorRead(pch::SelectorID ID, Selector S) {
+void ASTWriter::SelectorRead(SelectorID ID, Selector S) {
   SelectorIDs[S] = ID;
 }

Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Wed Aug 18 18:57:32 2010
@@ -33,7 +33,7 @@
     ASTWriter::RecordData &Record;
 
   public:
-    pch::DeclCode Code;
+    serialization::DeclCode Code;
     unsigned AbbrevToUse;
 
     ASTDeclWriter(ASTWriter &Writer, ASTContext &Context,
@@ -142,7 +142,7 @@
 void ASTDeclWriter::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
   VisitDecl(D);
   Writer.AddDeclRef(D->getAnonymousNamespace(), Record);
-  Code = pch::DECL_TRANSLATION_UNIT;
+  Code = serialization::DECL_TRANSLATION_UNIT;
 }
 
 void ASTDeclWriter::VisitNamedDecl(NamedDecl *D) {
@@ -158,7 +158,7 @@
 void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) {
   VisitTypeDecl(D);
   Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record);
-  Code = pch::DECL_TYPEDEF;
+  Code = serialization::DECL_TYPEDEF;
 }
 
 void ASTDeclWriter::VisitTagDecl(TagDecl *D) {
@@ -181,7 +181,7 @@
   Record.push_back(D->getNumPositiveBits());
   Record.push_back(D->getNumNegativeBits());
   Writer.AddDeclRef(D->getInstantiatedFromMemberEnum(), Record);
-  Code = pch::DECL_ENUM;
+  Code = serialization::DECL_ENUM;
 }
 
 void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) {
@@ -189,7 +189,7 @@
   Record.push_back(D->hasFlexibleArrayMember());
   Record.push_back(D->isAnonymousStructOrUnion());
   Record.push_back(D->hasObjectMember());
-  Code = pch::DECL_RECORD;
+  Code = serialization::DECL_RECORD;
 }
 
 void ASTDeclWriter::VisitValueDecl(ValueDecl *D) {
@@ -203,7 +203,7 @@
   if (D->getInitExpr())
     Writer.AddStmt(D->getInitExpr());
   Writer.AddAPSInt(D->getInitVal(), Record);
-  Code = pch::DECL_ENUM_CONSTANT;
+  Code = serialization::DECL_ENUM_CONSTANT;
 }
 
 void ASTDeclWriter::VisitDeclaratorDecl(DeclaratorDecl *D) {
@@ -299,7 +299,7 @@
   for (FunctionDecl::param_iterator P = D->param_begin(), PEnd = D->param_end();
        P != PEnd; ++P)
     Writer.AddDeclRef(*P, Record);
-  Code = pch::DECL_FUNCTION;
+  Code = serialization::DECL_FUNCTION;
 }
 
 void ASTDeclWriter::VisitObjCMethodDecl(ObjCMethodDecl *D) {
@@ -330,13 +330,13 @@
   for (ObjCMethodDecl::param_iterator P = D->param_begin(),
                                    PEnd = D->param_end(); P != PEnd; ++P)
     Writer.AddDeclRef(*P, Record);
-  Code = pch::DECL_OBJC_METHOD;
+  Code = serialization::DECL_OBJC_METHOD;
 }
 
 void ASTDeclWriter::VisitObjCContainerDecl(ObjCContainerDecl *D) {
   VisitNamedDecl(D);
   Writer.AddSourceRange(D->getAtEndRange(), Record);
-  // Abstract class (no need to define a stable pch::DECL code).
+  // Abstract class (no need to define a stable serialization::DECL code).
 }
 
 void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {
@@ -362,7 +362,7 @@
   Writer.AddSourceLocation(D->getClassLoc(), Record);
   Writer.AddSourceLocation(D->getSuperClassLoc(), Record);
   Writer.AddSourceLocation(D->getLocEnd(), Record);
-  Code = pch::DECL_OBJC_INTERFACE;
+  Code = serialization::DECL_OBJC_INTERFACE;
 }
 
 void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) {
@@ -370,7 +370,7 @@
   // FIXME: stable encoding for @public/@private/@protected/@package
   Record.push_back(D->getAccessControl());
   Record.push_back(D->getSynthesize());
-  Code = pch::DECL_OBJC_IVAR;
+  Code = serialization::DECL_OBJC_IVAR;
 }
 
 void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) {
@@ -385,12 +385,12 @@
          PLEnd = D->protocol_loc_end();
        PL != PLEnd; ++PL)
     Writer.AddSourceLocation(*PL, Record);
-  Code = pch::DECL_OBJC_PROTOCOL;
+  Code = serialization::DECL_OBJC_PROTOCOL;
 }
 
 void ASTDeclWriter::VisitObjCAtDefsFieldDecl(ObjCAtDefsFieldDecl *D) {
   VisitFieldDecl(D);
-  Code = pch::DECL_OBJC_AT_DEFS_FIELD;
+  Code = serialization::DECL_OBJC_AT_DEFS_FIELD;
 }
 
 void ASTDeclWriter::VisitObjCClassDecl(ObjCClassDecl *D) {
@@ -400,7 +400,7 @@
     Writer.AddDeclRef(I->getInterface(), Record);
   for (ObjCClassDecl::iterator I = D->begin(), IEnd = D->end(); I != IEnd; ++I)
     Writer.AddSourceLocation(I->getLocation(), Record);
-  Code = pch::DECL_OBJC_CLASS;
+  Code = serialization::DECL_OBJC_CLASS;
 }
 
 void ASTDeclWriter::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) {
@@ -413,7 +413,7 @@
          PL = D->protocol_loc_begin(), PLEnd = D->protocol_loc_end();
        PL != PLEnd; ++PL)
     Writer.AddSourceLocation(*PL, Record);
-  Code = pch::DECL_OBJC_FORWARD_PROTOCOL;
+  Code = serialization::DECL_OBJC_FORWARD_PROTOCOL;
 }
 
 void ASTDeclWriter::VisitObjCCategoryDecl(ObjCCategoryDecl *D) {
@@ -430,13 +430,13 @@
   Writer.AddDeclRef(D->getNextClassCategory(), Record);
   Writer.AddSourceLocation(D->getAtLoc(), Record);
   Writer.AddSourceLocation(D->getCategoryNameLoc(), Record);
-  Code = pch::DECL_OBJC_CATEGORY;
+  Code = serialization::DECL_OBJC_CATEGORY;
 }
 
 void ASTDeclWriter::VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D) {
   VisitNamedDecl(D);
   Writer.AddDeclRef(D->getClassInterface(), Record);
-  Code = pch::DECL_OBJC_COMPATIBLE_ALIAS;
+  Code = serialization::DECL_OBJC_COMPATIBLE_ALIAS;
 }
 
 void ASTDeclWriter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {
@@ -453,19 +453,19 @@
   Writer.AddDeclRef(D->getGetterMethodDecl(), Record);
   Writer.AddDeclRef(D->getSetterMethodDecl(), Record);
   Writer.AddDeclRef(D->getPropertyIvarDecl(), Record);
-  Code = pch::DECL_OBJC_PROPERTY;
+  Code = serialization::DECL_OBJC_PROPERTY;
 }
 
 void ASTDeclWriter::VisitObjCImplDecl(ObjCImplDecl *D) {
   VisitObjCContainerDecl(D);
   Writer.AddDeclRef(D->getClassInterface(), Record);
-  // Abstract class (no need to define a stable pch::DECL code).
+  // Abstract class (no need to define a stable serialization::DECL code).
 }
 
 void ASTDeclWriter::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {
   VisitObjCImplDecl(D);
   Writer.AddIdentifierRef(D->getIdentifier(), Record);
-  Code = pch::DECL_OBJC_CATEGORY_IMPL;
+  Code = serialization::DECL_OBJC_CATEGORY_IMPL;
 }
 
 void ASTDeclWriter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {
@@ -473,7 +473,7 @@
   Writer.AddDeclRef(D->getSuperClass(), Record);
   Writer.AddCXXBaseOrMemberInitializers(D->IvarInitializers,
                                         D->NumIvarInitializers, Record);
-  Code = pch::DECL_OBJC_IMPLEMENTATION;
+  Code = serialization::DECL_OBJC_IMPLEMENTATION;
 }
 
 void ASTDeclWriter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
@@ -483,7 +483,7 @@
   Writer.AddDeclRef(D->getPropertyIvarDecl(), Record);
   Writer.AddStmt(D->getGetterCXXConstructor());
   Writer.AddStmt(D->getSetterCXXAssignment());
-  Code = pch::DECL_OBJC_PROPERTY_IMPL;
+  Code = serialization::DECL_OBJC_PROPERTY_IMPL;
 }
 
 void ASTDeclWriter::VisitFieldDecl(FieldDecl *D) {
@@ -494,7 +494,7 @@
     Writer.AddStmt(D->getBitWidth());
   if (!D->getDeclName())
     Writer.AddDeclRef(Context.getInstantiatedFromUnnamedFieldDecl(D), Record);
-  Code = pch::DECL_FIELD;
+  Code = serialization::DECL_FIELD;
 }
 
 void ASTDeclWriter::VisitVarDecl(VarDecl *D) {
@@ -519,12 +519,12 @@
     Writer.AddSourceLocation(SpecInfo->getPointOfInstantiation(), Record);
   }
 
-  Code = pch::DECL_VAR;
+  Code = serialization::DECL_VAR;
 }
 
 void ASTDeclWriter::VisitImplicitParamDecl(ImplicitParamDecl *D) {
   VisitVarDecl(D);
-  Code = pch::DECL_IMPLICIT_PARAM;
+  Code = serialization::DECL_IMPLICIT_PARAM;
 }
 
 void ASTDeclWriter::VisitParmVarDecl(ParmVarDecl *D) {
@@ -534,7 +534,7 @@
   Record.push_back(D->hasUninstantiatedDefaultArg());
   if (D->hasUninstantiatedDefaultArg())
     Writer.AddStmt(D->getUninstantiatedDefaultArg());
-  Code = pch::DECL_PARM_VAR;
+  Code = serialization::DECL_PARM_VAR;
 
   // If the assumptions about the DECL_PARM_VAR abbrev are true, use it.  Here
   // we dynamically check for the properties that we optimize for, but don't
@@ -567,7 +567,7 @@
 void ASTDeclWriter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
   VisitDecl(D);
   Writer.AddStmt(D->getAsmString());
-  Code = pch::DECL_FILE_SCOPE_ASM;
+  Code = serialization::DECL_FILE_SCOPE_ASM;
 }
 
 void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) {
@@ -578,7 +578,7 @@
   for (FunctionDecl::param_iterator P = D->param_begin(), PEnd = D->param_end();
        P != PEnd; ++P)
     Writer.AddDeclRef(*P, Record);
-  Code = pch::DECL_BLOCK;
+  Code = serialization::DECL_BLOCK;
 }
 
 void ASTDeclWriter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
@@ -587,7 +587,7 @@
   // declaration, which don't seem to be readily available in the AST.
   Record.push_back(D->getLanguage());
   Record.push_back(D->hasBraces());
-  Code = pch::DECL_LINKAGE_SPEC;
+  Code = serialization::DECL_LINKAGE_SPEC;
 }
 
 void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) {
@@ -602,7 +602,7 @@
     Writer.AddDeclRef(D->getAnonymousNamespace(), Record);
   else
     Writer.AddDeclRef(D->getOriginalNamespace(), Record);
-  Code = pch::DECL_NAMESPACE;
+  Code = serialization::DECL_NAMESPACE;
 
   if (Writer.hasChain() && !D->isOriginalNamespace() &&
       D->getOriginalNamespace()->getPCHLevel() > 0) {
@@ -617,7 +617,7 @@
   Writer.AddNestedNameSpecifier(D->getQualifier(), Record);
   Writer.AddSourceLocation(D->getTargetNameLoc(), Record);
   Writer.AddDeclRef(D->getNamespace(), Record);
-  Code = pch::DECL_NAMESPACE_ALIAS;
+  Code = serialization::DECL_NAMESPACE_ALIAS;
 }
 
 void ASTDeclWriter::VisitUsingDecl(UsingDecl *D) {
@@ -631,7 +631,7 @@
     Writer.AddDeclRef(*P, Record);
   Record.push_back(D->isTypeName());
   Writer.AddDeclRef(Context.getInstantiatedFromUsingDecl(D), Record);
-  Code = pch::DECL_USING;
+  Code = serialization::DECL_USING;
 }
 
 void ASTDeclWriter::VisitUsingShadowDecl(UsingShadowDecl *D) {
@@ -639,7 +639,7 @@
   Writer.AddDeclRef(D->getTargetDecl(), Record);
   Writer.AddDeclRef(D->getUsingDecl(), Record);
   Writer.AddDeclRef(Context.getInstantiatedFromUsingShadowDecl(D), Record);
-  Code = pch::DECL_USING_SHADOW;
+  Code = serialization::DECL_USING_SHADOW;
 }
 
 void ASTDeclWriter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {
@@ -650,7 +650,7 @@
   Writer.AddSourceLocation(D->getIdentLocation(), Record);
   Writer.AddDeclRef(D->getNominatedNamespace(), Record);
   Writer.AddDeclRef(dyn_cast<Decl>(D->getCommonAncestor()), Record);
-  Code = pch::DECL_USING_DIRECTIVE;
+  Code = serialization::DECL_USING_DIRECTIVE;
 }
 
 void ASTDeclWriter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) {
@@ -658,7 +658,7 @@
   Writer.AddSourceRange(D->getTargetNestedNameRange(), Record);
   Writer.AddSourceLocation(D->getUsingLoc(), Record);
   Writer.AddNestedNameSpecifier(D->getTargetNestedNameSpecifier(), Record);
-  Code = pch::DECL_UNRESOLVED_USING_VALUE;
+  Code = serialization::DECL_UNRESOLVED_USING_VALUE;
 }
 
 void ASTDeclWriter::VisitUnresolvedUsingTypenameDecl(
@@ -668,7 +668,7 @@
   Writer.AddSourceLocation(D->getUsingLoc(), Record);
   Writer.AddSourceLocation(D->getTypenameLoc(), Record);
   Writer.AddNestedNameSpecifier(D->getTargetNestedNameSpecifier(), Record);
-  Code = pch::DECL_UNRESOLVED_USING_TYPENAME;
+  Code = serialization::DECL_UNRESOLVED_USING_TYPENAME;
 }
 
 void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) {
@@ -747,7 +747,7 @@
     Record.push_back(CXXRecNotTemplate);
   }
 
-  Code = pch::DECL_CXX_RECORD;
+  Code = serialization::DECL_CXX_RECORD;
 }
 
 void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) {
@@ -757,7 +757,7 @@
          I = D->begin_overridden_methods(), E = D->end_overridden_methods();
          I != E; ++I)
     Writer.AddDeclRef(*I, Record);
-  Code = pch::DECL_CXX_METHOD;
+  Code = serialization::DECL_CXX_METHOD;
 }
 
 void ASTDeclWriter::VisitCXXConstructorDecl(CXXConstructorDecl *D) {
@@ -768,7 +768,7 @@
   Writer.AddCXXBaseOrMemberInitializers(D->BaseOrMemberInitializers,
                                         D->NumBaseOrMemberInitializers, Record);
 
-  Code = pch::DECL_CXX_CONSTRUCTOR;
+  Code = serialization::DECL_CXX_CONSTRUCTOR;
 }
 
 void ASTDeclWriter::VisitCXXDestructorDecl(CXXDestructorDecl *D) {
@@ -777,19 +777,19 @@
   Record.push_back(D->ImplicitlyDefined);
   Writer.AddDeclRef(D->OperatorDelete, Record);
 
-  Code = pch::DECL_CXX_DESTRUCTOR;
+  Code = serialization::DECL_CXX_DESTRUCTOR;
 }
 
 void ASTDeclWriter::VisitCXXConversionDecl(CXXConversionDecl *D) {
   VisitCXXMethodDecl(D);
   Record.push_back(D->IsExplicitSpecified);
-  Code = pch::DECL_CXX_CONVERSION;
+  Code = serialization::DECL_CXX_CONVERSION;
 }
 
 void ASTDeclWriter::VisitAccessSpecDecl(AccessSpecDecl *D) {
   VisitDecl(D);
   Writer.AddSourceLocation(D->getColonLoc(), Record);
-  Code = pch::DECL_ACCESS_SPEC;
+  Code = serialization::DECL_ACCESS_SPEC;
 }
 
 void ASTDeclWriter::VisitFriendDecl(FriendDecl *D) {
@@ -801,7 +801,7 @@
     Writer.AddDeclRef(D->Friend.get<NamedDecl*>(), Record);
   Writer.AddDeclRef(D->NextFriend, Record);
   Writer.AddSourceLocation(D->FriendLoc, Record);
-  Code = pch::DECL_FRIEND;
+  Code = serialization::DECL_FRIEND;
 }
 
 void ASTDeclWriter::VisitFriendTemplateDecl(FriendTemplateDecl *D) {
@@ -815,7 +815,7 @@
   else
     Writer.AddTypeSourceInfo(D->getFriendType(), Record);
   Writer.AddSourceLocation(D->getFriendLoc(), Record);
-  Code = pch::DECL_FRIEND_TEMPLATE;
+  Code = serialization::DECL_FRIEND_TEMPLATE;
 }
 
 void ASTDeclWriter::VisitTemplateDecl(TemplateDecl *D) {
@@ -876,7 +876,7 @@
 
     // InjectedClassNameType is computed, no need to write it.
   }
-  Code = pch::DECL_CLASS_TEMPLATE;
+  Code = serialization::DECL_CLASS_TEMPLATE;
 }
 
 void ASTDeclWriter::VisitClassTemplateSpecializationDecl(
@@ -910,7 +910,7 @@
     Writer.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl(), Record);
   }
 
-  Code = pch::DECL_CLASS_TEMPLATE_SPECIALIZATION;
+  Code = serialization::DECL_CLASS_TEMPLATE_SPECIALIZATION;
 }
 
 void ASTDeclWriter::VisitClassTemplatePartialSpecializationDecl(
@@ -931,7 +931,7 @@
     Record.push_back(D->isMemberSpecialization());
   }
 
-  Code = pch::DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION;
+  Code = serialization::DECL_CLASS_TEMPLATE_PARTIAL_SPECIALIZATION;
 }
 
 void ASTDeclWriter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
@@ -950,7 +950,7 @@
       Writer.AddDeclRef(I->Function, Record);
     }
   }
-  Code = pch::DECL_FUNCTION_TEMPLATE;
+  Code = serialization::DECL_FUNCTION_TEMPLATE;
 }
 
 void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
@@ -961,7 +961,7 @@
   Record.push_back(D->defaultArgumentWasInherited());
   Writer.AddTypeSourceInfo(D->getDefaultArgumentInfo(), Record);
 
-  Code = pch::DECL_TEMPLATE_TYPE_PARM;
+  Code = serialization::DECL_TEMPLATE_TYPE_PARM;
 }
 
 void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {
@@ -975,7 +975,7 @@
     Writer.AddStmt(D->getDefaultArgument());
     Record.push_back(D->defaultArgumentWasInherited());
   }
-  Code = pch::DECL_NON_TYPE_TEMPLATE_PARM;
+  Code = serialization::DECL_NON_TYPE_TEMPLATE_PARM;
 }
 
 void ASTDeclWriter::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) {
@@ -986,14 +986,14 @@
   // Rest of TemplateTemplateParmDecl.
   Writer.AddTemplateArgumentLoc(D->getDefaultArgument(), Record);
   Record.push_back(D->defaultArgumentWasInherited());
-  Code = pch::DECL_TEMPLATE_TEMPLATE_PARM;
+  Code = serialization::DECL_TEMPLATE_TEMPLATE_PARM;
 }
 
 void ASTDeclWriter::VisitStaticAssertDecl(StaticAssertDecl *D) {
   VisitDecl(D);
   Writer.AddStmt(D->getAssertExpr());
   Writer.AddStmt(D->getMessage());
-  Code = pch::DECL_STATIC_ASSERT;
+  Code = serialization::DECL_STATIC_ASSERT;
 }
 
 /// \brief Emit the DeclContext part of a declaration context decl.
@@ -1045,7 +1045,7 @@
   using namespace llvm;
   // Abbreviation for DECL_PARM_VAR.
   BitCodeAbbrev *Abv = new BitCodeAbbrev();
-  Abv->Add(BitCodeAbbrevOp(pch::DECL_PARM_VAR));
+  Abv->Add(BitCodeAbbrevOp(serialization::DECL_PARM_VAR));
 
   // Decl
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // DeclContext
@@ -1064,7 +1064,7 @@
   // ValueDecl
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Type
   // DeclaratorDecl
-  Abv->Add(BitCodeAbbrevOp(pch::PREDEF_TYPE_NULL_ID)); // InfoType
+  Abv->Add(BitCodeAbbrevOp(serialization::PREDEF_TYPE_NULL_ID)); // InfoType
   // VarDecl
   Abv->Add(BitCodeAbbrevOp(0));                       // StorageClass
   Abv->Add(BitCodeAbbrevOp(0));                       // StorageClassAsWritten
@@ -1083,7 +1083,7 @@
   ParmVarDeclAbbrev = Stream.EmitAbbrev(Abv);
 
   Abv = new BitCodeAbbrev();
-  Abv->Add(BitCodeAbbrevOp(pch::DECL_CONTEXT_LEXICAL));
+  Abv->Add(BitCodeAbbrevOp(serialization::DECL_CONTEXT_LEXICAL));
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob));
   DeclContextLexicalAbbrev = Stream.EmitAbbrev(Abv);
 }
@@ -1126,10 +1126,10 @@
   }
 
   // Determine the ID for this declaration
-  pch::DeclID &IDR = DeclIDs[D];
+  serialization::DeclID &IDR = DeclIDs[D];
   if (IDR == 0)
     IDR = NextDeclID++;
-  pch::DeclID ID = IDR;
+  serialization::DeclID ID = IDR;
 
   if (ID < FirstDeclID) {
     // We're replacing a decl in a previous file.
@@ -1148,7 +1148,7 @@
 
   // Build and emit a record for this declaration
   Record.clear();
-  W.Code = (pch::DeclCode)0;
+  W.Code = (serialization::DeclCode)0;
   W.AbbrevToUse = 0;
   W.Visit(D);
   if (DC) W.VisitDeclContext(DC, LexicalOffset, VisibleOffset);

Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=111478&r1=111477&r2=111478&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Wed Aug 18 18:57:32 2010
@@ -28,7 +28,7 @@
     ASTWriter::RecordData &Record;
 
   public:
-    pch::StmtCode Code;
+    serialization::StmtCode Code;
 
     ASTStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
       : Writer(Writer), Record(Record) { }
@@ -169,7 +169,7 @@
 void ASTStmtWriter::VisitNullStmt(NullStmt *S) {
   VisitStmt(S);
   Writer.AddSourceLocation(S->getSemiLoc(), Record);
-  Code = pch::STMT_NULL;
+  Code = serialization::STMT_NULL;
 }
 
 void ASTStmtWriter::VisitCompoundStmt(CompoundStmt *S) {
@@ -180,7 +180,7 @@
     Writer.AddStmt(*CS);
   Writer.AddSourceLocation(S->getLBracLoc(), Record);
   Writer.AddSourceLocation(S->getRBracLoc(), Record);
-  Code = pch::STMT_COMPOUND;
+  Code = serialization::STMT_COMPOUND;
 }
 
 void ASTStmtWriter::VisitSwitchCase(SwitchCase *S) {
@@ -196,7 +196,7 @@
   Writer.AddSourceLocation(S->getCaseLoc(), Record);
   Writer.AddSourceLocation(S->getEllipsisLoc(), Record);
   Writer.AddSourceLocation(S->getColonLoc(), Record);
-  Code = pch::STMT_CASE;
+  Code = serialization::STMT_CASE;
 }
 
 void ASTStmtWriter::VisitDefaultStmt(DefaultStmt *S) {
@@ -204,7 +204,7 @@
   Writer.AddStmt(S->getSubStmt());
   Writer.AddSourceLocation(S->getDefaultLoc(), Record);
   Writer.AddSourceLocation(S->getColonLoc(), Record);
-  Code = pch::STMT_DEFAULT;
+  Code = serialization::STMT_DEFAULT;
 }
 
 void ASTStmtWriter::VisitLabelStmt(LabelStmt *S) {
@@ -213,7 +213,7 @@
   Writer.AddStmt(S->getSubStmt());
   Writer.AddSourceLocation(S->getIdentLoc(), Record);
   Record.push_back(Writer.GetLabelID(S));
-  Code = pch::STMT_LABEL;
+  Code = serialization::STMT_LABEL;
 }
 
 void ASTStmtWriter::VisitIfStmt(IfStmt *S) {
@@ -224,7 +224,7 @@
   Writer.AddStmt(S->getElse());
   Writer.AddSourceLocation(S->getIfLoc(), Record);
   Writer.AddSourceLocation(S->getElseLoc(), Record);
-  Code = pch::STMT_IF;
+  Code = serialization::STMT_IF;
 }
 
 void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
@@ -236,7 +236,7 @@
   for (SwitchCase *SC = S->getSwitchCaseList(); SC;
        SC = SC->getNextSwitchCase())
     Record.push_back(Writer.RecordSwitchCaseID(SC));
-  Code = pch::STMT_SWITCH;
+  Code = serialization::STMT_SWITCH;
 }
 
 void ASTStmtWriter::VisitWhileStmt(WhileStmt *S) {
@@ -245,7 +245,7 @@
   Writer.AddStmt(S->getCond());
   Writer.AddStmt(S->getBody());
   Writer.AddSourceLocation(S->getWhileLoc(), Record);
-  Code = pch::STMT_WHILE;
+  Code = serialization::STMT_WHILE;
 }
 
 void ASTStmtWriter::VisitDoStmt(DoStmt *S) {
@@ -255,7 +255,7 @@
   Writer.AddSourceLocation(S->getDoLoc(), Record);
   Writer.AddSourceLocation(S->getWhileLoc(), Record);
   Writer.AddSourceLocation(S->getRParenLoc(), Record);
-  Code = pch::STMT_DO;
+  Code = serialization::STMT_DO;
 }
 
 void ASTStmtWriter::VisitForStmt(ForStmt *S) {
@@ -268,7 +268,7 @@
   Writer.AddSourceLocation(S->getForLoc(), Record);
   Writer.AddSourceLocation(S->getLParenLoc(), Record);
   Writer.AddSourceLocation(S->getRParenLoc(), Record);
-  Code = pch::STMT_FOR;
+  Code = serialization::STMT_FOR;
 }
 
 void ASTStmtWriter::VisitGotoStmt(GotoStmt *S) {
@@ -276,7 +276,7 @@
   Record.push_back(Writer.GetLabelID(S->getLabel()));
   Writer.AddSourceLocation(S->getGotoLoc(), Record);
   Writer.AddSourceLocation(S->getLabelLoc(), Record);
-  Code = pch::STMT_GOTO;
+  Code = serialization::STMT_GOTO;
 }
 
 void ASTStmtWriter::VisitIndirectGotoStmt(IndirectGotoStmt *S) {
@@ -284,19 +284,19 @@
   Writer.AddSourceLocation(S->getGotoLoc(), Record);
   Writer.AddSourceLocation(S->getStarLoc(), Record);
   Writer.AddStmt(S->getTarget());
-  Code = pch::STMT_INDIRECT_GOTO;
+  Code = serialization::STMT_INDIRECT_GOTO;
 }
 
 void ASTStmtWriter::VisitContinueStmt(ContinueStmt *S) {
   VisitStmt(S);
   Writer.AddSourceLocation(S->getContinueLoc(), Record);
-  Code = pch::STMT_CONTINUE;
+  Code = serialization::STMT_CONTINUE;
 }
 
 void ASTStmtWriter::VisitBreakStmt(BreakStmt *S) {
   VisitStmt(S);
   Writer.AddSourceLocation(S->getBreakLoc(), Record);
-  Code = pch::STMT_BREAK;
+  Code = serialization::STMT_BREAK;
 }
 
 void ASTStmtWriter::VisitReturnStmt(ReturnStmt *S) {
@@ -304,7 +304,7 @@
   Writer.AddStmt(S->getRetValue());
   Writer.AddSourceLocation(S->getReturnLoc(), Record);
   Writer.AddDeclRef(S->getNRVOCandidate(), Record);
-  Code = pch::STMT_RETURN;
+  Code = serialization::STMT_RETURN;
 }
 
 void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) {
@@ -314,7 +314,7 @@
   DeclGroupRef DG = S->getDeclGroup();
   for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D)
     Writer.AddDeclRef(*D, Record);
-  Code = pch::STMT_DECL;
+  Code = serialization::STMT_DECL;
 }
 
 void ASTStmtWriter::VisitAsmStmt(AsmStmt *S) {
@@ -347,7 +347,7 @@
   for (unsigned I = 0, N = S->getNumClobbers(); I != N; ++I)
     Writer.AddStmt(S->getClobber(I));
 
-  Code = pch::STMT_ASM;
+  Code = serialization::STMT_ASM;
 }
 
 void ASTStmtWriter::VisitExpr(Expr *E) {
@@ -361,7 +361,7 @@
   VisitExpr(E);
   Writer.AddSourceLocation(E->getLocation(), Record);
   Record.push_back(E->getIdentType()); // FIXME: stable encoding
-  Code = pch::EXPR_PREDEFINED;
+  Code = serialization::EXPR_PREDEFINED;
 }
 
 void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
@@ -384,14 +384,14 @@
   Writer.AddDeclRef(E->getDecl(), Record);
   // FIXME: write DeclarationNameLoc.
   Writer.AddSourceLocation(E->getLocation(), Record);
-  Code = pch::EXPR_DECL_REF;
+  Code = serialization::EXPR_DECL_REF;
 }
 
 void ASTStmtWriter::VisitIntegerLiteral(IntegerLiteral *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getLocation(), Record);
   Writer.AddAPInt(E->getValue(), Record);
-  Code = pch::EXPR_INTEGER_LITERAL;
+  Code = serialization::EXPR_INTEGER_LITERAL;
 }
 
 void ASTStmtWriter::VisitFloatingLiteral(FloatingLiteral *E) {
@@ -399,13 +399,13 @@
   Writer.AddAPFloat(E->getValue(), Record);
   Record.push_back(E->isExact());
   Writer.AddSourceLocation(E->getLocation(), Record);
-  Code = pch::EXPR_FLOATING_LITERAL;
+  Code = serialization::EXPR_FLOATING_LITERAL;
 }
 
 void ASTStmtWriter::VisitImaginaryLiteral(ImaginaryLiteral *E) {
   VisitExpr(E);
   Writer.AddStmt(E->getSubExpr());
-  Code = pch::EXPR_IMAGINARY_LITERAL;
+  Code = serialization::EXPR_IMAGINARY_LITERAL;
 }
 
 void ASTStmtWriter::VisitStringLiteral(StringLiteral *E) {
@@ -420,7 +420,7 @@
   Record.append(E->getString().begin(), E->getString().end());
   for (unsigned I = 0, N = E->getNumConcatenated(); I != N; ++I)
     Writer.AddSourceLocation(E->getStrTokenLoc(I), Record);
-  Code = pch::EXPR_STRING_LITERAL;
+  Code = serialization::EXPR_STRING_LITERAL;
 }
 
 void ASTStmtWriter::VisitCharacterLiteral(CharacterLiteral *E) {
@@ -428,7 +428,7 @@
   Record.push_back(E->getValue());
   Writer.AddSourceLocation(E->getLocation(), Record);
   Record.push_back(E->isWide());
-  Code = pch::EXPR_CHARACTER_LITERAL;
+  Code = serialization::EXPR_CHARACTER_LITERAL;
 }
 
 void ASTStmtWriter::VisitParenExpr(ParenExpr *E) {
@@ -436,7 +436,7 @@
   Writer.AddSourceLocation(E->getLParen(), Record);
   Writer.AddSourceLocation(E->getRParen(), Record);
   Writer.AddStmt(E->getSubExpr());
-  Code = pch::EXPR_PAREN;
+  Code = serialization::EXPR_PAREN;
 }
 
 void ASTStmtWriter::VisitParenListExpr(ParenListExpr *E) {
@@ -446,7 +446,7 @@
     Writer.AddStmt(E->Exprs[i]);
   Writer.AddSourceLocation(E->LParenLoc, Record);
   Writer.AddSourceLocation(E->RParenLoc, Record);
-  Code = pch::EXPR_PAREN_LIST;
+  Code = serialization::EXPR_PAREN_LIST;
 }
 
 void ASTStmtWriter::VisitUnaryOperator(UnaryOperator *E) {
@@ -454,7 +454,7 @@
   Writer.AddStmt(E->getSubExpr());
   Record.push_back(E->getOpcode()); // FIXME: stable encoding
   Writer.AddSourceLocation(E->getOperatorLoc(), Record);
-  Code = pch::EXPR_UNARY_OPERATOR;
+  Code = serialization::EXPR_UNARY_OPERATOR;
 }
 
 void ASTStmtWriter::VisitOffsetOfExpr(OffsetOfExpr *E) {
@@ -489,7 +489,7 @@
   }
   for (unsigned I = 0, N = E->getNumExpressions(); I != N; ++I)
     Writer.AddStmt(E->getIndexExpr(I));
-  Code = pch::EXPR_OFFSETOF;
+  Code = serialization::EXPR_OFFSETOF;
 }
 
 void ASTStmtWriter::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
@@ -503,7 +503,7 @@
   }
   Writer.AddSourceLocation(E->getOperatorLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_SIZEOF_ALIGN_OF;
+  Code = serialization::EXPR_SIZEOF_ALIGN_OF;
 }
 
 void ASTStmtWriter::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
@@ -511,7 +511,7 @@
   Writer.AddStmt(E->getLHS());
   Writer.AddStmt(E->getRHS());
   Writer.AddSourceLocation(E->getRBracketLoc(), Record);
-  Code = pch::EXPR_ARRAY_SUBSCRIPT;
+  Code = serialization::EXPR_ARRAY_SUBSCRIPT;
 }
 
 void ASTStmtWriter::VisitCallExpr(CallExpr *E) {
@@ -522,7 +522,7 @@
   for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
        Arg != ArgEnd; ++Arg)
     Writer.AddStmt(*Arg);
-  Code = pch::EXPR_CALL;
+  Code = serialization::EXPR_CALL;
 }
 
 void ASTStmtWriter::VisitMemberExpr(MemberExpr *E) {
@@ -555,7 +555,7 @@
   // FIXME: write DeclarationNameLoc.
   Writer.AddSourceLocation(E->getMemberLoc(), Record);
   Record.push_back(E->isArrow());
-  Code = pch::EXPR_MEMBER;
+  Code = serialization::EXPR_MEMBER;
 }
 
 void ASTStmtWriter::VisitObjCIsaExpr(ObjCIsaExpr *E) {
@@ -563,7 +563,7 @@
   Writer.AddStmt(E->getBase());
   Writer.AddSourceLocation(E->getIsaMemberLoc(), Record);
   Record.push_back(E->isArrow());
-  Code = pch::EXPR_OBJC_ISA;
+  Code = serialization::EXPR_OBJC_ISA;
 }
 
 void ASTStmtWriter::VisitCastExpr(CastExpr *E) {
@@ -583,14 +583,14 @@
   Writer.AddStmt(E->getRHS());
   Record.push_back(E->getOpcode()); // FIXME: stable encoding
   Writer.AddSourceLocation(E->getOperatorLoc(), Record);
-  Code = pch::EXPR_BINARY_OPERATOR;
+  Code = serialization::EXPR_BINARY_OPERATOR;
 }
 
 void ASTStmtWriter::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
   VisitBinaryOperator(E);
   Writer.AddTypeRef(E->getComputationLHSType(), Record);
   Writer.AddTypeRef(E->getComputationResultType(), Record);
-  Code = pch::EXPR_COMPOUND_ASSIGN_OPERATOR;
+  Code = serialization::EXPR_COMPOUND_ASSIGN_OPERATOR;
 }
 
 void ASTStmtWriter::VisitConditionalOperator(ConditionalOperator *E) {
@@ -600,13 +600,13 @@
   Writer.AddStmt(E->getRHS());
   Writer.AddSourceLocation(E->getQuestionLoc(), Record);
   Writer.AddSourceLocation(E->getColonLoc(), Record);
-  Code = pch::EXPR_CONDITIONAL_OPERATOR;
+  Code = serialization::EXPR_CONDITIONAL_OPERATOR;
 }
 
 void ASTStmtWriter::VisitImplicitCastExpr(ImplicitCastExpr *E) {
   VisitCastExpr(E);
   Record.push_back(E->getCategory());
-  Code = pch::EXPR_IMPLICIT_CAST;
+  Code = serialization::EXPR_IMPLICIT_CAST;
 }
 
 void ASTStmtWriter::VisitExplicitCastExpr(ExplicitCastExpr *E) {
@@ -618,7 +618,7 @@
   VisitExplicitCastExpr(E);
   Writer.AddSourceLocation(E->getLParenLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CSTYLE_CAST;
+  Code = serialization::EXPR_CSTYLE_CAST;
 }
 
 void ASTStmtWriter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) {
@@ -627,7 +627,7 @@
   Writer.AddTypeSourceInfo(E->getTypeSourceInfo(), Record);
   Writer.AddStmt(E->getInitializer());
   Record.push_back(E->isFileScope());
-  Code = pch::EXPR_COMPOUND_LITERAL;
+  Code = serialization::EXPR_COMPOUND_LITERAL;
 }
 
 void ASTStmtWriter::VisitExtVectorElementExpr(ExtVectorElementExpr *E) {
@@ -635,7 +635,7 @@
   Writer.AddStmt(E->getBase());
   Writer.AddIdentifierRef(&E->getAccessor(), Record);
   Writer.AddSourceLocation(E->getAccessorLoc(), Record);
-  Code = pch::EXPR_EXT_VECTOR_ELEMENT;
+  Code = serialization::EXPR_EXT_VECTOR_ELEMENT;
 }
 
 void ASTStmtWriter::VisitInitListExpr(InitListExpr *E) {
@@ -648,7 +648,7 @@
   Writer.AddSourceLocation(E->getRBraceLoc(), Record);
   Writer.AddDeclRef(E->getInitializedFieldInUnion(), Record);
   Record.push_back(E->hadArrayRangeDesignator());
-  Code = pch::EXPR_INIT_LIST;
+  Code = serialization::EXPR_INIT_LIST;
 }
 
 void ASTStmtWriter::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
@@ -663,34 +663,34 @@
        D != DEnd; ++D) {
     if (D->isFieldDesignator()) {
       if (FieldDecl *Field = D->getField()) {
-        Record.push_back(pch::DESIG_FIELD_DECL);
+        Record.push_back(serialization::DESIG_FIELD_DECL);
         Writer.AddDeclRef(Field, Record);
       } else {
-        Record.push_back(pch::DESIG_FIELD_NAME);
+        Record.push_back(serialization::DESIG_FIELD_NAME);
         Writer.AddIdentifierRef(D->getFieldName(), Record);
       }
       Writer.AddSourceLocation(D->getDotLoc(), Record);
       Writer.AddSourceLocation(D->getFieldLoc(), Record);
     } else if (D->isArrayDesignator()) {
-      Record.push_back(pch::DESIG_ARRAY);
+      Record.push_back(serialization::DESIG_ARRAY);
       Record.push_back(D->getFirstExprIndex());
       Writer.AddSourceLocation(D->getLBracketLoc(), Record);
       Writer.AddSourceLocation(D->getRBracketLoc(), Record);
     } else {
       assert(D->isArrayRangeDesignator() && "Unknown designator");
-      Record.push_back(pch::DESIG_ARRAY_RANGE);
+      Record.push_back(serialization::DESIG_ARRAY_RANGE);
       Record.push_back(D->getFirstExprIndex());
       Writer.AddSourceLocation(D->getLBracketLoc(), Record);
       Writer.AddSourceLocation(D->getEllipsisLoc(), Record);
       Writer.AddSourceLocation(D->getRBracketLoc(), Record);
     }
   }
-  Code = pch::EXPR_DESIGNATED_INIT;
+  Code = serialization::EXPR_DESIGNATED_INIT;
 }
 
 void ASTStmtWriter::VisitImplicitValueInitExpr(ImplicitValueInitExpr *E) {
   VisitExpr(E);
-  Code = pch::EXPR_IMPLICIT_VALUE_INIT;
+  Code = serialization::EXPR_IMPLICIT_VALUE_INIT;
 }
 
 void ASTStmtWriter::VisitVAArgExpr(VAArgExpr *E) {
@@ -699,7 +699,7 @@
   Writer.AddTypeSourceInfo(E->getWrittenTypeInfo(), Record);
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_VA_ARG;
+  Code = serialization::EXPR_VA_ARG;
 }
 
 void ASTStmtWriter::VisitAddrLabelExpr(AddrLabelExpr *E) {
@@ -707,7 +707,7 @@
   Writer.AddSourceLocation(E->getAmpAmpLoc(), Record);
   Writer.AddSourceLocation(E->getLabelLoc(), Record);
   Record.push_back(Writer.GetLabelID(E->getLabel()));
-  Code = pch::EXPR_ADDR_LABEL;
+  Code = serialization::EXPR_ADDR_LABEL;
 }
 
 void ASTStmtWriter::VisitStmtExpr(StmtExpr *E) {
@@ -715,7 +715,7 @@
   Writer.AddStmt(E->getSubStmt());
   Writer.AddSourceLocation(E->getLParenLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_STMT;
+  Code = serialization::EXPR_STMT;
 }
 
 void ASTStmtWriter::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) {
@@ -724,7 +724,7 @@
   Writer.AddTypeSourceInfo(E->getArgTInfo2(), Record);
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_TYPES_COMPATIBLE;
+  Code = serialization::EXPR_TYPES_COMPATIBLE;
 }
 
 void ASTStmtWriter::VisitChooseExpr(ChooseExpr *E) {
@@ -734,13 +734,13 @@
   Writer.AddStmt(E->getRHS());
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CHOOSE;
+  Code = serialization::EXPR_CHOOSE;
 }
 
 void ASTStmtWriter::VisitGNUNullExpr(GNUNullExpr *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getTokenLocation(), Record);
-  Code = pch::EXPR_GNU_NULL;
+  Code = serialization::EXPR_GNU_NULL;
 }
 
 void ASTStmtWriter::VisitShuffleVectorExpr(ShuffleVectorExpr *E) {
@@ -750,14 +750,14 @@
     Writer.AddStmt(E->getExpr(I));
   Writer.AddSourceLocation(E->getBuiltinLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_SHUFFLE_VECTOR;
+  Code = serialization::EXPR_SHUFFLE_VECTOR;
 }
 
 void ASTStmtWriter::VisitBlockExpr(BlockExpr *E) {
   VisitExpr(E);
   Writer.AddDeclRef(E->getBlockDecl(), Record);
   Record.push_back(E->hasBlockDeclRefExprs());
-  Code = pch::EXPR_BLOCK;
+  Code = serialization::EXPR_BLOCK;
 }
 
 void ASTStmtWriter::VisitBlockDeclRefExpr(BlockDeclRefExpr *E) {
@@ -767,7 +767,7 @@
   Record.push_back(E->isByRef());
   Record.push_back(E->isConstQualAdded());
   Writer.AddStmt(E->getCopyConstructorExpr());
-  Code = pch::EXPR_BLOCK_DECL_REF;
+  Code = serialization::EXPR_BLOCK_DECL_REF;
 }
 
 //===----------------------------------------------------------------------===//
@@ -778,7 +778,7 @@
   VisitExpr(E);
   Writer.AddStmt(E->getString());
   Writer.AddSourceLocation(E->getAtLoc(), Record);
-  Code = pch::EXPR_OBJC_STRING_LITERAL;
+  Code = serialization::EXPR_OBJC_STRING_LITERAL;
 }
 
 void ASTStmtWriter::VisitObjCEncodeExpr(ObjCEncodeExpr *E) {
@@ -786,7 +786,7 @@
   Writer.AddTypeSourceInfo(E->getEncodedTypeSourceInfo(), Record);
   Writer.AddSourceLocation(E->getAtLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_OBJC_ENCODE;
+  Code = serialization::EXPR_OBJC_ENCODE;
 }
 
 void ASTStmtWriter::VisitObjCSelectorExpr(ObjCSelectorExpr *E) {
@@ -794,7 +794,7 @@
   Writer.AddSelectorRef(E->getSelector(), Record);
   Writer.AddSourceLocation(E->getAtLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_OBJC_SELECTOR_EXPR;
+  Code = serialization::EXPR_OBJC_SELECTOR_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCProtocolExpr(ObjCProtocolExpr *E) {
@@ -802,7 +802,7 @@
   Writer.AddDeclRef(E->getProtocol(), Record);
   Writer.AddSourceLocation(E->getAtLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_OBJC_PROTOCOL_EXPR;
+  Code = serialization::EXPR_OBJC_PROTOCOL_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
@@ -812,7 +812,7 @@
   Writer.AddStmt(E->getBase());
   Record.push_back(E->isArrow());
   Record.push_back(E->isFreeIvar());
-  Code = pch::EXPR_OBJC_IVAR_REF_EXPR;
+  Code = serialization::EXPR_OBJC_IVAR_REF_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
@@ -820,7 +820,7 @@
   Writer.AddDeclRef(E->getProperty(), Record);
   Writer.AddSourceLocation(E->getLocation(), Record);
   Writer.AddStmt(E->getBase());
-  Code = pch::EXPR_OBJC_PROPERTY_REF_EXPR;
+  Code = serialization::EXPR_OBJC_PROPERTY_REF_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCImplicitSetterGetterRefExpr(
@@ -834,7 +834,7 @@
   Writer.AddStmt(E->getBase());
   Writer.AddSourceLocation(E->getLocation(), Record);
   Writer.AddSourceLocation(E->getClassLoc(), Record);
-  Code = pch::EXPR_OBJC_KVC_REF_EXPR;
+  Code = serialization::EXPR_OBJC_KVC_REF_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) {
@@ -871,13 +871,13 @@
   for (CallExpr::arg_iterator Arg = E->arg_begin(), ArgEnd = E->arg_end();
        Arg != ArgEnd; ++Arg)
     Writer.AddStmt(*Arg);
-  Code = pch::EXPR_OBJC_MESSAGE_EXPR;
+  Code = serialization::EXPR_OBJC_MESSAGE_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCSuperExpr(ObjCSuperExpr *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getLoc(), Record);
-  Code = pch::EXPR_OBJC_SUPER_EXPR;
+  Code = serialization::EXPR_OBJC_SUPER_EXPR;
 }
 
 void ASTStmtWriter::VisitObjCForCollectionStmt(ObjCForCollectionStmt *S) {
@@ -887,7 +887,7 @@
   Writer.AddStmt(S->getBody());
   Writer.AddSourceLocation(S->getForLoc(), Record);
   Writer.AddSourceLocation(S->getRParenLoc(), Record);
-  Code = pch::STMT_OBJC_FOR_COLLECTION;
+  Code = serialization::STMT_OBJC_FOR_COLLECTION;
 }
 
 void ASTStmtWriter::VisitObjCAtCatchStmt(ObjCAtCatchStmt *S) {
@@ -895,13 +895,13 @@
   Writer.AddDeclRef(S->getCatchParamDecl(), Record);
   Writer.AddSourceLocation(S->getAtCatchLoc(), Record);
   Writer.AddSourceLocation(S->getRParenLoc(), Record);
-  Code = pch::STMT_OBJC_CATCH;
+  Code = serialization::STMT_OBJC_CATCH;
 }
 
 void ASTStmtWriter::VisitObjCAtFinallyStmt(ObjCAtFinallyStmt *S) {
   Writer.AddStmt(S->getFinallyBody());
   Writer.AddSourceLocation(S->getAtFinallyLoc(), Record);
-  Code = pch::STMT_OBJC_FINALLY;
+  Code = serialization::STMT_OBJC_FINALLY;
 }
 
 void ASTStmtWriter::VisitObjCAtTryStmt(ObjCAtTryStmt *S) {
@@ -913,20 +913,20 @@
   if (S->getFinallyStmt())
     Writer.AddStmt(S->getFinallyStmt());
   Writer.AddSourceLocation(S->getAtTryLoc(), Record);
-  Code = pch::STMT_OBJC_AT_TRY;
+  Code = serialization::STMT_OBJC_AT_TRY;
 }
 
 void ASTStmtWriter::VisitObjCAtSynchronizedStmt(ObjCAtSynchronizedStmt *S) {
   Writer.AddStmt(S->getSynchExpr());
   Writer.AddStmt(S->getSynchBody());
   Writer.AddSourceLocation(S->getAtSynchronizedLoc(), Record);
-  Code = pch::STMT_OBJC_AT_SYNCHRONIZED;
+  Code = serialization::STMT_OBJC_AT_SYNCHRONIZED;
 }
 
 void ASTStmtWriter::VisitObjCAtThrowStmt(ObjCAtThrowStmt *S) {
   Writer.AddStmt(S->getThrowExpr());
   Writer.AddSourceLocation(S->getThrowLoc(), Record);
-  Code = pch::STMT_OBJC_AT_THROW;
+  Code = serialization::STMT_OBJC_AT_THROW;
 }
 
 //===----------------------------------------------------------------------===//
@@ -938,7 +938,7 @@
   Writer.AddSourceLocation(S->getCatchLoc(), Record);
   Writer.AddDeclRef(S->getExceptionDecl(), Record);
   Writer.AddStmt(S->getHandlerBlock());
-  Code = pch::STMT_CXX_CATCH;
+  Code = serialization::STMT_CXX_CATCH;
 }
 
 void ASTStmtWriter::VisitCXXTryStmt(CXXTryStmt *S) {
@@ -948,18 +948,18 @@
   Writer.AddStmt(S->getTryBlock());
   for (unsigned i = 0, e = S->getNumHandlers(); i != e; ++i)
     Writer.AddStmt(S->getHandler(i));
-  Code = pch::STMT_CXX_TRY;
+  Code = serialization::STMT_CXX_TRY;
 }
 
 void ASTStmtWriter::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
   VisitCallExpr(E);
   Record.push_back(E->getOperator());
-  Code = pch::EXPR_CXX_OPERATOR_CALL;
+  Code = serialization::EXPR_CXX_OPERATOR_CALL;
 }
 
 void ASTStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
   VisitCallExpr(E);
-  Code = pch::EXPR_CXX_MEMBER_CALL;
+  Code = serialization::EXPR_CXX_MEMBER_CALL;
 }
 
 void ASTStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
@@ -972,14 +972,14 @@
   Record.push_back(E->isElidable());
   Record.push_back(E->requiresZeroInitialization());
   Record.push_back(E->getConstructionKind()); // FIXME: stable encoding
-  Code = pch::EXPR_CXX_CONSTRUCT;
+  Code = serialization::EXPR_CXX_CONSTRUCT;
 }
 
 void ASTStmtWriter::VisitCXXTemporaryObjectExpr(CXXTemporaryObjectExpr *E) {
   VisitCXXConstructExpr(E);
   Writer.AddSourceLocation(E->getTypeBeginLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CXX_TEMPORARY_OBJECT;
+  Code = serialization::EXPR_CXX_TEMPORARY_OBJECT;
 }
 
 void ASTStmtWriter::VisitCXXNamedCastExpr(CXXNamedCastExpr *E) {
@@ -989,42 +989,42 @@
 
 void ASTStmtWriter::VisitCXXStaticCastExpr(CXXStaticCastExpr *E) {
   VisitCXXNamedCastExpr(E);
-  Code = pch::EXPR_CXX_STATIC_CAST;
+  Code = serialization::EXPR_CXX_STATIC_CAST;
 }
 
 void ASTStmtWriter::VisitCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
   VisitCXXNamedCastExpr(E);
-  Code = pch::EXPR_CXX_DYNAMIC_CAST;
+  Code = serialization::EXPR_CXX_DYNAMIC_CAST;
 }
 
 void ASTStmtWriter::VisitCXXReinterpretCastExpr(CXXReinterpretCastExpr *E) {
   VisitCXXNamedCastExpr(E);
-  Code = pch::EXPR_CXX_REINTERPRET_CAST;
+  Code = serialization::EXPR_CXX_REINTERPRET_CAST;
 }
 
 void ASTStmtWriter::VisitCXXConstCastExpr(CXXConstCastExpr *E) {
   VisitCXXNamedCastExpr(E);
-  Code = pch::EXPR_CXX_CONST_CAST;
+  Code = serialization::EXPR_CXX_CONST_CAST;
 }
 
 void ASTStmtWriter::VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *E) {
   VisitExplicitCastExpr(E);
   Writer.AddSourceLocation(E->getTypeBeginLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CXX_FUNCTIONAL_CAST;
+  Code = serialization::EXPR_CXX_FUNCTIONAL_CAST;
 }
 
 void ASTStmtWriter::VisitCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
   VisitExpr(E);
   Record.push_back(E->getValue());
   Writer.AddSourceLocation(E->getLocation(), Record);
-  Code = pch::EXPR_CXX_BOOL_LITERAL;
+  Code = serialization::EXPR_CXX_BOOL_LITERAL;
 }
 
 void ASTStmtWriter::VisitCXXNullPtrLiteralExpr(CXXNullPtrLiteralExpr *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getLocation(), Record);
-  Code = pch::EXPR_CXX_NULL_PTR_LITERAL;
+  Code = serialization::EXPR_CXX_NULL_PTR_LITERAL;
 }
 
 void ASTStmtWriter::VisitCXXTypeidExpr(CXXTypeidExpr *E) {
@@ -1032,10 +1032,10 @@
   Writer.AddSourceRange(E->getSourceRange(), Record);
   if (E->isTypeOperand()) {
     Writer.AddTypeSourceInfo(E->getTypeOperandSourceInfo(), Record);
-    Code = pch::EXPR_CXX_TYPEID_TYPE;
+    Code = serialization::EXPR_CXX_TYPEID_TYPE;
   } else {
     Writer.AddStmt(E->getExprOperand());
-    Code = pch::EXPR_CXX_TYPEID_EXPR;
+    Code = serialization::EXPR_CXX_TYPEID_EXPR;
   }
 }
 
@@ -1043,14 +1043,14 @@
   VisitExpr(E);
   Writer.AddSourceLocation(E->getLocation(), Record);
   Record.push_back(E->isImplicit());
-  Code = pch::EXPR_CXX_THIS;
+  Code = serialization::EXPR_CXX_THIS;
 }
 
 void ASTStmtWriter::VisitCXXThrowExpr(CXXThrowExpr *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getThrowLoc(), Record);
   Writer.AddStmt(E->getSubExpr());
-  Code = pch::EXPR_CXX_THROW;
+  Code = serialization::EXPR_CXX_THROW;
 }
 
 void ASTStmtWriter::VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
@@ -1064,14 +1064,14 @@
   Writer.AddDeclRef(E->getParam(), Record);
   Writer.AddSourceLocation(E->getUsedLocation(), Record);
 
-  Code = pch::EXPR_CXX_DEFAULT_ARG;
+  Code = serialization::EXPR_CXX_DEFAULT_ARG;
 }
 
 void ASTStmtWriter::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
   VisitExpr(E);
   Writer.AddCXXTemporary(E->getTemporary(), Record);
   Writer.AddStmt(E->getSubExpr());
-  Code = pch::EXPR_CXX_BIND_TEMPORARY;
+  Code = serialization::EXPR_CXX_BIND_TEMPORARY;
 }
 
 void ASTStmtWriter::VisitCXXBindReferenceExpr(CXXBindReferenceExpr *E) {
@@ -1079,14 +1079,14 @@
   Writer.AddStmt(E->getSubExpr());
   Record.push_back(E->extendsLifetime());
   Record.push_back(E->requiresTemporaryCopy());
-  Code = pch::EXPR_CXX_BIND_REFERENCE;
+  Code = serialization::EXPR_CXX_BIND_REFERENCE;
 }
 
 void ASTStmtWriter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
   VisitExpr(E);
   Writer.AddSourceLocation(E->getTypeBeginLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CXX_SCALAR_VALUE_INIT;
+  Code = serialization::EXPR_CXX_SCALAR_VALUE_INIT;
 }
 
 void ASTStmtWriter::VisitCXXNewExpr(CXXNewExpr *E) {
@@ -1106,7 +1106,7 @@
        I != e; ++I)
     Writer.AddStmt(*I);
   
-  Code = pch::EXPR_CXX_NEW;
+  Code = serialization::EXPR_CXX_NEW;
 }
 
 void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) {
@@ -1117,7 +1117,7 @@
   Writer.AddStmt(E->getArgument());
   Writer.AddSourceLocation(E->getSourceRange().getBegin(), Record);
   
-  Code = pch::EXPR_CXX_DELETE;
+  Code = serialization::EXPR_CXX_DELETE;
 }
 
 void ASTStmtWriter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
@@ -1139,7 +1139,7 @@
   else
     Writer.AddTypeSourceInfo(E->getDestroyedTypeInfo(), Record);
 
-  Code = pch::EXPR_CXX_PSEUDO_DESTRUCTOR;
+  Code = serialization::EXPR_CXX_PSEUDO_DESTRUCTOR;
 }
 
 void ASTStmtWriter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
@@ -1149,7 +1149,7 @@
     Writer.AddCXXTemporary(E->getTemporary(i), Record);
   
   Writer.AddStmt(E->getSubExpr());
-  Code = pch::EXPR_CXX_EXPR_WITH_TEMPORARIES;
+  Code = serialization::EXPR_CXX_EXPR_WITH_TEMPORARIES;
 }
 
 void
@@ -1182,7 +1182,7 @@
   // FIXME: write whole DeclarationNameInfo.
   Writer.AddDeclarationName(E->getMember(), Record);
   Writer.AddSourceLocation(E->getMemberLoc(), Record);
-  Code = pch::EXPR_CXX_DEPENDENT_SCOPE_MEMBER;
+  Code = serialization::EXPR_CXX_DEPENDENT_SCOPE_MEMBER;
 }
 
 void
@@ -1206,7 +1206,7 @@
   Writer.AddSourceLocation(E->getLocation(), Record);
   Writer.AddSourceRange(E->getQualifierRange(), Record);
   Writer.AddNestedNameSpecifier(E->getQualifier(), Record);
-  Code = pch::EXPR_CXX_DEPENDENT_SCOPE_DECL_REF;
+  Code = serialization::EXPR_CXX_DEPENDENT_SCOPE_DECL_REF;
 }
 
 void
@@ -1220,7 +1220,7 @@
   Writer.AddTypeRef(E->getTypeAsWritten(), Record);
   Writer.AddSourceLocation(E->getLParenLoc(), Record);
   Writer.AddSourceLocation(E->getRParenLoc(), Record);
-  Code = pch::EXPR_CXX_UNRESOLVED_CONSTRUCT;
+  Code = serialization::EXPR_CXX_UNRESOLVED_CONSTRUCT;
 }
 
 void ASTStmtWriter::VisitOverloadExpr(OverloadExpr *E) {
@@ -1259,7 +1259,7 @@
   Writer.AddStmt(!E->isImplicitAccess() ? E->getBase() : 0);
   Writer.AddTypeRef(E->getBaseType(), Record);
   Writer.AddSourceLocation(E->getOperatorLoc(), Record);
-  Code = pch::EXPR_CXX_UNRESOLVED_MEMBER;
+  Code = serialization::EXPR_CXX_UNRESOLVED_MEMBER;
 }
 
 void ASTStmtWriter::VisitUnresolvedLookupExpr(UnresolvedLookupExpr *E) {
@@ -1267,7 +1267,7 @@
   Record.push_back(E->requiresADL());
   Record.push_back(E->isOverloaded());
   Writer.AddDeclRef(E->getNamingClass(), Record);
-  Code = pch::EXPR_CXX_UNRESOLVED_LOOKUP;
+  Code = serialization::EXPR_CXX_UNRESOLVED_LOOKUP;
 }
 
 void ASTStmtWriter::VisitUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) {
@@ -1275,7 +1275,7 @@
   Record.push_back(E->getTrait());
   Writer.AddSourceRange(E->getSourceRange(), Record);
   Writer.AddTypeRef(E->getQueriedType(), Record);
-  Code = pch::EXPR_CXX_UNARY_TYPE_TRAIT;
+  Code = serialization::EXPR_CXX_UNARY_TYPE_TRAIT;
 }
 
 //===----------------------------------------------------------------------===//
@@ -1316,7 +1316,7 @@
   ++NumStatements;
   
   if (!S) {
-    Stream.EmitRecord(pch::STMT_NULL_PTR, Record);
+    Stream.EmitRecord(serialization::STMT_NULL_PTR, Record);
     return;
   }
 
@@ -1324,11 +1324,11 @@
   llvm::SmallVector<Stmt *, 16> SubStmts;
   CollectedStmts = &SubStmts;
 
-  Writer.Code = pch::STMT_NULL_PTR;
+  Writer.Code = serialization::STMT_NULL_PTR;
   Writer.Visit(S);
   
 #ifndef NDEBUG
-  if (Writer.Code == pch::STMT_NULL_PTR) {
+  if (Writer.Code == serialization::STMT_NULL_PTR) {
     SourceManager &SrcMgr
       = DeclIDs.begin()->first->getASTContext().getSourceManager();
     S->dump(SrcMgr);
@@ -1363,7 +1363,7 @@
     // Note that we are at the end of a full expression. Any
     // expression records that follow this one are part of a different
     // expression.
-    Stream.EmitRecord(pch::STMT_STOP, Record);
+    Stream.EmitRecord(serialization::STMT_STOP, Record);
   }
 
   StmtsToEmit.clear();





More information about the cfe-commits mailing list