[cfe-commits] r111463 - in /cfe/trunk: include/clang/AST/Type.h include/clang/Serialization/PCHWriter.h lib/Frontend/ASTUnit.cpp lib/Serialization/GeneratePCH.cpp lib/Serialization/PCHWriter.cpp lib/Serialization/PCHWriterDecl.cpp lib/Serialization/PCHWriterStmt.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Wed Aug 18 16:56:21 PDT 2010


Author: cornedbee
Date: Wed Aug 18 18:56:21 2010
New Revision: 111463

URL: http://llvm.org/viewvc/llvm-project?rev=111463&view=rev
Log:
Rename PCHWriter to ASTWriter

Modified:
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/include/clang/Serialization/PCHWriter.h
    cfe/trunk/lib/Frontend/ASTUnit.cpp
    cfe/trunk/lib/Serialization/GeneratePCH.cpp
    cfe/trunk/lib/Serialization/PCHWriter.cpp
    cfe/trunk/lib/Serialization/PCHWriterDecl.cpp
    cfe/trunk/lib/Serialization/PCHWriterStmt.cpp

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Wed Aug 18 18:56:21 2010
@@ -1040,7 +1040,7 @@
   static bool classof(const Type *) { return true; }
 
   friend class PCHReader;
-  friend class PCHWriter;
+  friend class ASTWriter;
 };
 
 template <> inline const TypedefType *Type::getAs() const {

Modified: cfe/trunk/include/clang/Serialization/PCHWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/PCHWriter.h?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/PCHWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/PCHWriter.h Wed Aug 18 18:56:21 2010
@@ -1,4 +1,4 @@
-//===--- PCHWriter.h - Precompiled Headers Writer ---------------*- C++ -*-===//
+//===--- PCHWriter.h - AST File Writer --------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-//  This file defines the PCHWriter class, which writes a precompiled
+//  This file defines the ASTWriter class, which writes a precompiled
 //  header containing a serialized representation of a translation
 //  unit.
 //
@@ -69,14 +69,13 @@
   }
 };
 
-/// \brief Writes a precompiled header containing the contents of a
-/// translation unit.
+/// \brief Writes an AST file containing the contents of a translation unit.
 ///
-/// The PCHWriter class produces a bitstream containing the serialized
+/// The ASTWriter class produces a bitstream containing the serialized
 /// representation of a given abstract syntax tree and its supporting
 /// data structures. This bitstream can be de-serialized via an
 /// instance of the PCHReader class.
-class PCHWriter : public PCHDeserializationListener {
+class ASTWriter : public PCHDeserializationListener {
 public:
   typedef llvm::SmallVector<uint64_t, 64> RecordData;
 
@@ -239,7 +238,7 @@
   /// declaration or type.
   llvm::SmallVector<Stmt *, 16> StmtsToEmit;
 
-  /// \brief Statements collection to use for PCHWriter::AddStmt().
+  /// \brief Statements collection to use for ASTWriter::AddStmt().
   /// It will point to StmtsToEmit unless it is overriden. 
   llvm::SmallVector<Stmt *, 16> *CollectedStmts;
 
@@ -289,15 +288,15 @@
   void WriteDeclsBlockAbbrevs();
   void WriteDecl(ASTContext &Context, Decl *D);
 
-  void WritePCHCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+  void WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                     const char* isysroot);
-  void WritePCHChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+  void WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                      const char* isysroot);
   
 public:
   /// \brief Create a new precompiled header writer that outputs to
   /// the given bitstream.
-  PCHWriter(llvm::BitstreamWriter &Stream);
+  ASTWriter(llvm::BitstreamWriter &Stream);
 
   /// \brief Write a precompiled header for the given semantic analysis.
   ///
@@ -312,7 +311,7 @@
   ///
   /// \param PPRec Record of the preprocessing actions that occurred while
   /// preprocessing this file, e.g., macro instantiations
-  void WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+  void WriteAST(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                 const char* isysroot);
 
   /// \brief Emit a source location.
@@ -479,11 +478,11 @@
   MemorizeStatCalls *StatCalls; // owned by the FileManager
   std::vector<unsigned char> Buffer;
   llvm::BitstreamWriter Stream;
-  PCHWriter Writer;
+  ASTWriter Writer;
 
 protected:
