[cfe-commits] r114517 - in /cfe/trunk: include/clang/Serialization/ASTReader.h lib/Serialization/ASTReader.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Tue Sep 21 17:42:27 PDT 2010


Author: cornedbee
Date: Tue Sep 21 19:42:27 2010
New Revision: 114517

URL: http://llvm.org/viewvc/llvm-project?rev=114517&view=rev
Log:
Reshuffle PerFileData's members to make more sense.

Modified:
    cfe/trunk/include/clang/Serialization/ASTReader.h
    cfe/trunk/lib/Serialization/ASTReader.cpp

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=114517&r1=114516&r2=114517&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Tue Sep 21 19:42:27 2010
@@ -198,26 +198,7 @@
     PerFileData();
     ~PerFileData();
 
-    /// \brief The AST stat cache installed for this file, if any.
-    ///
-    /// The dynamic type of this stat cache is always ASTStatCache
-    void *StatCache;
-
-    /// \brief The bitstream reader from which we'll read the AST file.
-    llvm::BitstreamReader StreamFile;
-    llvm::BitstreamCursor Stream;
-
-    /// \brief The size of this file, in bits.
-    uint64_t SizeInBits;
-
-    /// \brief The cursor to the start of the preprocessor block, which stores
-    /// all of the macro definitions.
-    llvm::BitstreamCursor MacroCursor;
-      
-    /// DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block. It
-    /// has read all the abbreviations at the start of the block and is ready to
-    /// jump around with these in context.
-    llvm::BitstreamCursor DeclsCursor;
+    // === General information ===
 
     /// \brief The file name of the AST file.
     std::string FileName;
@@ -226,6 +207,17 @@
     /// this AST file.
     llvm::OwningPtr<llvm::MemoryBuffer> Buffer;
 
+    /// \brief The size of this file, in bits.
+    uint64_t SizeInBits;
+
+    /// \brief The bitstream reader from which we'll read the AST file.
+    llvm::BitstreamReader StreamFile;
+
+    /// \brief The main bitstream cursor for the main block.
+    llvm::BitstreamCursor Stream;
+
+    // === Source Locations ===
+
     /// \brief Cursor used to read source location entries.
     llvm::BitstreamCursor SLocEntryCursor;
 
@@ -236,19 +228,7 @@
     /// AST file.
     const uint32_t *SLocOffsets;
 
-    /// \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 AST file.
-    unsigned LocalNumDecls;
-
-    /// \brief Offset of each declaration within the bitstream, indexed
-    /// by the declaration ID (-1).
-    const uint32_t *DeclOffsets;
+    // === Identifiers ===
 
     /// \brief The number of identifiers in this AST file.
     unsigned LocalNumIdentifiers;
@@ -262,24 +242,42 @@
 
     /// \brief Actual data for the on-disk hash table.
     ///
-    // This pointer points into a memory buffer, where the on-disk hash
-    // table for identifiers actually lives.
+    /// This pointer points into a memory buffer, where the on-disk hash
+    /// table for identifiers actually lives.
     const char *IdentifierTableData;
 
     /// \brief A pointer to an on-disk hash table of opaque type
     /// IdentifierHashTable.
     void *IdentifierLookupTable;
 
+    // === Macros ===
+
     /// \brief The number of macro definitions in this file.
     unsigned LocalNumMacroDefinitions;
 
     /// \brief Offsets of all of the macro definitions in the preprocessing
     /// record in the AST file.
     const uint32_t *MacroDefinitionOffsets;
-      
-    /// \brief The number of preallocated preprocessing entities in the
-    /// preprocessing record.
-    unsigned NumPreallocatedPreprocessingEntities;
+
+    // === Selectors ===
+
+    /// \brief The cursor to the start of the preprocessor block, which stores
+    /// all of the macro definitions.
+    llvm::BitstreamCursor MacroCursor;
+
+    /// \brief The number of selectors new to this file.
+    ///
+    /// This is the number of entries in SelectorOffsets.
+    unsigned LocalNumSelectors;
+
+    /// \brief Offsets into the selector lookup table's data array
+    /// where each selector resides.
+    const uint32_t *SelectorOffsets;
+
+    /// \brief A pointer to the character data that comprises the selector table
+    ///
+    /// The SelectorOffsets table refers into this memory.
+    const unsigned char *SelectorLookupTableData;
 
     /// \brief A pointer to an on-disk hash table of opaque type
     /// ASTSelectorLookupTable.
@@ -288,19 +286,39 @@
     /// instance and factory methods.
     void *SelectorLookupTable;
 
-    /// \brief A pointer to the character data that comprises the selector table
-    ///
-    /// The SelectorOffsets table refers into this memory.
-    const unsigned char *SelectorLookupTableData;
+    // === Declarations ===
+      
+    /// DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block. It
+    /// has read all the abbreviations at the start of the block and is ready to
+    /// jump around with these in context.
+    llvm::BitstreamCursor DeclsCursor;
 
-    /// \brief Offsets into the method pool lookup table's data array
-    /// where each selector resides.
-    const uint32_t *SelectorOffsets;
+    /// \brief The number of declarations in this AST file.
+    unsigned LocalNumDecls;
 
-    /// \brief The number of selectors new to this file.
+    /// \brief Offset of each declaration within the bitstream, indexed
+    /// by the declaration ID (-1).
+    const uint32_t *DeclOffsets;
+
+    // === Types ===
+
+    /// \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;
+
+    // === Miscellaneous ===
+
+    /// \brief The AST stat cache installed for this file, if any.
     ///
-    /// This is the number of entries in SelectorOffsets.
-    unsigned LocalNumSelectors;
+    /// The dynamic type of this stat cache is always ASTStatCache
+    void *StatCache;
+      
+    /// \brief The number of preallocated preprocessing entities in the
+    /// preprocessing record.
+    unsigned NumPreallocatedPreprocessingEntities;
   };
 
   /// \brief The chain of AST files. The first entry is the one named by the

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=114517&r1=114516&r2=114517&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Sep 21 19:42:27 2010
@@ -4133,12 +4133,13 @@
 }
 
 ASTReader::PerFileData::PerFileData()
-  : StatCache(0), LocalNumSLocEntries(0), LocalNumTypes(0), TypeOffsets(0),
-    LocalNumDecls(0), DeclOffsets(0), LocalNumIdentifiers(0),
-    IdentifierOffsets(0), IdentifierTableData(0), IdentifierLookupTable(0),
-    LocalNumMacroDefinitions(0), MacroDefinitionOffsets(0),
-    NumPreallocatedPreprocessingEntities(0), SelectorLookupTable(0),
-    SelectorLookupTableData(0), SelectorOffsets(0), LocalNumSelectors(0)
+  : SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0),
+    LocalNumIdentifiers(0), IdentifierOffsets(0), IdentifierTableData(0),
+    IdentifierLookupTable(0), LocalNumMacroDefinitions(0),
+    MacroDefinitionOffsets(0), LocalNumSelectors(0), SelectorOffsets(0),
+    SelectorLookupTableData(0), SelectorLookupTable(0), LocalNumDecls(0),
+    DeclOffsets(0), LocalNumTypes(0), TypeOffsets(0), StatCache(0),
+    NumPreallocatedPreprocessingEntities(0)
 {}
 
 ASTReader::PerFileData::~PerFileData() {





More information about the cfe-commits mailing list