diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h
index 19cfae5..84833c0 100644
--- a/include/clang/AST/ASTConsumer.h
+++ b/include/clang/AST/ASTConsumer.h
@@ -50,7 +50,7 @@
   virtual void HandleTopLevelDecl(DeclGroupRef D);
 
   /// HandleInterestingDecl - Handle the specified interesting declaration. This
-  /// is called by the PCH reader when deserializing things that might interest
+  /// is called by the AST reader when deserializing things that might interest
   /// the consumer. The default implementation forwards to HandleTopLevelDecl.
   virtual void HandleInterestingDecl(DeclGroupRef D);
 
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 83270ab..34092c7 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -226,8 +226,8 @@
   /// PCHLevel - the "level" of AST file from which this declaration was built.
   unsigned PCHLevel : 2;
 
-  /// PCHChanged - if this declaration has changed since being deserialized
-  bool PCHChanged : 1;
+  /// ChangedAfterLoad - if this declaration has changed since being loaded
+  bool ChangedAfterLoad : 1;
 
   /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
   unsigned IdentifierNamespace : 15;
@@ -245,7 +245,7 @@
     : NextDeclInContext(0), DeclCtx(DC),
       Loc(L), DeclKind(DK), InvalidDecl(0),
       HasAttrs(false), Implicit(false), Used(false),
-      Access(AS_none), PCHLevel(0), PCHChanged(false),
+      Access(AS_none), PCHLevel(0), ChangedAfterLoad(false),
       IdentifierNamespace(getIdentifierNamespaceForKind(DK)) {
     if (Decl::CollectingStats()) add(DK);
   }
@@ -253,7 +253,7 @@
   Decl(Kind DK, EmptyShell Empty)
     : NextDeclInContext(0), DeclKind(DK), InvalidDecl(0),
       HasAttrs(false), Implicit(false), Used(false),
-      Access(AS_none), PCHLevel(0), PCHChanged(false),
+      Access(AS_none), PCHLevel(0), ChangedAfterLoad(false),
       IdentifierNamespace(getIdentifierNamespaceForKind(DK)) {
     if (Decl::CollectingStats()) add(DK);
   }
@@ -380,11 +380,10 @@
   /// declaration was generated.
   ///
   /// The PCH level of a declaration describes where the declaration originated
-  /// from. A PCH level of 0 indicates that the declaration was not from a
-  /// precompiled header. A PCH level of 1 indicates that the declaration was
-  /// from a top-level precompiled header; 2 indicates that the declaration
-  /// comes from a precompiled header on which the top-level precompiled header
-  /// depends, and so on. 
+  /// from. A PCH level of 0 indicates that the declaration was parsed from
+  /// source. A PCH level of 1 indicates that the declaration was loaded from
+  /// a top-level AST file. A PCH level 2 indicates that the declaration was
+  /// loaded from a PCH file the AST file depends on, and so on.
   unsigned getPCHLevel() const { return PCHLevel; }
 
   /// \brief The maximum PCH level that any declaration may have.
@@ -401,11 +400,13 @@
   ///
   /// In an epic violation of layering, what is "significant" is entirely
   /// up to the serialization system, but implemented in AST and Sema.
-  bool isChangedSinceDeserialization() const { return PCHChanged; }
+  bool isChangedSinceDeserialization() const { return ChangedAfterLoad; }
 
   /// \brief Mark this declaration as having changed since deserialization, or
   /// reset the flag.