-  PCHWriter &getWriter() { return Writer; }
-  const PCHWriter &getWriter() const { return Writer; }
+  ASTWriter &getWriter() { return Writer; }
+  const ASTWriter &getWriter() const { return Writer; }
 
 public:
   PCHGenerator(const Preprocessor &PP, bool Chaining,

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Aug 18 18:56:21 2010
@@ -1789,8 +1789,8 @@
   
   std::vector<unsigned char> Buffer;
   llvm::BitstreamWriter Stream(Buffer);
-  PCHWriter Writer(Stream);
-  Writer.WritePCH(getSema(), 0, 0);
+  ASTWriter Writer(Stream);
+  Writer.WriteAST(getSema(), 0, 0);
   
   // Write the generated bitstream to "Out".
   if (!Buffer.empty())

Modified: cfe/trunk/lib/Serialization/GeneratePCH.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GeneratePCH.cpp?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GeneratePCH.cpp (original)
+++ cfe/trunk/lib/Serialization/GeneratePCH.cpp Wed Aug 18 18:56:21 2010
@@ -8,7 +8,7 @@
 //===----------------------------------------------------------------------===//
 //
 //  This file defines the CreatePCHGenerate function, which creates an
-//  ASTConsume that generates a PCH file.
+//  ASTConsumeR that generates a PCH file.
 //
 //===----------------------------------------------------------------------===//
 
@@ -47,7 +47,7 @@
 
   // Emit the PCH file
   assert(SemaPtr && "No Sema?");
-  Writer.WritePCH(*SemaPtr, StatCalls, isysroot);
+  Writer.WriteAST(*SemaPtr, StatCalls, isysroot);
 
   // Write the generated bitstream to "Out".
   Out->write((char *)&Buffer.front(), Buffer.size());

Modified: cfe/trunk/lib/Serialization/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/PCHWriter.cpp?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/PCHWriter.cpp Wed Aug 18 18:56:21 2010
@@ -1,4 +1,4 @@
-//===--- PCHWriter.cpp - Precompiled Headers Writer -----------------------===//
+//===--- PCHWriter.cpp - AST File Writer ----------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-//  This file defines the PCHWriter class, which writes a precompiled header.
+//  This file defines the ASTWriter class, which writes AST files.
 //
 //===----------------------------------------------------------------------===//
 
@@ -55,14 +55,14 @@
 
 namespace {
   class PCHTypeWriter {
-    PCHWriter &Writer;
-    PCHWriter::RecordData &Record;
+    ASTWriter &Writer;
+    ASTWriter::RecordData &Record;
 
   public:
     /// \brief Type code that corresponds to the record generated.
     pch::TypeCode Code;
 
-    PCHTypeWriter(PCHWriter &Writer, PCHWriter::RecordData &Record)
+    PCHTypeWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
       : Writer(Writer), Record(Record), Code(pch::TYPE_EXT_QUAL) { }
 
     void VisitArrayType(const ArrayType *T);
@@ -327,11 +327,11 @@
 namespace {
 
 class TypeLocWriter : public TypeLocVisitor<TypeLocWriter> {
-  PCHWriter &Writer;
-  PCHWriter::RecordData &Record;
+  ASTWriter &Writer;
+  ASTWriter::RecordData &Record;
 
 public:
-  TypeLocWriter(PCHWriter &Writer, PCHWriter::RecordData &Record)
+  TypeLocWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
     : Writer(Writer), Record(Record) { }
 
 #define ABSTRACT_TYPELOC(CLASS, PARENT)
@@ -497,12 +497,12 @@
 }
 
 //===----------------------------------------------------------------------===//
-// PCHWriter Implementation
+// ASTWriter Implementation
 //===----------------------------------------------------------------------===//
 
 static void EmitBlockID(unsigned ID, const char *Name,
                         llvm::BitstreamWriter &Stream,
-                        PCHWriter::RecordData &Record) {
+                        ASTWriter::RecordData &Record) {
   Record.clear();
   Record.push_back(ID);
   Stream.EmitRecord(llvm::bitc::BLOCKINFO_CODE_SETBID, Record);
@@ -517,7 +517,7 @@
 
 static void EmitRecordID(unsigned ID, const char *Name,
                          llvm::BitstreamWriter &Stream,
-                         PCHWriter::RecordData &Record) {
+                         ASTWriter::RecordData &Record) {
   Record.clear();
   Record.push_back(ID);
   while (*Name)
@@ -526,7 +526,7 @@
 }
 
 static void AddStmtsExprs(llvm::BitstreamWriter &Stream,
-                          PCHWriter::RecordData &Record) {
+                          ASTWriter::RecordData &Record) {
 #define RECORD(X) EmitRecordID(pch::X, #X, Stream, Record)
   RECORD(STMT_STOP);
   RECORD(STMT_NULL_PTR);
@@ -606,7 +606,7 @@
 #undef RECORD
 }
 
-void PCHWriter::WriteBlockInfoBlock() {
+void ASTWriter::WriteBlockInfoBlock() {
   RecordData Record;
   Stream.EnterSubblock(llvm::bitc::BLOCKINFO_BLOCK_ID, 3);
 
@@ -752,7 +752,7 @@
 }
 
 /// \brief Write the PCH metadata (e.g., i686-apple-darwin9).
-void PCHWriter::WriteMetadata(ASTContext &Context, const char *isysroot) {
+void ASTWriter::WriteMetadata(ASTContext &Context, const char *isysroot) {
   using namespace llvm;
 
   // Metadata
@@ -812,7 +812,7 @@
 }
 
 /// \brief Write the LangOptions structure.
-void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
+void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
   RecordData Record;
   Record.push_back(LangOpts.Trigraphs);
   Record.push_back(LangOpts.BCPLComment);  // BCPL-style '//' comments.
@@ -942,7 +942,7 @@
 } // end anonymous namespace
 
 /// \brief Write the stat() system call cache to the PCH file.
-void PCHWriter::WriteStatCache(MemorizeStatCalls &StatCalls) {
+void ASTWriter::WriteStatCache(MemorizeStatCalls &StatCalls) {
   // Build the on-disk hash table containing information about every
   // stat() call.
   OnDiskChainedHashTableGenerator<PCHStatCacheTrait> Generator;
@@ -1053,7 +1053,7 @@
 /// entries for files that we actually need. In the common case (no
 /// errors), we probably won't have to create file entries for any of
 /// the files in the AST.
-void PCHWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
+void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
                                         const Preprocessor &PP,
                                         const char *isysroot) {
   RecordData Record;
@@ -1241,7 +1241,7 @@
 /// \brief Writes the block containing the serialized form of the
 /// preprocessor.
 ///
-void PCHWriter::WritePreprocessor(const Preprocessor &PP) {
+void ASTWriter::WritePreprocessor(const Preprocessor &PP) {
   RecordData Record;
 
   // If the preprocessor __COUNTER__ value has been bumped, remember it.
@@ -1394,7 +1394,7 @@
 //===----------------------------------------------------------------------===//
 
 /// \brief Write the representation of a type to the PCH stream.
-void PCHWriter::WriteType(QualType T) {
+void ASTWriter::WriteType(QualType T) {
   pch::TypeID &ID = TypeIDs[T];
   if (ID == 0) // we haven't seen this type before.
     ID = NextTypeID++;
@@ -1445,7 +1445,7 @@
 ///
 /// \returns the offset of the DECL_CONTEXT_LEXICAL block within the
 /// bistream, or 0 if no block was written.
-uint64_t PCHWriter::WriteDeclContextLexicalBlock(ASTContext &Context,
+uint64_t ASTWriter::WriteDeclContextLexicalBlock(ASTContext &Context,
                                                  DeclContext *DC) {
   if (DC->decls_empty())
     return 0;
@@ -1469,7 +1469,7 @@
 ///
 /// \returns the offset of the DECL_CONTEXT_VISIBLE block within the
 /// bistream, or 0 if no block was written.
-uint64_t PCHWriter::WriteDeclContextVisibleBlock(ASTContext &Context,
+uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context,
                                                  DeclContext *DC) {
   if (DC->getPrimaryContext() != DC)
     return 0;
@@ -1517,7 +1517,7 @@
   return Offset;
 }
 
-void PCHWriter::WriteTypeDeclOffsets() {
+void ASTWriter::WriteTypeDeclOffsets() {
   using namespace llvm;
   RecordData Record;
 
@@ -1555,7 +1555,7 @@
 namespace {
 // Trait used for the on-disk hash table used in the method pool.
 class PCHMethodPoolTrait {
-  PCHWriter &Writer;
+  ASTWriter &Writer;
 
 public:
   typedef Selector key_type;
@@ -1567,7 +1567,7 @@
   };
   typedef const data_type& data_type_ref;
 
-  explicit PCHMethodPoolTrait(PCHWriter &Writer) : Writer(Writer) { }
+  explicit PCHMethodPoolTrait(ASTWriter &Writer) : Writer(Writer) { }
 
   static unsigned ComputeHash(Selector Sel) {
     unsigned N = Sel.getNumArgs();
@@ -1648,7 +1648,7 @@
 /// The method pool contains both instance and factory methods, stored
 /// in an on-disk hash table indexed by the selector. The hash table also
 /// contains an empty entry for every other selector known to Sema.
-void PCHWriter::WriteSelectors(Sema &SemaRef) {
+void ASTWriter::WriteSelectors(Sema &SemaRef) {
   using namespace llvm;
 
   // Do we have to do anything at all?
@@ -1744,7 +1744,7 @@
 }
 
 /// \brief Write the selectors referenced in @selector expression into PCH file.
-void PCHWriter::WriteReferencedSelectorsPool(Sema &SemaRef) {
+void ASTWriter::WriteReferencedSelectorsPool(Sema &SemaRef) {
   using namespace llvm;
   if (SemaRef.ReferencedSelectors.empty())
     return;
@@ -1771,7 +1771,7 @@
 
 namespace {
 class PCHIdentifierTableTrait {
-  PCHWriter &Writer;
+  ASTWriter &Writer;
   Preprocessor &PP;
 
   /// \brief Determines whether this is an "interesting" identifier
@@ -1792,7 +1792,7 @@
   typedef pch::IdentID data_type;
   typedef data_type data_type_ref;
 
-  PCHIdentifierTableTrait(PCHWriter &Writer, Preprocessor &PP)
+  PCHIdentifierTableTrait(ASTWriter &Writer, Preprocessor &PP)
     : Writer(Writer), PP(PP) { }
 
   static unsigned ComputeHash(const IdentifierInfo* II) {
@@ -1875,7 +1875,7 @@
 /// The identifier table consists of a blob containing string data
 /// (the actual identifiers themselves) and a separate "offsets" index
 /// that maps identifier IDs to locations within the blob.
-void PCHWriter::WriteIdentifierTable(Preprocessor &PP) {
+void ASTWriter::WriteIdentifierTable(Preprocessor &PP) {
   using namespace llvm;
 
   // Create and write out the blob that contains the identifier
@@ -1949,7 +1949,7 @@
 //===----------------------------------------------------------------------===//
 
 /// \brief Write a record containing the given attributes.
-void PCHWriter::WriteAttributeRecord(const AttrVec &Attrs) {
+void ASTWriter::WriteAttributeRecord(const AttrVec &Attrs) {
   RecordData Record;
   for (AttrVec::const_iterator i = Attrs.begin(), e = Attrs.end(); i != e; ++i){
     const Attr * A = *i;
@@ -1964,14 +1964,14 @@
   Stream.EmitRecord(pch::DECL_ATTR, Record);
 }
 
-void PCHWriter::AddString(const std::string &Str, RecordData &Record) {
+void ASTWriter::AddString(const std::string &Str, RecordData &Record) {
   Record.push_back(Str.size());
   Record.insert(Record.end(), Str.begin(), Str.end());
 }
 
 /// \brief Note that the identifier II occurs at the given offset
 /// within the identifier table.
-void PCHWriter::SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset) {
+void ASTWriter::SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset) {
   pch::IdentID ID = IdentifierIDs[II];
   // Only store offsets new to this PCH file. Other identifier names are looked
   // up earlier in the chain and thus don't need an offset.
@@ -1981,7 +1981,7 @@
 
 /// \brief Note that the selector Sel occurs at the given offset
 /// within the method pool/selector table.
-void PCHWriter::SetSelectorOffset(Selector Sel, uint32_t Offset) {
+void ASTWriter::SetSelectorOffset(Selector Sel, uint32_t Offset) {
   unsigned ID = SelectorIDs[Sel];
   assert(ID && "Unknown selector");
   // Don't record offsets for selectors that are also available in a different
@@ -1991,7 +1991,7 @@
   SelectorOffsets[ID - FirstSelectorID] = Offset;
 }
 
-PCHWriter::PCHWriter(llvm::BitstreamWriter &Stream)
+ASTWriter::ASTWriter(llvm::BitstreamWriter &Stream)
   : Stream(Stream), Chain(0), FirstDeclID(1), NextDeclID(FirstDeclID),
     FirstTypeID(pch::NUM_PREDEF_TYPE_IDS), NextTypeID(FirstTypeID),
     FirstIdentID(1), NextIdentID(FirstIdentID), FirstSelectorID(1),
@@ -2000,7 +2000,7 @@
     NumVisibleDeclContexts(0) {
 }
 
-void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+void ASTWriter::WriteAST(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                          const char *isysroot) {
   // Emit the file header.
   Stream.Emit((unsigned)'C', 8);
@@ -2011,12 +2011,12 @@
   WriteBlockInfoBlock();
 
   if (Chain)
-    WritePCHChain(SemaRef, StatCalls, isysroot);
+    WriteASTChain(SemaRef, StatCalls, isysroot);
   else
-    WritePCHCore(SemaRef, StatCalls, isysroot);
+    WriteASTCore(SemaRef, StatCalls, isysroot);
 }
 
-void PCHWriter::WritePCHCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                              const char *isysroot) {
   using namespace llvm;
 
@@ -2221,7 +2221,7 @@
   Stream.ExitBlock();
 }
 
-void PCHWriter::WritePCHChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
+void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls,
                               const char *isysroot) {
   using namespace llvm;
 
@@ -2446,7 +2446,7 @@
   Stream.ExitBlock();
 }
 
-void PCHWriter::WriteDeclUpdateBlock() {
+void ASTWriter::WriteDeclUpdateBlock() {
   if (ReplacedDecls.empty())
     return;
 
@@ -2459,16 +2459,16 @@
   Stream.EmitRecord(pch::DECL_REPLACEMENTS, Record);
 }
 
-void PCHWriter::AddSourceLocation(SourceLocation Loc, RecordData &Record) {
+void ASTWriter::AddSourceLocation(SourceLocation Loc, RecordData &Record) {
   Record.push_back(Loc.getRawEncoding());
 }
 
-void PCHWriter::AddSourceRange(SourceRange Range, RecordData &Record) {
+void ASTWriter::AddSourceRange(SourceRange Range, RecordData &Record) {
   AddSourceLocation(Range.getBegin(), Record);
   AddSourceLocation(Range.getEnd(), Record);
 }
 
-void PCHWriter::AddAPInt(const llvm::APInt &Value, RecordData &Record) {
+void ASTWriter::AddAPInt(const llvm::APInt &Value, RecordData &Record) {
   Record.push_back(Value.getBitWidth());
   unsigned N = Value.getNumWords();
   const uint64_t* Words = Value.getRawData();
@@ -2476,20 +2476,20 @@
     Record.push_back(Words[I]);
 }
 
-void PCHWriter::AddAPSInt(const llvm::APSInt &Value, RecordData &Record) {
+void ASTWriter::AddAPSInt(const llvm::APSInt &Value, RecordData &Record) {
   Record.push_back(Value.isUnsigned());
   AddAPInt(Value, Record);
 }
 
-void PCHWriter::AddAPFloat(const llvm::APFloat &Value, RecordData &Record) {
+void ASTWriter::AddAPFloat(const llvm::APFloat &Value, RecordData &Record) {
   AddAPInt(Value.bitcastToAPInt(), Record);
 }
 
-void PCHWriter::AddIdentifierRef(const IdentifierInfo *II, RecordData &Record) {
+void ASTWriter::AddIdentifierRef(const IdentifierInfo *II, RecordData &Record) {
   Record.push_back(getIdentifierRef(II));
 }
 
-pch::IdentID PCHWriter::getIdentifierRef(const IdentifierInfo *II) {
+pch::IdentID ASTWriter::getIdentifierRef(const IdentifierInfo *II) {
   if (II == 0)
     return 0;
 
@@ -2499,7 +2499,7 @@
   return ID;
 }
 
-pch::IdentID PCHWriter::getMacroDefinitionID(MacroDefinition *MD) {
+pch::IdentID ASTWriter::getMacroDefinitionID(MacroDefinition *MD) {
   if (MD == 0)
     return 0;
   
@@ -2509,11 +2509,11 @@
   return ID;
 }
 
-void PCHWriter::AddSelectorRef(const Selector SelRef, RecordData &Record) {
+void ASTWriter::AddSelectorRef(const Selector SelRef, RecordData &Record) {
   Record.push_back(getSelectorRef(SelRef));
 }
 
-pch::SelectorID PCHWriter::getSelectorRef(Selector Sel) {
+pch::SelectorID ASTWriter::getSelectorRef(Selector Sel) {
   if (Sel.getAsOpaquePtr() == 0) {
     return 0;
   }
@@ -2530,11 +2530,11 @@
   return SID;
 }
 
-void PCHWriter::AddCXXTemporary(const CXXTemporary *Temp, RecordData &Record) {
+void ASTWriter::AddCXXTemporary(const CXXTemporary *Temp, RecordData &Record) {
   AddDeclRef(Temp->getDestructor(), Record);
 }
 
-void PCHWriter::AddTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind,
+void ASTWriter::AddTemplateArgumentLocInfo(TemplateArgument::ArgKind Kind,
                                            const TemplateArgumentLocInfo &Arg,
                                            RecordData &Record) {
   switch (Kind) {
@@ -2556,7 +2556,7 @@
   }
 }
 
-void PCHWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
+void ASTWriter::AddTemplateArgumentLoc(const TemplateArgumentLoc &Arg,
                                        RecordData &Record) {
   AddTemplateArgument(Arg.getArgument(), Record);
 
@@ -2571,7 +2571,7 @@
                              Record);
 }
 
-void PCHWriter::AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordData &Record) {
+void ASTWriter::AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordData &Record) {
   if (TInfo == 0) {
     AddTypeRef(QualType(), Record);
     return;
@@ -2583,7 +2583,7 @@
     TLW.Visit(TL);
 }
 
-void PCHWriter::AddTypeRef(QualType T, RecordData &Record) {
+void ASTWriter::AddTypeRef(QualType T, RecordData &Record) {
   if (T.isNull()) {
     Record.push_back(pch::PREDEF_TYPE_NULL_ID);
     return;
@@ -2661,11 +2661,11 @@
   Record.push_back((ID << Qualifiers::FastWidth) | FastQuals);
 }
 
-void PCHWriter::AddDeclRef(const Decl *D, RecordData &Record) {
+void ASTWriter::AddDeclRef(const Decl *D, RecordData &Record) {
   Record.push_back(GetDeclRef(D));
 }
 
-pch::DeclID PCHWriter::GetDeclRef(const Decl *D) {
+pch::DeclID ASTWriter::GetDeclRef(const Decl *D) {
   if (D == 0) {
     return 0;
   }
@@ -2687,7 +2687,7 @@
   return ID;
 }
 
-pch::DeclID PCHWriter::getDeclID(const Decl *D) {
+pch::DeclID ASTWriter::getDeclID(const Decl *D) {
   if (D == 0)
     return 0;
 
@@ -2695,7 +2695,7 @@
   return DeclIDs[D];
 }
 
-void PCHWriter::AddDeclarationName(DeclarationName Name, RecordData &Record) {
+void ASTWriter::AddDeclarationName(DeclarationName Name, RecordData &Record) {
   // FIXME: Emit a stable enum for NameKind.  0 = Identifier etc.
   Record.push_back(Name.getNameKind());
   switch (Name.getNameKind()) {
@@ -2729,7 +2729,7 @@
   }
 }
 
-void PCHWriter::AddNestedNameSpecifier(NestedNameSpecifier *NNS,
+void ASTWriter::AddNestedNameSpecifier(NestedNameSpecifier *NNS,
                                        RecordData &Record) {
   // Nested name specifiers usually aren't too long. I think that 8 would
   // typically accomodate the vast majority.
@@ -2768,7 +2768,7 @@
   }
 }
 
-void PCHWriter::AddTemplateName(TemplateName Name, RecordData &Record) {
+void ASTWriter::AddTemplateName(TemplateName Name, RecordData &Record) {
   TemplateName::NameKind Kind = Name.getKind(); 
   Record.push_back(Kind);
   switch (Kind) {
@@ -2806,7 +2806,7 @@
   }
 }
 
-void PCHWriter::AddTemplateArgument(const TemplateArgument &Arg, 
+void ASTWriter::AddTemplateArgument(const TemplateArgument &Arg, 
                                     RecordData &Record) {
   Record.push_back(Arg.getKind());
   switch (Arg.getKind()) {
@@ -2838,7 +2838,7 @@
 }
 
 void
-PCHWriter::AddTemplateParameterList(const TemplateParameterList *TemplateParams,
+ASTWriter::AddTemplateParameterList(const TemplateParameterList *TemplateParams,
                                     RecordData &Record) {
   assert(TemplateParams && "No TemplateParams!");
   AddSourceLocation(TemplateParams->getTemplateLoc(), Record);
@@ -2853,7 +2853,7 @@
 
 /// \brief Emit a template argument list.
 void
-PCHWriter::AddTemplateArgumentList(const TemplateArgumentList *TemplateArgs,
+ASTWriter::AddTemplateArgumentList(const TemplateArgumentList *TemplateArgs,
                                    RecordData &Record) {
   assert(TemplateArgs && "No TemplateArgs!");
   Record.push_back(TemplateArgs->flat_size());
@@ -2863,7 +2863,7 @@
 
 
 void
-PCHWriter::AddUnresolvedSet(const UnresolvedSetImpl &Set, RecordData &Record) {
+ASTWriter::AddUnresolvedSet(const UnresolvedSetImpl &Set, RecordData &Record) {
   Record.push_back(Set.size());
   for (UnresolvedSetImpl::const_iterator
          I = Set.begin(), E = Set.end(); I != E; ++I) {
@@ -2872,7 +2872,7 @@
   }
 }
 
-void PCHWriter::AddCXXBaseSpecifier(const CXXBaseSpecifier &Base,
+void ASTWriter::AddCXXBaseSpecifier(const CXXBaseSpecifier &Base,
                                     RecordData &Record) {
   Record.push_back(Base.isVirtual());
   Record.push_back(Base.isBaseOfClass());
@@ -2881,7 +2881,7 @@
   AddSourceRange(Base.getSourceRange(), Record);
 }
 
-void PCHWriter::AddCXXBaseOrMemberInitializers(
+void ASTWriter::AddCXXBaseOrMemberInitializers(
                         const CXXBaseOrMemberInitializer * const *BaseOrMembers,
                         unsigned NumBaseOrMembers, RecordData &Record) {
   Record.push_back(NumBaseOrMembers);
@@ -2911,7 +2911,7 @@
   }
 }
 
-void PCHWriter::SetReader(PCHReader *Reader) {
+void ASTWriter::SetReader(PCHReader *Reader) {
   assert(Reader && "Cannot remove chain");
   assert(FirstDeclID == NextDeclID &&
          FirstTypeID == NextTypeID &&
@@ -2921,18 +2921,18 @@
   Chain = Reader;
 }
 
-void PCHWriter::IdentifierRead(pch::IdentID ID, IdentifierInfo *II) {
+void ASTWriter::IdentifierRead(pch::IdentID ID, IdentifierInfo *II) {
   IdentifierIDs[II] = ID;
 }
 
-void PCHWriter::TypeRead(pch::TypeID ID, QualType T) {
+void ASTWriter::TypeRead(pch::TypeID ID, QualType T) {
   TypeIDs[T] = ID;
 }
 
-void PCHWriter::DeclRead(pch::DeclID ID, const Decl *D) {
+void ASTWriter::DeclRead(pch::DeclID ID, const Decl *D) {
   DeclIDs[D] = ID;
 }
 
-void PCHWriter::SelectorRead(pch::SelectorID ID, Selector S) {
+void ASTWriter::SelectorRead(pch::SelectorID ID, Selector S) {
   SelectorIDs[S] = ID;
 }

Modified: cfe/trunk/lib/Serialization/PCHWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/PCHWriterDecl.cpp?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/PCHWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/PCHWriterDecl.cpp Wed Aug 18 18:56:21 2010
@@ -28,16 +28,16 @@
 namespace clang {
   class PCHDeclWriter : public DeclVisitor<PCHDeclWriter, void> {
 
-    PCHWriter &Writer;
+    ASTWriter &Writer;
     ASTContext &Context;
-    PCHWriter::RecordData &Record;
+    ASTWriter::RecordData &Record;
 
   public:
     pch::DeclCode Code;
     unsigned AbbrevToUse;
 
-    PCHDeclWriter(PCHWriter &Writer, ASTContext &Context,
-                  PCHWriter::RecordData &Record)
+    PCHDeclWriter(ASTWriter &Writer, ASTContext &Context,
+                  ASTWriter::RecordData &Record)
       : Writer(Writer), Context(Context), Record(Record) {
     }
     
@@ -1038,10 +1038,10 @@
 }
 
 //===----------------------------------------------------------------------===//
-// PCHWriter Implementation
+// ASTWriter Implementation
 //===----------------------------------------------------------------------===//
 
-void PCHWriter::WriteDeclsBlockAbbrevs() {
+void ASTWriter::WriteDeclsBlockAbbrevs() {
   using namespace llvm;
   // Abbreviation for DECL_PARM_VAR.
   BitCodeAbbrev *Abv = new BitCodeAbbrev();
@@ -1108,7 +1108,7 @@
   return Context.DeclMustBeEmitted(D);
 }
 
-void PCHWriter::WriteDecl(ASTContext &Context, Decl *D) {
+void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) {
   RecordData Record;
   PCHDeclWriter W(*this, Context, Record);
 

Modified: cfe/trunk/lib/Serialization/PCHWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/PCHWriterStmt.cpp?rev=111463&r1=111462&r2=111463&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/PCHWriterStmt.cpp (original)
+++ cfe/trunk/lib/Serialization/PCHWriterStmt.cpp Wed Aug 18 18:56:21 2010
@@ -24,13 +24,13 @@
 
 namespace clang {
   class PCHStmtWriter : public StmtVisitor<PCHStmtWriter, void> {
-    PCHWriter &Writer;
-    PCHWriter::RecordData &Record;
+    ASTWriter &Writer;
+    ASTWriter::RecordData &Record;
 
   public:
     pch::StmtCode Code;
 
-    PCHStmtWriter(PCHWriter &Writer, PCHWriter::RecordData &Record)
+    PCHStmtWriter(ASTWriter &Writer, ASTWriter::RecordData &Record)
       : Writer(Writer), Record(Record) { }
     
     void
@@ -1279,10 +1279,10 @@
 }
 
 //===----------------------------------------------------------------------===//
-// PCHWriter Implementation
+// ASTWriter Implementation
 //===----------------------------------------------------------------------===//
 
-unsigned PCHWriter::RecordSwitchCaseID(SwitchCase *S) {
+unsigned ASTWriter::RecordSwitchCaseID(SwitchCase *S) {
   assert(SwitchCaseIDs.find(S) == SwitchCaseIDs.end() &&
          "SwitchCase recorded twice");
   unsigned NextID = SwitchCaseIDs.size();
@@ -1290,7 +1290,7 @@
   return NextID;
 }
 
-unsigned PCHWriter::getSwitchCaseID(SwitchCase *S) {
+unsigned ASTWriter::getSwitchCaseID(SwitchCase *S) {
   assert(SwitchCaseIDs.find(S) != SwitchCaseIDs.end() &&
          "SwitchCase hasn't been seen yet");
   return SwitchCaseIDs[S];
@@ -1298,7 +1298,7 @@
 
 /// \brief Retrieve the ID for the given label statement, which may
 /// or may not have been emitted yet.
-unsigned PCHWriter::GetLabelID(LabelStmt *S) {
+unsigned ASTWriter::GetLabelID(LabelStmt *S) {
   std::map<LabelStmt *, unsigned>::iterator Pos = LabelIDs.find(S);
   if (Pos != LabelIDs.end())
     return Pos->second;
@@ -1310,7 +1310,7 @@
 
 /// \brief Write the given substatement or subexpression to the
 /// bitstream.
-void PCHWriter::WriteSubStmt(Stmt *S) {
+void ASTWriter::WriteSubStmt(Stmt *S) {
   RecordData Record;
   PCHStmtWriter Writer(*this, Record);
   ++NumStatements;
@@ -1320,7 +1320,7 @@
     return;
   }
 
-  // Redirect PCHWriter::AddStmt to collect sub stmts.
+  // Redirect ASTWriter::AddStmt to collect sub stmts.
   llvm::SmallVector<Stmt *, 16> SubStmts;
   CollectedStmts = &SubStmts;
 
@@ -1336,7 +1336,7 @@
   }
 #endif
 
-  // Revert PCHWriter::AddStmt.
+  // Revert ASTWriter::AddStmt.
   CollectedStmts = &StmtsToEmit;
 
   // Write the sub stmts in reverse order, last to first. When reading them back
@@ -1351,7 +1351,7 @@
 
 /// \brief Flush all of the statements that have been added to the
 /// queue via AddStmt().
-void PCHWriter::FlushStmts() {
+void ASTWriter::FlushStmts() {
   RecordData Record;
 
   for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) {





More information about the cfe-commits mailing list