-  void setChangedSinceDeserialization(bool Changed) { PCHChanged = Changed; }
+  void setChangedSinceDeserialization(bool Changed) {
+    ChangedAfterLoad = Changed;
+  }
 
   unsigned getIdentifierNamespace() const {
     return IdentifierNamespace;
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 1cc0e39..a2f08b7 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -787,12 +787,12 @@
   /// \brief Linkage of this type.
   mutable unsigned CachedLinkage : 2;
 
-  /// \brief FromPCH - Whether this type comes from a PCH file.
-  mutable bool FromPCH : 1;
+  /// \brief FromAST - Whether this type comes from an AST file.
+  mutable bool FromAST : 1;
 
-  /// \brief Set whether this type comes from a PCH file.
-  void setFromPCH(bool V = true) const { 
-    FromPCH = V;
+  /// \brief Set whether this type comes from an AST file.
+  void setFromAST(bool V = true) const { 
+    FromAST = V;
   }
 
 protected:
@@ -806,15 +806,15 @@
   Type(TypeClass tc, QualType Canonical, bool dependent)
     : CanonicalType(Canonical.isNull() ? QualType(this_(), 0) : Canonical),
       TC(tc), Dependent(dependent), LinkageKnown(false), 
-      CachedLinkage(NoLinkage), FromPCH(false) {}
+      CachedLinkage(NoLinkage), FromAST(false) {}
   virtual ~Type();
   friend class ASTContext;
 
 public:
   TypeClass getTypeClass() const { return static_cast<TypeClass>(TC); }
 
-  /// \brief Whether this type comes from a PCH file.
-  bool isFromPCH() const { return FromPCH; }
+  /// \brief Whether this type comes from an AST file.
+  bool isFromAST() const { return FromAST; }
 
   bool isCanonicalUnqualified() const {
     return CanonicalType.getTypePtr() == this;
@@ -1856,13 +1856,13 @@
   // * FunctionNoProtoType::Profile
   // * FunctionProtoType::Profile
   // * TypePrinter::PrintFunctionProto
-  // * PCH read and write
+  // * AST read and write
   // * Codegen
 
   class ExtInfo {
    public:
     // Constructor with no defaults. Use this when you know that you
-    // have all the elements (when reading a PCH file for example).
+    // have all the elements (when reading an AST file for example).
     ExtInfo(bool noReturn, unsigned regParm, CallingConv cc) :
         NoReturn(noReturn), RegParm(regParm), CC(cc) {}
 
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index fa1b149..24fe086 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -59,8 +59,8 @@
   bool IsPoisoned             : 1; // True if identifier is poisoned.
   bool IsCPPOperatorKeyword   : 1; // True if ident is a C++ operator keyword.
   bool NeedsHandleIdentifier  : 1; // See "RecomputeNeedsHandleIdentifier".
-  bool IsFromPCH              : 1; // True if identfier first appeared in a PCH
-                                   // and wasn't modified since.
+  bool IsFromAST              : 1; // True if identfier first appeared in an AST
+                                   // file and wasn't modified since.
   bool RevertedTokenID        : 1; // True if RevertTokenIDToIdentifier was
                                    // called.
   // 7 bits left in 32-bit word.
@@ -129,7 +129,7 @@
       NeedsHandleIdentifier = 1;
     else
       RecomputeNeedsHandleIdentifier();
-    IsFromPCH = false;
+    IsFromAST = false;
   }
 
   /// getTokenID - If this is a source-language token (e.g. 'for'), this API
@@ -145,7 +145,7 @@
   ///
   /// TokenID is normally read-only but there are 2 instances where we revert it
   /// to tok::identifier for libstdc++ 4.2. Keep track of when this happens
-  /// using this method so we can inform PCH about it.
+  /// using this method so we can inform serialization about it.
   void RevertTokenIDToIdentifier() {
     assert(TokenID != tok::identifier && "Already at tok::identifier");
     TokenID = tok::identifier;
@@ -205,7 +205,7 @@
       NeedsHandleIdentifier = 1;
     else
       RecomputeNeedsHandleIdentifier();
-    IsFromPCH = false;
+    IsFromAST = false;
   }
 
   /// isPoisoned - Return true if this token has been poisoned.
@@ -233,11 +233,11 @@
   /// know that HandleIdentifier will not affect the token.
   bool isHandleIdentifierCase() const { return NeedsHandleIdentifier; }
 
-  /// isFromPCH - Return true if the identifier in its current state was loaded
-  /// from a PCH file.
-  bool isFromPCH() const { return IsFromPCH; }
+  /// isFromAST - Return true if the identifier in its current state was loaded
+  /// from an AST file.
+  bool isFromAST() const { return IsFromAST; }
 
-  void setIsFromPCH(bool FromPCH = true) { IsFromPCH = FromPCH; }
+  void setIsFromAST(bool FromAST = true) { IsFromAST = FromAST; }
 
 private:
   /// RecomputeNeedsHandleIdentifier - The Preprocessor::HandleIdentifier does
diff --git a/include/clang/Basic/Linkage.h b/include/clang/Basic/Linkage.h
index 035b4fc..01b6c79 100644
--- a/include/clang/Basic/Linkage.h
+++ b/include/clang/Basic/Linkage.h
@@ -42,7 +42,7 @@
 };
 
 /// \brief A more specific kind of linkage. This is relevant to CodeGen and
-/// PCH reading.
+/// AST file reading.
 enum GVALinkage {
   GVA_Internal,
   GVA_C99Inline,
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index dc314f1..91ade22 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -795,7 +795,7 @@
   unsigned sloc_entry_size() const { return SLocEntryTable.size(); }
 
   // FIXME: Exposing this is a little gross; what we want is a good way
-  //  to iterate the entries that were not defined in a PCH file (or
+  //  to iterate the entries that were not defined in an AST file (or
   //  any other external source).
   unsigned sloc_loaded_entry_size() const { return SLocEntryLoaded.size(); }
 
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 6e67aaf..60e06bb 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -53,7 +53,7 @@
 
 using namespace idx;
   
-/// \brief Utility class for loading a ASTContext from a PCH file.
+/// \brief Utility class for loading a ASTContext from an AST file.
 ///
 class ASTUnit {
 public:
@@ -196,7 +196,7 @@
   /// \brief The group of timers associated with this translation unit.
   llvm::OwningPtr<llvm::TimerGroup> TimerGroup;  
 
-  /// \brief A list of the PCH ID numbers for each of the top-level
+  /// \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;
 
@@ -358,7 +358,7 @@
         FileManager &getFileManager()       { return *FileMgr; }
 
   const std::string &getOriginalSourceFileName();
-  const std::string &getPCHFileName();
+  const std::string &getASTFileName();
 
   /// \brief Add a temporary file that the ASTUnit depends on.
   ///
@@ -458,15 +458,15 @@
   /// remapped contents of that file.
   typedef std::pair<std::string, const llvm::MemoryBuffer *> RemappedFile;
   
-  /// \brief Create a ASTUnit from a PCH file.
+  /// \brief Create a ASTUnit from an AST file.
   ///
-  /// \param Filename - The PCH file to load.
+  /// \param Filename - The AST file to load.
   ///
   /// \param Diags - The diagnostics engine to use for reporting errors; its
   /// lifetime is expected to extend past that of the returned ASTUnit.
   ///
-  /// \returns - The initialized ASTUnit or null if the PCH failed to load.
-  static ASTUnit *LoadFromPCHFile(const std::string &Filename,
+  /// \returns - The initialized ASTUnit or null if the AST failed to load.
+  static ASTUnit *LoadFromASTFile(const std::string &Filename,
                                   llvm::IntrusiveRefCntPtr<Diagnostic> Diags,
                                   bool OnlyLocalDecls = false,
                                   RemappedFile *RemappedFiles = 0,
diff --git a/include/clang/Frontend/FrontendAction.h b/include/clang/Frontend/FrontendAction.h
index 637458d..773543a 100644
--- a/include/clang/Frontend/FrontendAction.h
+++ b/include/clang/Frontend/FrontendAction.h
@@ -145,8 +145,8 @@
   /// @{
 
   /// usesPreprocessorOnly - Does this action only use the preprocessor? If so
-  /// no AST context will be created and this action will be invalid with PCH
-  /// inputs.
+  /// no AST context will be created and this action will be invalid with AST
+  /// file inputs.
   virtual bool usesPreprocessorOnly() const = 0;
 
   /// usesCompleteTranslationUnit - For AST based actions, should the
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h
index d526a94..4c16d08 100644
--- a/include/clang/Frontend/FrontendOptions.h
+++ b/include/clang/Frontend/FrontendOptions.h
@@ -60,10 +60,10 @@
                                            /// completion results.
   unsigned DisableFree : 1;                ///< Disable memory freeing on exit.
   unsigned RelocatablePCH : 1;             ///< When generating PCH files,
-                                           /// instruct the PCH writer to create
+                                           /// instruct the AST writer to create
                                            /// relocatable PCH files.
   unsigned ChainedPCH : 1;                 ///< When generating PCH files,
-                                           /// instruct the PCH writer to create
+                                           /// instruct the AST writer to create
                                            /// chained PCH files.
   unsigned ShowHelp : 1;                   ///< Show the -help text.
   unsigned ShowMacrosInCodeCompletion : 1; ///< Show macros in code completion
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h
index 009ec20..90f95b7 100644
--- a/include/clang/Lex/MacroInfo.h
+++ b/include/clang/Lex/MacroInfo.h
@@ -62,8 +62,8 @@
   /// it has not yet been redefined or undefined.
   bool IsBuiltinMacro : 1;
 
-  /// IsFromPCH - True if this macro was loaded from a PCH file.
-  bool IsFromPCH : 1;
+  /// IsFromAST - True if this macro was loaded from an AST file.
+  bool IsFromAST : 1;
 
 private:
   //===--------------------------------------------------------------------===//
@@ -185,11 +185,11 @@
   /// __LINE__, which requires processing before expansion.
   bool isBuiltinMacro() const { return IsBuiltinMacro; }
 
-  /// isFromPCH - Return true if this macro was loaded from a PCH file.
-  bool isFromPCH() const { return IsFromPCH; }
+  /// isFromAST - Return true if this macro was loaded from an AST file.
+  bool isFromAST() const { return IsFromAST; }
 
-  /// setIsFromPCH - Set whether this macro was loaded from a PCH file.
-  void setIsFromPCH(bool FromPCH = true) { IsFromPCH = FromPCH; }
+  /// setIsFromAST - Set whether this macro was loaded from an AST file.
+  void setIsFromAST(bool FromAST = true) { IsFromAST = FromAST; }
 
   /// isUsed - Return false if this macro is defined in the main file and has
   /// not yet been used.
diff --git a/include/clang/Sema/IdentifierResolver.h b/include/clang/Sema/IdentifierResolver.h
index 59bd834..e494792 100644
--- a/include/clang/Sema/IdentifierResolver.h
+++ b/include/clang/Sema/IdentifierResolver.h
@@ -169,7 +169,7 @@
   /// \brief Link the declaration into the chain of declarations for
   /// the given identifier.
   ///
-  /// This is a lower-level routine used by the PCH reader to link a
+  /// This is a lower-level routine used by the AST reader to link a
   /// declaration into a specific IdentifierInfo before the
   /// declaration actually has a name.
   void AddDeclToIdentifierChain(IdentifierInfo *II, NamedDecl *D);
diff --git a/include/clang/Serialization/PCHDeserializationListener.h b/include/clang/Serialization/PCHDeserializationListener.h
index ec02bf4..024fc5a 100644
--- a/include/clang/Serialization/PCHDeserializationListener.h
+++ b/include/clang/Serialization/PCHDeserializationListener.h
@@ -31,14 +31,15 @@
   /// \brief Tell the listener about the reader.
   virtual void SetReader(ASTReader *Reader) = 0;
 
-  /// \brief An identifier was deserialized from the PCH.
+  /// \brief An identifier was deserialized from the AST file.
   virtual void IdentifierRead(pch::IdentID ID, IdentifierInfo *II) = 0;
-  /// \brief A type was deserialized from the PCH. The ID here has the qualifier
-  ///        bits already removed, and T is guaranteed to be locally unqualified
+  /// \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;
-  /// \brief A decl was deserialized from the PCH.
+  /// \brief A decl was deserialized from the AST file.
   virtual void DeclRead(pch::DeclID ID, const Decl *D) = 0;
-  /// \brief A selector was read from the PCH.
+  /// \brief A selector was read from the AST file.
   virtual void SelectorRead(pch::SelectorID iD, Selector Sel) = 0;
 };
 
diff --git a/include/clang/Serialization/PCHReader.h b/include/clang/Serialization/PCHReader.h
index 5ce45b7..5d24b29 100644
--- a/include/clang/Serialization/PCHReader.h
+++ b/include/clang/Serialization/PCHReader.h
@@ -104,8 +104,8 @@
   ///
   /// \param Buffers Information about the predefines buffers.
   ///
-  /// \param OriginalFileName The original file name for the PCH, which will
-  /// appear as an entry in the predefines buffer.
+  /// \param OriginalFileName The original file name for the AST file, which
+  /// will appear as an entry in the predefines buffer.
   ///
   /// \param SuggestedPredefines If necessary, additional definitions are added
   /// here.
@@ -183,13 +183,13 @@
   Diagnostic &Diags;
 
   /// \brief The semantic analysis object that will be processing the
-  /// PCH files and the translation unit that uses it.
+  /// AST files and the translation unit that uses it.
   Sema *SemaObj;
 
   /// \brief The preprocessor that will be loading the source file.
   Preprocessor *PP;
 
-  /// \brief The AST context into which we'll read the PCH files.
+  /// \brief The AST context into which we'll read the AST files.
   ASTContext *Context;
       
   /// \brief The AST consumer.
@@ -199,12 +199,12 @@
   struct PerFileData {
     PerFileData();
 
-    /// \brief The PCH stat cache installed for this file, if any.
+    /// \brief The AST stat cache installed for this file, if any.
     ///
-    /// The dynamic type of this stat cache is always PCHStatCache
+    /// The dynamic type of this stat cache is always ASTStatCache
     void *StatCache;
 
-    /// \brief The bitstream reader from which we'll read the PCH file.
+    /// \brief The bitstream reader from which we'll read the AST file.
     llvm::BitstreamReader StreamFile;
     llvm::BitstreamCursor Stream;
 
@@ -220,38 +220,38 @@
     /// jump around with these in context.
     llvm::BitstreamCursor DeclsCursor;
 
-    /// \brief The file name of the PCH file.
+    /// \brief The file name of the AST file.
     std::string FileName;
 
     /// \brief The memory buffer that stores the data associated with
-    /// this PCH file.
+    /// this AST file.
     llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
 
     /// \brief Cursor used to read source location entries.
     llvm::BitstreamCursor SLocEntryCursor;
 
-    /// \brief The number of source location entries in this PCH file.
+    /// \brief The number of source location entries in this AST file.
     unsigned LocalNumSLocEntries;
 
     /// \brief Offsets for all of the source location entries in the
-    /// PCH file.
+    /// AST file.
     const uint32_t *SLocOffsets;
 
-    /// \brief The number of types in this PCH file.
+    /// \brief The number of types in this AST file.
     unsigned LocalNumTypes;
 
     /// \brief Offset of each type within the bitstream, indexed by the
     /// type ID, or the representation of a Type*.
     const uint32_t *TypeOffsets;
 
-    /// \brief The number of declarations in this PCH file.
+    /// \brief The number of declarations in this AST file.
     unsigned LocalNumDecls;
 
     /// \brief Offset of each declaration within the bitstream, indexed
     /// by the declaration ID (-1).
     const uint32_t *DeclOffsets;
 
-    /// \brief The number of identifiers in this PCH file.
+    /// \brief The number of identifiers in this AST file.
     unsigned LocalNumIdentifiers;
 
     /// \brief Offsets into the identifier table data.
@@ -275,7 +275,7 @@
     unsigned LocalNumMacroDefinitions;
 
     /// \brief Offsets of all of the macro definitions in the preprocessing
-    /// record in the PCH file.
+    /// record in the AST file.
     const uint32_t *MacroDefinitionOffsets;
       
     /// \brief The number of preallocated preprocessing entities in the
@@ -283,7 +283,7 @@
     unsigned NumPreallocatedPreprocessingEntities;
 
     /// \brief A pointer to an on-disk hash table of opaque type
-    /// PCHSelectorLookupTable.
+    /// ASTSelectorLookupTable.
     ///
     /// This hash table provides the IDs of all selectors, and the associated
     /// instance and factory methods.
@@ -304,18 +304,18 @@
     unsigned LocalNumSelectors;
   };
 
-  /// \brief The chain of PCH files. The first entry is the one named by the
+  /// \brief The chain of AST files. The first entry is the one named by the
   /// user, the last one is the one that doesn't depend on anything further.
   /// That is, the entry I was created with -include-pch I+1.
   llvm::SmallVector<PerFileData*, 2> Chain;
 
-  /// \brief Types that have already been loaded from the PCH file.
+  /// \brief Types that have already been loaded from the chain.
   ///
   /// When the pointer at index I is non-NULL, the type with
-  /// ID = (I + 1) << FastQual::Width has already been loaded from the PCH chain
+  /// ID = (I + 1) << FastQual::Width has already been loaded
   std::vector<QualType> TypesLoaded;
 
-  /// \brief Declarations that have already been loaded from the PCH file.
+  /// \brief Declarations that have already been loaded from the chain.
   ///
   /// When the pointer at index I is non-NULL, the declaration with ID
   /// = I + 1 has already been loaded.
@@ -343,7 +343,7 @@
 
   typedef llvm::DenseMap<pch::DeclID, pch::DeclID> FirstLatestDeclIDMap;
   /// \brief Map of first declarations from a chained PCH that point to the
-  /// most recent declarations in another PCH.
+  /// most recent declarations in another AST file.
   FirstLatestDeclIDMap FirstLatestDeclIDs;
 
   /// \brief Read the records that describe the contents of declcontexts.
@@ -373,49 +373,45 @@
   /// \brief The macro definitions we have already loaded.
   llvm::SmallVector<MacroDefinition *, 16> MacroDefinitionsLoaded;
       
-  /// \brief The set of external definitions stored in the the PCH
-  /// file.
+  /// \brief The set of external definitions stored in the the chain.
   llvm::SmallVector<uint64_t, 16> ExternalDefinitions;
 
-  /// \brief The set of tentative definitions stored in the the PCH
-  /// file.
+  /// \brief The set of tentative definitions stored in the the chain.
   llvm::SmallVector<uint64_t, 16> TentativeDefinitions;
       
-  /// \brief The set of unused file scoped decls stored in the the PCH file.
+  /// \brief The set of unused file scoped decls stored in the the chain.
   llvm::SmallVector<uint64_t, 16> UnusedFileScopedDecls;
   
-  /// \brief The set of weak undeclared identifiers stored in the the PCH file.
+  /// \brief The set of weak undeclared identifiers stored in the chain.
   llvm::SmallVector<uint64_t, 64> WeakUndeclaredIdentifiers;
 
-  /// \brief The set of locally-scoped external declarations stored in
-  /// the the PCH file.
+  /// \brief The set of locally-scoped external declarations stored in the chain
   llvm::SmallVector<uint64_t, 16> LocallyScopedExternalDecls;
 
-  /// \brief The set of ext_vector type declarations stored in the the
-  /// PCH file.
+  /// \brief The set of ext_vector type declarations stored in the the chain.
   llvm::SmallVector<uint64_t, 4> ExtVectorDecls;
 
-  /// \brief The set of VTable uses of CXXRecordDecls stored in the PCH file.
+  /// \brief The set of VTable uses of CXXRecordDecls stored in the chain.
   llvm::SmallVector<uint64_t, 64> VTableUses;
 
-  /// \brief The set of dynamic CXXRecord declarations stored in the PCH file.
+  /// \brief The set of dynamic CXXRecord declarations stored in the chain.
   llvm::SmallVector<uint64_t, 16> DynamicClasses;
 
-  /// \brief The set of pending implicit instantiations stored in the PCH file.
+  /// \brief The set of pending implicit instantiations stored in the chain.
   llvm::SmallVector<uint64_t, 64> PendingImplicitInstantiations;
 
-  /// \brief The set of Sema declaration references, stored in PCH.
+  /// \brief The set of Sema declaration references stored in the chain.
   llvm::SmallVector<uint64_t, 4> SemaDeclRefs;
 
-  /// \brief The set of Objective-C category definitions stored in the
-  /// the PCH file.
+  /// \brief The set of Objective-C category definitions stored in the the chain
   llvm::SmallVector<uint64_t, 4> ObjCCategoryImpls;
 
-  /// \brief The original file name that was used to build the PCH file, which
-  /// may have been modified for relocatable-pch support.
+  /// \brief The original file name that was used to build the primary AST file,
+  /// which may have been modified for relocatable-pch support.
   std::string OriginalFileName;
 
-  /// \brief The actual original file name that was used to build the PCH file.
+  /// \brief The actual original file name that was used to build the primary
+  /// AST file.
   std::string ActualOriginalFileName;
 
   /// \brief Whether this precompiled header is a relocatable PCH file.
@@ -429,12 +425,10 @@
   /// headers when they are loaded.
   bool DisableValidation;
       
-  /// \brief Mapping from switch-case IDs in the PCH file to
-  /// switch-case statements.
+  /// \brief Mapping from switch-case IDs in the chain to switch-case statements
   std::map<unsigned, SwitchCase *> SwitchCaseStmts;
 
-  /// \brief Mapping from label statement IDs in the PCH file to label
-  /// statements.
+  /// \brief Mapping from label statement IDs in the chain to label statements.
   std::map<unsigned, LabelStmt *> LabelStmts;
 
   /// \brief Mapping from label IDs to the set of "goto" statements
@@ -455,21 +449,21 @@
   /// the PCH file.
   unsigned NumSLocEntriesRead;
 
-  /// \brief The number of source location entries in all PCH files.
+  /// \brief The number of source location entries in the chain.
   unsigned TotalNumSLocEntries;
 
   /// \brief The number of statements (and expressions) de-serialized
-  /// from the PCH file.
+  /// from the chain.
   unsigned NumStatementsRead;
 
   /// \brief The total number of statements (and expressions) stored
-  /// in the PCH file.
+  /// in the chain.
   unsigned TotalNumStatements;
 
-  /// \brief The number of macros de-serialized from the PCH file.
+  /// \brief The number of macros de-serialized from the chain.
   unsigned NumMacrosRead;
 
-  /// \brief The total number of macros stored in the PCH file.
+  /// \brief The total number of macros stored in the chain.
   unsigned TotalNumMacros;
 
   /// \brief The number of selectors that have been read.
@@ -501,7 +495,7 @@
     llvm::SmallVector<uint32_t, 4> DeclIDs;
   };
 
-  /// \brief The set of identifiers that were read while the PCH reader was
+  /// \brief The set of identifiers that were read while the AST reader was
   /// (recursively) loading declarations.
   ///
   /// The declarations on the identifier chain for these identifiers will be
@@ -547,7 +541,7 @@
     ~ReadingKindTracker() { Reader.ReadingKind = PrevKind; }
   };
 
-  /// \brief All predefines buffers in all PCH files, to be treated as if
+  /// \brief All predefines buffers in the chain, to be treated as if
   /// concatenated.
   PCHPredefinesBlocks PCHPredefinesBuffers;
 
@@ -588,7 +582,7 @@
   /// \brief Produce an error diagnostic and return true.
   ///
   /// This routine should only be used for fatal errors that have to
-  /// do with non-routine failures (e.g., corrupted PCH file).
+  /// do with non-routine failures (e.g., corrupted AST file).
   void Error(const char *Msg);
 
   ASTReader(const ASTReader&); // do not implement
@@ -596,7 +590,7 @@
 public:
   typedef llvm::SmallVector<uint64_t, 64> RecordData;
 
-  /// \brief Load the PCH file and validate its contents against the given
+  /// \brief Load the AST file and validate its contents against the given
   /// Preprocessor.
   ///
   /// \param PP the preprocessor associated with the context in which this
@@ -609,31 +603,29 @@
   /// user. This is only used with relocatable PCH files. If non-NULL,
   /// a relocatable PCH file will use the default path "/".
   ///
-  /// \param DisableValidation If true, the PCH reader will suppress most
+  /// \param DisableValidation If true, the AST reader will suppress most
   /// of its regular consistency checking, allowing the use of precompiled
   /// headers that cannot be determined to be compatible.
   ASTReader(Preprocessor &PP, ASTContext *Context, const char *isysroot = 0,
             bool DisableValidation = false);
 
-  /// \brief Load the PCH file without using any pre-initialized Preprocessor.
+  /// \brief Load the AST file without using any pre-initialized Preprocessor.
   ///
   /// The necessary information to initialize a Preprocessor later can be
   /// obtained by setting a ASTReaderListener.
   ///
-  /// \param SourceMgr the source manager into which the precompiled header
-  /// will be loaded.
+  /// \param SourceMgr the source manager into which the AST file will be loaded
   ///
-  /// \param FileMgr the file manager into which the precompiled header will
-  /// be loaded.
+  /// \param FileMgr the file manager into which the AST file will be loaded.
   ///
   /// \param Diags the diagnostics system to use for reporting errors and
-  /// warnings relevant to loading the precompiled header.
+  /// warnings relevant to loading the AST file.
   ///
   /// \param isysroot If non-NULL, the system include path specified by the
   /// user. This is only used with relocatable PCH files. If non-NULL,
   /// a relocatable PCH file will use the default path "/".
   ///
-  /// \param DisableValidation If true, the PCH reader will suppress most
+  /// \param DisableValidation If true, the AST reader will suppress most
   /// of its regular consistency checking, allowing the use of precompiled
   /// headers that cannot be determined to be compatible.
       ASTReader(SourceManager &SourceMgr, FileManager &FileMgr,
@@ -645,12 +637,12 @@
   /// name.
   ASTReadResult ReadAST(const std::string &FileName);
 
-  /// \brief Set the PCH callbacks listener.
+  /// \brief Set the AST callbacks listener.
   void setListener(ASTReaderListener *listener) {
     Listener.reset(listener);
   }
 
-  /// \brief Set the PCH deserialization listener.
+  /// \brief Set the AST deserialization listener.
   void setDeserializationListener(ASTDeserializationListener *Listener);
 
   /// \brief Set the Preprocessor to use.
@@ -659,16 +651,15 @@
   /// \brief Sets and initializes the given Context.
   void InitializeContext(ASTContext &Context);
 
-  /// \brief Retrieve the name of the named (primary) PCH file
+  /// \brief Retrieve the name of the named (primary) AST file
   const std::string &getFileName() const { return Chain[0]->FileName; }
 
   /// \brief Retrieve the name of the original source file name
   const std::string &getOriginalSourceFile() { return OriginalFileName; }
 
-  /// \brief Retrieve the name of the original source file name
-  /// directly from the PCH file, without actually loading the PCH
-  /// file.
-  static std::string getOriginalSourceFile(const std::string &PCHFileName,
+  /// \brief Retrieve the name of the original source file name directly from
+  /// the AST file, without actually loading the AST file.
+  static std::string getOriginalSourceFile(const std::string &ASTFileName,
                                            Diagnostic &Diags);
 
   /// \brief Returns the suggested contents of the predefines buffer,
@@ -783,7 +774,7 @@
   /// the ASTConsumer.
   virtual void StartTranslationUnit(ASTConsumer *Consumer);
 
-  /// \brief Print some statistics about PCH usage.
+  /// \brief Print some statistics about AST usage.
   virtual void PrintStats();
 
   /// \brief Initialize the semantic source with the Sema instance
@@ -938,8 +929,7 @@
   /// \brief Retrieve the macro definition with the given ID.
   MacroDefinition *getMacroDefinition(pch::IdentID ID);
 
-  /// \brief Retrieve the AST context that this PCH reader
-  /// supplements.
+  /// \brief Retrieve the AST context that this AST reader supplements.
   ASTContext *getContext() { return Context; }
 
   // \brief Contains declarations that were loaded before we have
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index c7b16c9..e0d8571 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -34,7 +34,7 @@
   IsPoisoned = false;
   IsCPPOperatorKeyword = false;
   NeedsHandleIdentifier = false;
-  IsFromPCH = false;
+  IsFromAST = false;
   RevertedTokenID = false;
   FETokenInfo = 0;
   Entry = 0;
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 0a6ce4c..a01b002 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -1247,7 +1247,7 @@
   }
 
   // There is no common ancestor, most probably because one location is in the
-  // predefines buffer or a PCH file.
+  // predefines buffer or an AST file.
   // FIXME: We should rearrange the external interface so this simply never
   // happens; it can't conceptually happen. Also see PR5662.
   IsBeforeInTUCache.setQueryFIDs(FileID(), FileID()); // Don't try caching.
diff --git a/lib/Checker/GRCoreEngine.cpp b/lib/Checker/GRCoreEngine.cpp
index e0524d9..5125f36 100644
--- a/lib/Checker/GRCoreEngine.cpp
+++ b/lib/Checker/GRCoreEngine.cpp
@@ -696,7 +696,7 @@
 
     // Create a new AnalysisManager with components of the callee's
     // TranslationUnit.
-    // The Diagnostic is actually shared when we create ASTUnits from PCH files.
+    // The Diagnostic is actually shared when we create ASTUnits from AST files.
     AnalysisManager AMgr(TU->getASTContext(), TU->getDiagnostic(), 
                          OldMgr.getLangOptions(), 
                          OldMgr.getPathDiagnosticClient(),
diff --git a/lib/Frontend/ASTMerge.cpp b/lib/Frontend/ASTMerge.cpp
index cbaa6a3..b46212f 100644
--- a/lib/Frontend/ASTMerge.cpp
+++ b/lib/Frontend/ASTMerge.cpp
@@ -40,13 +40,13 @@
                                        &CI.getASTContext());
   llvm::IntrusiveRefCntPtr<Diagnostic> Diags(&CI.getDiagnostics());
   for (unsigned I = 0, N = ASTFiles.size(); I != N; ++I) {
-    ASTUnit *Unit = ASTUnit::LoadFromPCHFile(ASTFiles[I], Diags, false);
+    ASTUnit *Unit = ASTUnit::LoadFromASTFile(ASTFiles[I], Diags, false);
     if (!Unit)
       continue;
 
     // Reset the argument -> string function so that it has the AST
     // context we want, since the Sema object created by
-    // LoadFromPCHFile will override it.
+    // LoadFromASTFile will override it.
     CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
                                          &CI.getASTContext());
 
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index e0aa1b4..1749836 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -304,7 +304,7 @@
 
 /// \brief Gathers information from ASTReader that will be used to initialize
 /// a Preprocessor.
-class PCHInfoCollector : public ASTReaderListener {
+class ASTInfoCollector : public ASTReaderListener {
   LangOptions &LangOpt;
   HeaderSearch &HSI;
   std::string &TargetTriple;
@@ -314,7 +314,7 @@
   unsigned NumHeaderInfos;
 
 public:
-  PCHInfoCollector(LangOptions &LangOpt, HeaderSearch &HSI,
+  ASTInfoCollector(LangOptions &LangOpt, HeaderSearch &HSI,
                    std::string &TargetTriple, std::string &Predefines,
                    unsigned &Counter)
     : LangOpt(LangOpt), HSI(HSI), TargetTriple(TargetTriple),
@@ -398,12 +398,12 @@
   return OriginalSourceFile;
 }
 
-const std::string &ASTUnit::getPCHFileName() {
-  assert(isMainFileAST() && "Not an ASTUnit from a PCH file!");
+const std::string &ASTUnit::getASTFileName() {
+  assert(isMainFileAST() && "Not an ASTUnit from an AST file!");
   return static_cast<ASTReader *>(Ctx->getExternalSource())->getFileName();
 }
 
-ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename,
+ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
                                   llvm::IntrusiveRefCntPtr<Diagnostic> Diags,
                                   bool OnlyLocalDecls,
                                   RemappedFile *RemappedFiles,
@@ -460,7 +460,7 @@
 
   Reader.reset(new ASTReader(AST->getSourceManager(), AST->getFileManager(),
                              AST->getDiagnostics()));
-  Reader->setListener(new PCHInfoCollector(LangInfo, HeaderInfo, TargetTriple,
+  Reader->setListener(new ASTInfoCollector(LangInfo, HeaderInfo, TargetTriple,
                                            Predefines, Counter));
 
   switch (Reader->ReadAST(Filename)) {
@@ -475,11 +475,11 @@
 
   AST->OriginalSourceFile = Reader->getOriginalSourceFile();
 
-  // PCH loaded successfully. Now create the preprocessor.
+  // AST file loaded successfully. Now create the preprocessor.
 
   // Get information about the target being compiled for.
   //
-  // FIXME: This is broken, we should store the TargetOptions in the PCH.
+  // FIXME: This is broken, we should store the TargetOptions in the AST file.
   TargetOptions TargetOpts;
   TargetOpts.ABI = "";
   TargetOpts.CXXABI = "itanium";
@@ -512,7 +512,7 @@
 
   // Attach the AST reader to the AST context as an external AST
   // source, so that declarations will be deserialized from the
-  // PCH file as needed.
+  // AST file as needed.
   ASTReader *ReaderPtr = Reader.get();
   llvm::OwningPtr<ExternalASTSource> Source(Reader.take());
   Context.setExternalSource(Source);
diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp
index 906fd9a..531213b 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/lib/Frontend/FrontendAction.cpp
@@ -51,7 +51,7 @@
 
     llvm::IntrusiveRefCntPtr<Diagnostic> Diags(&CI.getDiagnostics());
     std::string Error;
-    ASTUnit *AST = ASTUnit::LoadFromPCHFile(Filename, Diags);
+    ASTUnit *AST = ASTUnit::LoadFromASTFile(Filename, Diags);
     if (!AST)
       goto failure;
 
diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp
index 6eac036..c6d0934 100644
--- a/lib/Lex/MacroInfo.cpp
+++ b/lib/Lex/MacroInfo.cpp
@@ -20,7 +20,7 @@
   IsC99Varargs = false;
   IsGNUVarargs = false;
   IsBuiltinMacro = false;
-  IsFromPCH = false;
+  IsFromAST = false;
   IsDisabled = false;
   IsUsed = true;
   IsAllowRedefinitionsWithoutWarning = false;
@@ -37,7 +37,7 @@
   IsC99Varargs = MI.IsC99Varargs;
   IsGNUVarargs = MI.IsGNUVarargs;
   IsBuiltinMacro = MI.IsBuiltinMacro;
-  IsFromPCH = MI.IsFromPCH;
+  IsFromAST = MI.IsFromAST;
   IsDisabled = MI.IsDisabled;
   IsUsed = MI.IsUsed;
   IsAllowRedefinitionsWithoutWarning = MI.IsAllowRedefinitionsWithoutWarning;
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp
index 2e33c1e..d38f403 100644
--- a/lib/Sema/IdentifierResolver.cpp
+++ b/lib/Sema/IdentifierResolver.cpp
@@ -140,7 +140,7 @@
 void IdentifierResolver::AddDecl(NamedDecl *D) {
   DeclarationName Name = D->getDeclName();
   if (IdentifierInfo *II = Name.getAsIdentifierInfo())
-    II->setIsFromPCH(false);
+    II->setIsFromAST(false);
 
   void *Ptr = Name.getFETokenInfo<void>();
 
@@ -168,7 +168,7 @@
   assert(D && "null param passed");
   DeclarationName Name = D->getDeclName();
   if (IdentifierInfo *II = Name.getAsIdentifierInfo())
-    II->setIsFromPCH(false);
+    II->setIsFromAST(false);
 
   void *Ptr = Name.getFETokenInfo<void>();
 
@@ -189,7 +189,7 @@
 
   DeclarationName Name = Old->getDeclName();
   if (IdentifierInfo *II = Name.getAsIdentifierInfo())
-    II->setIsFromPCH(false);
+    II->setIsFromAST(false);
 
   void *Ptr = Name.getFETokenInfo<void>();
 
@@ -227,7 +227,7 @@
 
 void IdentifierResolver::AddDeclToIdentifierChain(IdentifierInfo *II,
                                                   NamedDecl *D) {
-  II->setIsFromPCH(false);
+  II->setIsFromAST(false);
   void *Ptr = II->getFETokenInfo<void>();
 
   if (!Ptr) {
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 4810dab..635236e 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -3581,7 +3581,7 @@
     // We're messaging "id" as a type; provide all class/factory methods.
 
     // If we have an external source, load the entire class method
-    // pool from the PCH file.
+    // pool from the AST file.
     if (ExternalSource) {
       for (uint32_t I = 0, N = ExternalSource->GetNumExternalSelectors();
            I != N; ++I) {
@@ -3682,7 +3682,7 @@
     // about as code-completion results.
 
     // If we have an external source, load the entire class method
-    // pool from the PCH file.
+    // pool from the AST file.
     if (ExternalSource) {
       for (uint32_t I = 0, N = ExternalSource->GetNumExternalSelectors();
            I != N; ++I) {
@@ -4239,7 +4239,7 @@
                                               IdentifierInfo **SelIdents,
                                               unsigned NumSelIdents) {
   // If we have an external source, load the entire class method
-  // pool from the PCH file.
+  // pool from the AST file.
   if (ExternalSource) {
     for (uint32_t I = 0, N = ExternalSource->GetNumExternalSelectors();
          I != N; ++I) {
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 0fd3d6e..0abc4a9 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -90,7 +90,7 @@
       IDecl->setForwardDecl(false);
       IDecl->setClassLoc(ClassLoc);
       // If the forward decl was in a PCH, we need to write it again in a
-      // chained PCH.
+      // dependent AST file.
       IDecl->setChangedSinceDeserialization(true);
       
       // Since this ObjCInterfaceDecl was created by a forward declaration,
@@ -288,7 +288,7 @@
     PDecl->setLocation(AtProtoInterfaceLoc);
     PDecl->setForwardDecl(false);
     CurContext->addDecl(PDecl);
-    // Repeat in dependent PCHs.
+    // Repeat in dependent AST files.
     PDecl->setChangedSinceDeserialization(true);
   } else {
     PDecl = ObjCProtocolDecl::Create(Context, CurContext,
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 6f0c8ce..6f456e5 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -1271,7 +1271,7 @@
     // Don't emit builtin macros like __LINE__ to the AST file unless they have
     // been redefined by the header (in which case they are not isBuiltinMacro).
     // Also skip macros from a AST file if we're chaining.
-    if (MI->isBuiltinMacro() || (Chain && MI->isFromPCH()))
+    if (MI->isBuiltinMacro() || (Chain && MI->isFromAST()))
       continue;
 
     AddIdentifierRef(I->first, Record);
@@ -1900,7 +1900,7 @@
            ID = IdentifierIDs.begin(), IDEnd = IdentifierIDs.end();
          ID != IDEnd; ++ID) {
       assert(ID->first && "NULL identifier in identifier table");
-      if (!Chain || !ID->first->isFromPCH())
+      if (!Chain || !ID->first->isFromAST())
         Generator.insert(ID->first, ID->second);
     }
 
@@ -2249,7 +2249,7 @@
   // The special types are in the chained PCH.
 
   // We don't start with the translation unit, but with its decls that
-  // don't come from the other PCH.
+  // don't come from the chained PCH.
   const TranslationUnitDecl *TU = Context.getTranslationUnitDecl();
   llvm::SmallVector<pch::DeclID, 64> NewGlobalDecls;
   for (DeclContext::decl_iterator I = TU->noload_decls_begin(),
diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp
index f8dabaa..5329b6c 100644
--- a/lib/Serialization/GeneratePCH.cpp
+++ b/lib/Serialization/GeneratePCH.cpp
@@ -8,7 +8,7 @@
 //===----------------------------------------------------------------------===//
 //
 //  This file defines the CreatePCHGenerate function, which creates an
-//  ASTConsumeR that generates a PCH file.
+//  ASTConsumer that generates a PCH file.
 //
 //===----------------------------------------------------------------------===//
 
diff --git a/lib/Serialization/PCHReader.cpp b/lib/Serialization/PCHReader.cpp
index 72f4974..5cf677a 100644
--- a/lib/Serialization/PCHReader.cpp
+++ b/lib/Serialization/PCHReader.cpp
@@ -43,7 +43,7 @@
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
-// PCH reader validator implementation
+// PCH validator implementation
 //===----------------------------------------------------------------------===//
 
 ASTReaderListener::~ASTReaderListener() {}
@@ -242,9 +242,6 @@
 
   // If the concatenation of all the PCH buffers is equal to the adjusted
   // command line, we're done.
-  // We build a SmallVector of the command line here, because we'll eventually
-  // need to support an arbitrary amount of pieces anyway (when we have chained
-  // PCH reading).
   llvm::SmallVector<llvm::StringRef, 2> CommandLine;
   CommandLine.push_back(Left);
   CommandLine.push_back(Right);
@@ -468,7 +465,7 @@
 
 
 namespace {
-class PCHSelectorLookupTrait {
+class ASTSelectorLookupTrait {
   ASTReader &Reader;
 
 public:
@@ -480,7 +477,7 @@
   typedef Selector external_key_type;
   typedef external_key_type internal_key_type;
 
-  explicit PCHSelectorLookupTrait(ASTReader &Reader) : Reader(Reader) { }
+  explicit ASTSelectorLookupTrait(ASTReader &Reader) : Reader(Reader) { }
 
   static bool EqualKey(const internal_key_type& a,
                        const internal_key_type& b) {
@@ -581,17 +578,17 @@
 } // end anonymous namespace
 
 /// \brief The on-disk hash table used for the global method pool.
-typedef OnDiskChainedHashTable<PCHSelectorLookupTrait>
-  PCHSelectorLookupTable;
+typedef OnDiskChainedHashTable<ASTSelectorLookupTrait>
+  ASTSelectorLookupTable;
 
 namespace {
-class PCHIdentifierLookupTrait {
+class ASTIdentifierLookupTrait {
   ASTReader &Reader;
   llvm::BitstreamCursor &Stream;
 
   // If we know the IdentifierInfo in advance, it is here and we will
   // not build a new one. Used when deserializing information about an
-  // identifier that was constructed before the PCH file was read.
+  // identifier that was constructed before the AST file was read.
   IdentifierInfo *KnownII;
 
 public:
@@ -601,7 +598,7 @@
 
   typedef external_key_type internal_key_type;
 
-  PCHIdentifierLookupTrait(ASTReader &Reader, llvm::BitstreamCursor &Stream,
+  ASTIdentifierLookupTrait(ASTReader &Reader, llvm::BitstreamCursor &Stream,
                            IdentifierInfo *II = 0)
     : Reader(Reader), Stream(Stream), KnownII(II) { }
 
@@ -650,7 +647,7 @@
       if (!II)
         II = &Reader.getIdentifierTable().getOwn(k.first, k.first + k.second);
       Reader.SetIdentifierInfo(ID, II);
-      II->setIsFromPCH();
+      II->setIsFromAST();
       return II;
     }
 
@@ -709,7 +706,7 @@
       Reader.SetGloballyVisibleDecls(II, DeclIDs);
     }
 
-    II->setIsFromPCH();
+    II->setIsFromAST();
     return II;
   }
 };
@@ -718,22 +715,14 @@
 
 /// \brief The on-disk hash table used to contain information about
 /// all of the identifiers in the program.
-typedef OnDiskChainedHashTable<PCHIdentifierLookupTrait>
-  PCHIdentifierLookupTable;
+typedef OnDiskChainedHashTable<ASTIdentifierLookupTrait>
+  ASTIdentifierLookupTable;
 
 void ASTReader::Error(const char *Msg) {
   Diag(diag::err_fe_pch_malformed) << Msg;
 }
 
-/// \brief Check the contents of the concatenation of all predefines buffers in
-/// the PCH chain against the contents of the predefines buffer of the current
-/// compiler invocation.
-///
-/// The contents should be the same. If not, then some command-line option
-/// changed the preprocessor state and we must probably reject the PCH file.
-///
-/// \returns true if there was a mismatch (in which case the PCH file
-/// should be ignored), or false otherwise.
+/// \brief Tell the AST listener about the predefines buffers in the chain.
 bool ASTReader::CheckPredefinesBuffers() {
   if (Listener)
     return Listener->ReadPredefinesBuffer(PCHPredefinesBuffers,
@@ -792,7 +781,7 @@
 
 namespace {
 
-class PCHStatData {
+class ASTStatData {
 public:
   const bool hasStat;
   const ino_t ino;
@@ -801,19 +790,19 @@
   const time_t mtime;
   const off_t size;
 
-  PCHStatData(ino_t i, dev_t d, mode_t mo, time_t m, off_t s)
+  ASTStatData(ino_t i, dev_t d, mode_t mo, time_t m, off_t s)
   : hasStat(true), ino(i), dev(d), mode(mo), mtime(m), size(s) {}
 
-  PCHStatData()
+  ASTStatData()
     : hasStat(false), ino(0), dev(0), mode(0), mtime(0), size(0) {}
 };
 
-class PCHStatLookupTrait {
+class ASTStatLookupTrait {
  public:
   typedef const char *external_key_type;
   typedef const char *internal_key_type;
 
-  typedef PCHStatData data_type;
+  typedef ASTStatData data_type;
 
   static unsigned ComputeHash(const char *path) {
     return llvm::HashString(path);
@@ -856,13 +845,13 @@
 ///
 /// This cache is very similar to the stat cache used by pretokenized
 /// headers.
-class PCHStatCache : public StatSysCallCache {
-  typedef OnDiskChainedHashTable<PCHStatLookupTrait> CacheTy;
+class ASTStatCache : public StatSysCallCache {
+  typedef OnDiskChainedHashTable<ASTStatLookupTrait> CacheTy;
   CacheTy *Cache;
 
   unsigned &NumStatHits, &NumStatMisses;
 public:
-  PCHStatCache(const unsigned char *Buckets,
+  ASTStatCache(const unsigned char *Buckets,
                const unsigned char *Base,
                unsigned &NumStatHits,
                unsigned &NumStatMisses)
@@ -870,20 +859,20 @@
     Cache = CacheTy::Create(Buckets, Base);
   }
 
-  ~PCHStatCache() { delete Cache; }
+  ~ASTStatCache() { delete Cache; }
 
   int stat(const char *path, struct stat *buf) {
-    // Do the lookup for the file's data in the PCH file.
+    // Do the lookup for the file's data in the AST file.
     CacheTy::iterator I = Cache->find(path);
 
-    // If we don't get a hit in the PCH file just forward to 'stat'.
+    // If we don't get a hit in the AST file just forward to 'stat'.
     if (I == Cache->end()) {
       ++NumStatMisses;
       return StatSysCallCache::stat(path, buf);
     }
 
     ++NumStatHits;
-    PCHStatData Data = *I;
+    ASTStatData Data = *I;
 
     if (!Data.hasStat)
       return 1;
@@ -913,13 +902,13 @@
 
   // The stream itself is going to skip over the source manager block.
   if (F.Stream.SkipBlock()) {
-    Error("malformed block record in PCH file");
+    Error("malformed block record in AST file");
     return Failure;
   }
 
   // Enter the source manager block.
   if (SLocEntryCursor.EnterSubBlock(pch::SOURCE_MANAGER_BLOCK_ID)) {
-    Error("malformed source manager block record in PCH file");
+    Error("malformed source manager block record in AST file");
     return Failure;
   }
 
@@ -928,7 +917,7 @@
     unsigned Code = SLocEntryCursor.ReadCode();
     if (Code == llvm::bitc::END_BLOCK) {
       if (SLocEntryCursor.ReadBlockEnd()) {
-        Error("error at end of Source Manager block in PCH file");
+        Error("error at end of Source Manager block in AST file");
         return Failure;
       }
       return Success;
@@ -938,7 +927,7 @@
       // No known subblocks, always skip them.
       SLocEntryCursor.ReadSubBlockID();
       if (SLocEntryCursor.SkipBlock()) {
-        Error("malformed block record in PCH file");
+        Error("malformed block record in AST file");
         return Failure;
       }
       continue;
@@ -997,7 +986,7 @@
     return Success;
 
   if (ID > TotalNumSLocEntries) {
-    Error("source location entry ID out-of-range for PCH file");
+    Error("source location entry ID out-of-range for AST file");
     return Failure;
   }
 
@@ -1008,7 +997,7 @@
   if (Code == llvm::bitc::END_BLOCK ||
       Code == llvm::bitc::ENTER_SUBBLOCK ||
       Code == llvm::bitc::DEFINE_ABBREV) {
-    Error("incorrectly-formatted source location entry in PCH file");
+    Error("incorrectly-formatted source location entry in AST file");
     return Failure;
   }
 
@@ -1017,7 +1006,7 @@
   unsigned BlobLen;
   switch (SLocEntryCursor.ReadRecord(Code, Record, &BlobStart, &BlobLen)) {
   default:
-    Error("incorrectly-formatted source location entry in PCH file");
+    Error("incorrectly-formatted source location entry in AST file");
     return Failure;
 
   case pch::SM_SLOC_FILE_ENTRY: {
@@ -1027,7 +1016,7 @@
     if (File == 0) {
       std::string ErrorStr = "could not find file '";
       ErrorStr += Filename;
-      ErrorStr += "' referenced by PCH file";
+      ErrorStr += "' referenced by AST file";
       Error(ErrorStr.c_str());
       return Failure;
     }
@@ -1079,7 +1068,7 @@
       = SLocEntryCursor.ReadRecord(Code, Record, &BlobStart, &BlobLen);
 
     if (RecCode != pch::SM_SLOC_BUFFER_BLOB) {
-      Error("PCH record has invalid code");
+      Error("AST record has invalid code");
       return Failure;
     }
 
@@ -1121,7 +1110,7 @@
 bool ASTReader::ReadBlockAbbrevs(llvm::BitstreamCursor &Cursor,
                                  unsigned BlockID) {
   if (Cursor.EnterSubBlock(BlockID)) {
-    Error("malformed block record in PCH file");
+    Error("malformed block record in AST file");
     return Failure;
   }
 
@@ -1157,7 +1146,7 @@
       // No known subblocks, always skip them.
       Stream.ReadSubBlockID();
       if (Stream.SkipBlock()) {
-        Error("malformed block record in PCH file");
+        Error("malformed block record in AST file");
         return;
       }
       continue;
@@ -1183,7 +1172,7 @@
 
       IdentifierInfo *II = DecodeIdentifierInfo(Record[0]);
       if (II == 0) {
-        Error("macro must have a name in PCH file");
+        Error("macro must have a name in AST file");
         return;
       }
       SourceLocation Loc = SourceLocation::getFromRawEncoding(Record[1]);
@@ -1191,7 +1180,7 @@
 
       MacroInfo *MI = PP->AllocateMacroInfo(Loc);
       MI->setIsUsed(isUsed);
-      MI->setIsFromPCH();
+      MI->setIsFromAST();
 
       unsigned NextIndex = 3;
       if (RecType == pch::PP_MACRO_FUNCTION_LIKE) {
@@ -1254,7 +1243,7 @@
         return;
       
       if (!PP->getPreprocessingRecord()) {
-        Error("missing preprocessing record in PCH file");
+        Error("missing preprocessing record in AST file");
         return;
       }
         
@@ -1280,7 +1269,7 @@
         return;
       
       if (!PP->getPreprocessingRecord()) {
-        Error("missing preprocessing record in PCH file");
+        Error("missing preprocessing record in AST file");
         return;
       }
       
@@ -1317,7 +1306,7 @@
 
     llvm::BitstreamCursor Cursor = MacroCursor;
     if (Cursor.EnterSubBlock(pch::PREPROCESSOR_BLOCK_ID)) {
-      Error("malformed preprocessor block record in PCH file");
+      Error("malformed preprocessor block record in AST file");
       return;
     }
 
@@ -1326,7 +1315,7 @@
       unsigned Code = Cursor.ReadCode();
       if (Code == llvm::bitc::END_BLOCK) {
         if (Cursor.ReadBlockEnd()) {
-          Error("error at end of preprocessor block in PCH file");
+          Error("error at end of preprocessor block in AST file");
           return;
         }
         break;
@@ -1336,7 +1325,7 @@
         // No known subblocks, always skip them.
         Cursor.ReadSubBlockID();
         if (Cursor.SkipBlock()) {
-          Error("malformed block record in PCH file");
+          Error("malformed block record in AST file");
           return;
         }
         continue;
@@ -1423,18 +1412,18 @@
   llvm::BitstreamCursor &Stream = F.Stream;
 
   if (Stream.EnterSubBlock(pch::PCH_BLOCK_ID)) {
-    Error("malformed block record in PCH file");
+    Error("malformed block record in AST file");
     return Failure;
   }
 
-  // Read all of the records and blocks for the PCH file.
+  // Read all of the records and blocks for the ASt file.
   RecordData Record;
   bool First = true;
   while (!Stream.AtEndOfStream()) {
     unsigned Code = Stream.ReadCode();
     if (Code == llvm::bitc::END_BLOCK) {
       if (Stream.ReadBlockEnd()) {
-        Error("error at end of module block in PCH file");
+        Error("error at end of module block in AST file");
         return Failure;
       }
 
@@ -1452,7 +1441,7 @@
         if (Stream.SkipBlock() ||  // Skip with the main cursor.
             // Read the abbrevs.
             ReadBlockAbbrevs(F.DeclsCursor, pch::DECLTYPES_BLOCK_ID)) {
-          Error("malformed block record in PCH file");
+          Error("malformed block record in AST file");
           return Failure;
         }
         break;
@@ -1463,7 +1452,7 @@
           PP->setExternalSource(this);
 
         if (Stream.SkipBlock()) {
-          Error("malformed block record in PCH file");
+          Error("malformed block record in AST file");
           return Failure;
         }
         break;
@@ -1474,7 +1463,7 @@
           break;
 
         case Failure:
-          Error("malformed source manager block in PCH file");
+          Error("malformed source manager block in AST file");
           return Failure;
 
         case IgnorePCH:
@@ -1539,7 +1528,7 @@
 
     case pch::TYPE_OFFSET:
       if (F.LocalNumTypes != 0) {
-        Error("duplicate TYPE_OFFSET record in PCH file");
+        Error("duplicate TYPE_OFFSET record in AST file");
         return Failure;
       }
       F.TypeOffsets = (const uint32_t *)BlobStart;
@@ -1548,7 +1537,7 @@
 
     case pch::DECL_OFFSET:
       if (F.LocalNumDecls != 0) {
-        Error("duplicate DECL_OFFSET record in PCH file");
+        Error("duplicate DECL_OFFSET record in AST file");
         return Failure;
       }
       F.DeclOffsets = (const uint32_t *)BlobStart;
@@ -1586,10 +1575,10 @@
       F.IdentifierTableData = BlobStart;
       if (Record[0]) {
         F.IdentifierLookupTable
-          = PCHIdentifierLookupTable::Create(
+          = ASTIdentifierLookupTable::Create(
                        (const unsigned char *)F.IdentifierTableData + Record[0],
                        (const unsigned char *)F.IdentifierTableData,
-                       PCHIdentifierLookupTrait(*this, F.Stream));
+                       ASTIdentifierLookupTrait(*this, F.Stream));
         if (PP)
           PP->getIdentifierTable().setExternalIdentifierLookup(this);
       }
@@ -1597,7 +1586,7 @@
 
     case pch::IDENTIFIER_OFFSET:
       if (F.LocalNumIdentifiers != 0) {
-        Error("duplicate IDENTIFIER_OFFSET record in PCH file");
+        Error("duplicate IDENTIFIER_OFFSET record in AST file");
         return Failure;
       }
       F.IdentifierOffsets = (const uint32_t *)BlobStart;
@@ -1669,10 +1658,10 @@
       F.SelectorLookupTableData = (const unsigned char *)BlobStart;
       if (Record[0])
         F.SelectorLookupTable
-          = PCHSelectorLookupTable::Create(
+          = ASTSelectorLookupTable::Create(
                         F.SelectorLookupTableData + Record[0],
                         F.SelectorLookupTableData,
-                        PCHSelectorLookupTrait(*this));
+                        ASTSelectorLookupTrait(*this));
       TotalNumMethodPoolEntries += Record[1];
       break;
 
@@ -1690,8 +1679,9 @@
     case pch::SOURCE_LOCATION_OFFSETS:
       F.SLocOffsets = (const uint32_t *)BlobStart;
       F.LocalNumSLocEntries = Record[0];
-      // We cannot delay this until all PCHs are loaded, because then source
-      // location preloads would also have to be delayed.
+      // We cannot delay this until the entire chain is loaded, because then
+      // source location preloads would also have to be delayed.
+      // FIXME: Is there a reason not to do that?
       TotalNumSLocEntries += F.LocalNumSLocEntries;
       SourceMgr.PreallocateSLocEntries(this, TotalNumSLocEntries, Record[1]);
       break;
@@ -1705,8 +1695,8 @@
       break;
 
     case pch::STAT_CACHE: {
-      PCHStatCache *MyStatCache =
-        new PCHStatCache((const unsigned char *)BlobStart + Record[0],
+      ASTStatCache *MyStatCache =
+        new ASTStatCache((const unsigned char *)BlobStart + Record[0],
                          (const unsigned char *)BlobStart,
                          NumStatHits, NumStatMisses);
       FileMgr.addStatCache(MyStatCache);
@@ -1752,7 +1742,7 @@
       break;
 
     case pch::ORIGINAL_FILE_NAME:
-      // The primary PCH will be the last to get here, so it will be the one
+      // The primary AST will be the last to get here, so it will be the one
       // that's used.
       ActualOriginalFileName.assign(BlobStart, BlobLen);
       OriginalFileName = ActualOriginalFileName;
@@ -1761,9 +1751,9 @@
 
     case pch::VERSION_CONTROL_BRANCH_REVISION: {
       const std::string &CurBranch = getClangFullRepositoryVersion();
-      llvm::StringRef PCHBranch(BlobStart, BlobLen);
-      if (llvm::StringRef(CurBranch) != PCHBranch && !DisableValidation) {
-        Diag(diag::warn_pch_different_branch) << PCHBranch << CurBranch;
+      llvm::StringRef ASTBranch(BlobStart, BlobLen);
+      if (llvm::StringRef(CurBranch) != ASTBranch && !DisableValidation) {
+        Diag(diag::warn_pch_different_branch) << ASTBranch << CurBranch;
         return IgnorePCH;
       }
       break;
@@ -1777,7 +1767,7 @@
 
     case pch::DECL_REPLACEMENTS: {
       if (Record.size() % 2 != 0) {
-        Error("invalid DECL_REPLACEMENTS block in PCH file");
+        Error("invalid DECL_REPLACEMENTS block in AST file");
         return Failure;
       }
       for (unsigned I = 0, N = Record.size(); I != N; I += 2)
@@ -1788,7 +1778,7 @@
     }
     First = false;
   }
-  Error("premature end of bitstream in PCH file");
+  Error("premature end of bitstream in AST file");
   return Failure;
 }
 
@@ -1836,7 +1826,7 @@
 
   if (PP) {
     // Initialization of keywords and pragmas occurs before the
-    // PCH file is read, so there may be some identifiers that were
+    // AST file is read, so there may be some identifiers that were
     // loaded into the IdentifierTable before we intercepted the
     // creation of identifiers. Iterate through the list of known
     // identifiers and determine whether we have to establish
@@ -1854,18 +1844,18 @@
       Identifiers.push_back(Id->second);
     // We need to search the tables in all files.
     for (unsigned J = 0, M = Chain.size(); J != M; ++J) {
-      PCHIdentifierLookupTable *IdTable
-        = (PCHIdentifierLookupTable *)Chain[J]->IdentifierLookupTable;
-      // Not all PCH files necessarily have identifier tables, only the useful
+      ASTIdentifierLookupTable *IdTable
+        = (ASTIdentifierLookupTable *)Chain[J]->IdentifierLookupTable;
+      // Not all AST files necessarily have identifier tables, only the useful
       // ones.
       if (!IdTable)
         continue;
       for (unsigned I = 0, N = Identifiers.size(); I != N; ++I) {
         IdentifierInfo *II = Identifiers[I];
         // Look in the on-disk hash tables for an entry for this identifier
-        PCHIdentifierLookupTrait Info(*this, Chain[J]->Stream, II);
+        ASTIdentifierLookupTrait Info(*this, Chain[J]->Stream, II);
         std::pair<const char*,unsigned> Key(II->getNameStart(),II->getLength());
-        PCHIdentifierLookupTable::iterator Pos = IdTable->find(Key, &Info);
+        ASTIdentifierLookupTable::iterator Pos = IdTable->find(Key, &Info);
         if (Pos == IdTable->end())
           continue;
 
@@ -1886,10 +1876,10 @@
   Chain.push_back(new PerFileData());
   PerFileData &F = *Chain.back();
 
-  // Set the PCH file name.
+  // Set the AST file name.
   F.FileName = FileName;
 
-  // Open the PCH file.
+  // Open the AST file.
   //
   // FIXME: This shouldn't be here, we should just take a raw_ostream.
   std::string ErrStr;
@@ -1919,17 +1909,17 @@
     unsigned Code = Stream.ReadCode();
 
     if (Code != llvm::bitc::ENTER_SUBBLOCK) {
-      Error("invalid record at top-level of PCH file");
+      Error("invalid record at top-level of AST file");
       return Failure;
     }
 
     unsigned BlockID = Stream.ReadSubBlockID();
 
-    // We only know the PCH subblock ID.
+    // We only know the AST subblock ID.
     switch (BlockID) {
     case llvm::bitc::BLOCKINFO_BLOCK_ID:
       if (Stream.ReadBlockInfoBlock()) {
-        Error("malformed BlockInfoBlock in PCH file");
+        Error("malformed BlockInfoBlock in AST file");
         return Failure;
       }
       break;
@@ -1943,8 +1933,8 @@
 
       case IgnorePCH:
         // FIXME: We could consider reading through to the end of this
-        // PCH block, skipping subblocks, to see if there are other
-        // PCH blocks elsewhere.
+        // AST block, skipping subblocks, to see if there are other
+        // AST blocks elsewhere.
 
         // Clear out any preallocated source location entries, so that
         // the source manager does not try to resolve them later.
@@ -1952,14 +1942,14 @@
 
         // Remove the stat cache.
         if (F.StatCache)
-          FileMgr.removeStatCache((PCHStatCache*)F.StatCache);
+          FileMgr.removeStatCache((ASTStatCache*)F.StatCache);
 
         return IgnorePCH;
       }
       break;
     default:
       if (Stream.SkipBlock()) {
-        Error("malformed block record in PCH file");
+        Error("malformed block record in AST file");
         return Failure;
       }
       break;
@@ -2022,7 +2012,7 @@
     else {
       const TagType *Tag = FileType->getAs<TagType>();
       if (!Tag) {
-        Error("Invalid FILE type in PCH file");
+        Error("Invalid FILE type in AST file");
         return;
       }
       Context->setFILEDecl(Tag->getDecl());
@@ -2039,7 +2029,7 @@
     else {
       const TagType *Tag = Jmp_bufType->getAs<TagType>();
       if (!Tag) {
-        Error("Invalid jmp_bug type in PCH file");
+        Error("Invalid jmp_buf type in AST file");
         return;
       }
       Context->setjmp_bufDecl(Tag->getDecl());
@@ -2055,7 +2045,7 @@
       Context->setsigjmp_bufDecl(Typedef->getDecl());
     else {
       const TagType *Tag = Sigjmp_bufType->getAs<TagType>();
-      assert(Tag && "Invalid sigjmp_buf type in PCH file");
+      assert(Tag && "Invalid sigjmp_buf type in AST file");
       Context->setsigjmp_bufDecl(Tag->getDecl());
     }
   }
@@ -2081,14 +2071,14 @@
 }
 
 /// \brief Retrieve the name of the original source file name
-/// directly from the PCH file, without actually loading the PCH
+/// directly from the AST file, without actually loading the AST
 /// file.
-std::string ASTReader::getOriginalSourceFile(const std::string &PCHFileName,
+std::string ASTReader::getOriginalSourceFile(const std::string &ASTFileName,
                                              Diagnostic &Diags) {
-  // Open the PCH file.
+  // Open the AST file.
   std::string ErrStr;
   llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
-  Buffer.reset(llvm::MemoryBuffer::getFile(PCHFileName.c_str(), &ErrStr));
+  Buffer.reset(llvm::MemoryBuffer::getFile(ASTFileName.c_str(), &ErrStr));
   if (!Buffer) {
     Diags.Report(diag::err_fe_unable_to_read_pch_file) << ErrStr;
     return std::string();
@@ -2106,7 +2096,7 @@
       Stream.Read(8) != 'P' ||
       Stream.Read(8) != 'C' ||
       Stream.Read(8) != 'H') {
-    Diags.Report(diag::err_fe_not_a_pch_file) << PCHFileName;
+    Diags.Report(diag::err_fe_not_a_pch_file) << ASTFileName;
     return std::string();
   }
 
@@ -2117,18 +2107,18 @@
     if (Code == llvm::bitc::ENTER_SUBBLOCK) {
       unsigned BlockID = Stream.ReadSubBlockID();
 
-      // We only know the PCH subblock ID.
+      // We only know the AST subblock ID.
       switch (BlockID) {
       case pch::PCH_BLOCK_ID:
         if (Stream.EnterSubBlock(pch::PCH_BLOCK_ID)) {
-          Diags.Report(diag::err_fe_pch_malformed_block) << PCHFileName;
+          Diags.Report(diag::err_fe_pch_malformed_block) << ASTFileName;
           return std::string();
         }
         break;
 
       default:
         if (Stream.SkipBlock()) {
-          Diags.Report(diag::err_fe_pch_malformed_block) << PCHFileName;
+          Diags.Report(diag::err_fe_pch_malformed_block) << ASTFileName;
           return std::string();
         }
         break;
@@ -2138,7 +2128,7 @@
 
     if (Code == llvm::bitc::END_BLOCK) {
       if (Stream.ReadBlockEnd()) {
-        Diags.Report(diag::err_fe_pch_error_at_end_block) << PCHFileName;
+        Diags.Report(diag::err_fe_pch_error_at_end_block) << ASTFileName;
         return std::string();
       }
       continue;
@@ -2163,17 +2153,10 @@
 /// \brief Parse the record that corresponds to a LangOptions data
 /// structure.
 ///
-/// This routine compares the language options used to generate the
-/// PCH file against the language options set for the current
-/// compilation. For each option, we classify differences between the
-/// two compiler states as either "benign" or "important". Benign
-/// differences don't matter, and we accept them without complaint
-/// (and without modifying the language options). Differences between
-/// the states for important options cause the PCH file to be
-/// unusable, so we emit a warning and return true to indicate that
-/// there was an error.
+/// This routine parses the language options from the AST file and then gives
+/// them to the AST listener if one is set.
 ///
-/// \returns true if the PCH file is unacceptable, false otherwise.
+/// \returns true if the listener deems the file unacceptable, false otherwise.
 bool ASTReader::ParseLanguageOptions(
                              const llvm::SmallVectorImpl<uint64_t> &Record) {
   if (Listener) {
@@ -2380,7 +2363,7 @@
 
   case pch::TYPE_VECTOR: {
     if (Record.size() != 3) {
-      Error("incorrect encoding of vector type in PCH file");
+      Error("incorrect encoding of vector type in AST file");
       return QualType();
     }
 
@@ -2393,7 +2376,7 @@
 
   case pch::TYPE_EXT_VECTOR: {
     if (Record.size() != 3) {
-      Error("incorrect encoding of extended vector type in PCH file");
+      Error("incorrect encoding of extended vector type in AST file");
       return QualType();
     }
 
@@ -2457,7 +2440,7 @@
 
   case pch::TYPE_TYPEOF: {
     if (Record.size() != 1) {
-      Error("incorrect encoding of typeof(type) in PCH file");
+      Error("incorrect encoding of typeof(type) in AST file");
       return QualType();
     }
     QualType UnderlyingType = GetType(Record[0]);
@@ -2532,7 +2515,7 @@
     CXXRecordDecl *D = cast<CXXRecordDecl>(GetDecl(Record[0]));
     QualType TST = GetType(Record[1]); // probably derivable
     // FIXME: ASTContext::getInjectedClassNameType is not currently suitable
-    // for PCH reading, too much interdependencies.
+    // for AST reading, too much interdependencies.
     return
       QualType(new (*Context, TypeAlignment) InjectedClassNameType(D, TST), 0);
   }
@@ -2855,7 +2838,7 @@
   assert(Index < TypesLoaded.size() && "Type index out-of-range");
   if (TypesLoaded[Index].isNull()) {
     TypesLoaded[Index] = ReadTypeRecord(Index);
-    TypesLoaded[Index]->setFromPCH();
+    TypesLoaded[Index]->setFromAST();
     if (DeserializationListener)
       DeserializationListener->TypeRead(ID >> Qualifiers::FastWidth,
                                         TypesLoaded[Index]);
@@ -2922,7 +2905,7 @@
     return 0;
 
   if (ID > DeclsLoaded.size()) {
-    Error("declaration ID out-of-range for PCH file");
+    Error("declaration ID out-of-range for AST file");
     return 0;
   }
 
@@ -3062,7 +3045,7 @@
 }
 
 void ASTReader::PrintStats() {
-  std::fprintf(stderr, "*** PCH Statistics:\n");
+  std::fprintf(stderr, "*** AST File Statistics:\n");
 
   unsigned NumTypesLoaded
     = TypesLoaded.size() - std::count(TypesLoaded.begin(), TypesLoaded.end(),
@@ -3244,12 +3227,12 @@
   // Try to find this name within our on-disk hash tables. We start with the
   // most recent one, since that one contains the most up-to-date info.
   for (unsigned I = 0, N = Chain.size(); I != N; ++I) {
-    PCHIdentifierLookupTable *IdTable
-        = (PCHIdentifierLookupTable *)Chain[I]->IdentifierLookupTable;
+    ASTIdentifierLookupTable *IdTable
+        = (ASTIdentifierLookupTable *)Chain[I]->IdentifierLookupTable;
     if (!IdTable)
       continue;
     std::pair<const char*, unsigned> Key(NameStart, NameEnd - NameStart);
-    PCHIdentifierLookupTable::iterator Pos = IdTable->find(Key);
+    ASTIdentifierLookupTable::iterator Pos = IdTable->find(Key);
     if (Pos == IdTable->end())
       continue;
 
@@ -3269,16 +3252,16 @@
     if (!F.SelectorLookupTable)
       continue;
 
-    PCHSelectorLookupTable *PoolTable
-      = (PCHSelectorLookupTable*)F.SelectorLookupTable;
-    PCHSelectorLookupTable::iterator Pos = PoolTable->find(Sel);
+    ASTSelectorLookupTable *PoolTable
+      = (ASTSelectorLookupTable*)F.SelectorLookupTable;
+    ASTSelectorLookupTable::iterator Pos = PoolTable->find(Sel);
     if (Pos != PoolTable->end()) {
       ++NumSelectorsRead;
       // FIXME: Not quite happy with the statistics here. We probably should
       // disable this tracking when called via LoadSelector.
       // Also, should entries without methods count as misses?
       ++NumMethodPoolEntriesRead;
-      PCHSelectorLookupTrait::data_type Data = *Pos;
+      ASTSelectorLookupTrait::data_type Data = *Pos;
       if (DeserializationListener)
         DeserializationListener->SelectorRead(Data.ID, Sel);
       return std::make_pair(Data.Instance, Data.Factory);
@@ -3305,7 +3288,7 @@
 /// \brief Set the globally-visible declarations associated with the given
 /// identifier.
 ///
-/// If the PCH reader is currently in a state where the given declaration IDs
+/// If the AST reader is currently in a state where the given declaration IDs
 /// cannot safely be resolved, they are queued until it is safe to resolve
 /// them.
 ///
@@ -3355,7 +3338,7 @@
     return 0;
 
   if (IdentifiersLoaded.empty()) {
-    Error("no identifier table in PCH file");
+    Error("no identifier table in AST file");
     return 0;
   }
 
@@ -3375,9 +3358,8 @@
     }
     assert(Str && "Broken Chain");
 
-    // All of the strings in the PCH file are preceded by a 16-bit
-    // length. Extract that 16-bit length to avoid having to execute
-    // strlen().
+    // All of the strings in the AST file are preceded by a 16-bit length.
+    // Extract that 16-bit length to avoid having to execute strlen().
     // NOTE: 'StrLenPtr' is an 'unsigned char*' so that we load bytes as
     //  unsigned integers.  This is important to avoid integer overflow when
     //  we cast them to 'unsigned'.
@@ -3402,7 +3384,7 @@
     return Selector();
 
   if (ID > SelectorsLoaded.size()) {
-    Error("selector ID out of range in PCH file");
+    Error("selector ID out of range in AST file");
     return Selector();
   }
 
@@ -3412,7 +3394,7 @@
     for (unsigned I = 0, N = Chain.size(); I != N; ++I) {
       PerFileData &F = *Chain[N - I - 1];
       if (Idx < F.LocalNumSelectors) {
-        PCHSelectorLookupTrait Trait(*this);
+        ASTSelectorLookupTrait Trait(*this);
         SelectorsLoaded[ID - 1] =
            Trait.ReadKey(F.SelectorLookupTableData + F.SelectorOffsets[Idx], 0);
         if (DeserializationListener)
diff --git a/lib/Serialization/PCHReaderDecl.cpp b/lib/Serialization/PCHReaderDecl.cpp
index 4e2156a..677d64e 100644
--- a/lib/Serialization/PCHReaderDecl.cpp
+++ b/lib/Serialization/PCHReaderDecl.cpp
@@ -870,8 +870,8 @@
         cast_or_null<RedeclarableTemplateDecl>(Reader.GetDecl(Record[Idx++]));
   
     // This decl is a first one and the latest declaration that it points to is
-    // in the same PCH. However, if this actually needs to point to a
-    // redeclaration in another chained PCH, we need to update it by checking
+    // in the same AST file. However, if this actually needs to point to a
+    // redeclaration in another AST file, we need to update it by checking
     // the FirstLatestDeclIDs map which tracks this kind of decls.
     assert(Reader.GetDecl(ThisDeclID) == D && "Invalid ThisDeclID ?");
     ASTReader::FirstLatestDeclIDMap::iterator I
@@ -1069,8 +1069,8 @@
     return;
 
   // This decl is a first one and the latest declaration that it points to is in
-  // the same PCH. However, if this actually needs to point to a redeclaration
-  // in another chained PCH, we need to update it by checking the
+  // the same AST file. However, if this actually needs to point to a
+  // redeclaration in another AST file, we need to update it by checking the
   // FirstLatestDeclIDs map which tracks this kind of decls.
   assert(Reader.GetDecl(ThisDeclID) == static_cast<T*>(D) &&
          "Invalid ThisDeclID ?");
diff --git a/lib/Serialization/PCHReaderStmt.cpp b/lib/Serialization/PCHReaderStmt.cpp
index 6f9314e..2813954 100644
--- a/lib/Serialization/PCHReaderStmt.cpp
+++ b/lib/Serialization/PCHReaderStmt.cpp
@@ -1287,7 +1287,7 @@
     unsigned Code = Cursor.ReadCode();
     if (Code == llvm::bitc::END_BLOCK) {
       if (Cursor.ReadBlockEnd()) {
-        Error("error at end of block in PCH file");
+        Error("error at end of block in AST file");
         return 0;
       }
       break;
@@ -1297,7 +1297,7 @@
       // No known subblocks, always skip them.
       Cursor.ReadSubBlockID();
       if (Cursor.SkipBlock()) {
-        Error("malformed block record in PCH file");
+        Error("malformed block record in AST file");
         return 0;
       }
       continue;
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index a5d0f13..8134971 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1189,7 +1189,7 @@
   CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
 
   llvm::IntrusiveRefCntPtr<Diagnostic> Diags;
-  return ASTUnit::LoadFromPCHFile(ast_filename, Diags,
+  return ASTUnit::LoadFromASTFile(ast_filename, Diags,
                                   CXXIdx->getOnlyLocalDecls(),
                                   0, 0, true);
 }
@@ -1422,7 +1422,7 @@
     Diags->Report(diag::err_fe_invoking) << AllArgs << ErrMsg;
   }
 
-  ASTUnit *ATU = ASTUnit::LoadFromPCHFile(astTmpFile, Diags,
+  ASTUnit *ATU = ASTUnit::LoadFromASTFile(astTmpFile, Diags,
                                           CXXIdx->getOnlyLocalDecls(),
                                           RemappedFiles.data(),
                                           RemappedFiles.size(),
@@ -1467,7 +1467,7 @@
     // Make the translation unit responsible for destroying all temporary files.
     for (unsigned i = 0, e = TemporaryFiles.size(); i != e; ++i)
       ATU->addTemporaryFile(TemporaryFiles[i]);
-    ATU->addTemporaryFile(llvm::sys::Path(ATU->getPCHFileName()));
+    ATU->addTemporaryFile(llvm::sys::Path(ATU->getASTFileName()));
   } else {
     // Destroy all of the temporary files now; they can't be referenced any
     // longer.
