Reshuffle PerFileData's members to make more sense.

llvm-svn: 114517
This commit is contained in:
Sebastian Redl 2010-09-22 00:42:27 +00:00
parent 4f432e719b
commit 949fe9e03b
2 changed files with 74 additions and 55 deletions

View File

@ -198,26 +198,7 @@ private:
PerFileData(); PerFileData();
~PerFileData(); ~PerFileData();
/// \brief The AST stat cache installed for this file, if any. // === General information ===
///
/// 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;
/// \brief The file name of the AST file. /// \brief The file name of the AST file.
std::string FileName; std::string FileName;
@ -226,6 +207,17 @@ private:
/// this AST file. /// this AST file.
llvm::OwningPtr<llvm::MemoryBuffer> Buffer; 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. /// \brief Cursor used to read source location entries.
llvm::BitstreamCursor SLocEntryCursor; llvm::BitstreamCursor SLocEntryCursor;
@ -236,19 +228,7 @@ private:
/// AST file. /// AST file.
const uint32_t *SLocOffsets; const uint32_t *SLocOffsets;
/// \brief The number of types in this AST file. // === Identifiers ===
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;
/// \brief The number of identifiers in this AST file. /// \brief The number of identifiers in this AST file.
unsigned LocalNumIdentifiers; unsigned LocalNumIdentifiers;
@ -262,24 +242,42 @@ private:
/// \brief Actual data for the on-disk hash table. /// \brief Actual data for the on-disk hash table.
/// ///
// This pointer points into a memory buffer, where the on-disk hash /// This pointer points into a memory buffer, where the on-disk hash
// table for identifiers actually lives. /// table for identifiers actually lives.
const char *IdentifierTableData; const char *IdentifierTableData;
/// \brief A pointer to an on-disk hash table of opaque type /// \brief A pointer to an on-disk hash table of opaque type
/// IdentifierHashTable. /// IdentifierHashTable.
void *IdentifierLookupTable; void *IdentifierLookupTable;
// === Macros ===
/// \brief The number of macro definitions in this file. /// \brief The number of macro definitions in this file.
unsigned LocalNumMacroDefinitions; unsigned LocalNumMacroDefinitions;
/// \brief Offsets of all of the macro definitions in the preprocessing /// \brief Offsets of all of the macro definitions in the preprocessing
/// record in the AST file. /// record in the AST file.
const uint32_t *MacroDefinitionOffsets; const uint32_t *MacroDefinitionOffsets;
/// \brief The number of preallocated preprocessing entities in the // === Selectors ===
/// preprocessing record.
unsigned NumPreallocatedPreprocessingEntities; /// \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 /// \brief A pointer to an on-disk hash table of opaque type
/// ASTSelectorLookupTable. /// ASTSelectorLookupTable.
@ -288,19 +286,39 @@ private:
/// instance and factory methods. /// instance and factory methods.
void *SelectorLookupTable; void *SelectorLookupTable;
/// \brief A pointer to the character data that comprises the selector table // === Declarations ===
///
/// The SelectorOffsets table refers into this memory. /// DeclsCursor - This is a cursor to the start of the DECLS_BLOCK block. It
const unsigned char *SelectorLookupTableData; /// 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 /// \brief The number of declarations in this AST file.
/// where each selector resides. unsigned LocalNumDecls;
const uint32_t *SelectorOffsets;
/// \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. /// The dynamic type of this stat cache is always ASTStatCache
unsigned LocalNumSelectors; 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 /// \brief The chain of AST files. The first entry is the one named by the

View File

@ -4133,12 +4133,13 @@ ASTReader::~ASTReader() {
} }
ASTReader::PerFileData::PerFileData() ASTReader::PerFileData::PerFileData()
: StatCache(0), LocalNumSLocEntries(0), LocalNumTypes(0), TypeOffsets(0), : SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0),
LocalNumDecls(0), DeclOffsets(0), LocalNumIdentifiers(0), LocalNumIdentifiers(0), IdentifierOffsets(0), IdentifierTableData(0),
IdentifierOffsets(0), IdentifierTableData(0), IdentifierLookupTable(0), IdentifierLookupTable(0), LocalNumMacroDefinitions(0),
LocalNumMacroDefinitions(0), MacroDefinitionOffsets(0), MacroDefinitionOffsets(0), LocalNumSelectors(0), SelectorOffsets(0),
NumPreallocatedPreprocessingEntities(0), SelectorLookupTable(0), SelectorLookupTableData(0), SelectorLookupTable(0), LocalNumDecls(0),
SelectorLookupTableData(0), SelectorOffsets(0), LocalNumSelectors(0) DeclOffsets(0), LocalNumTypes(0), TypeOffsets(0), StatCache(0),
NumPreallocatedPreprocessingEntities(0)
{} {}
ASTReader::PerFileData::~PerFileData() { ASTReader::PerFileData::~PerFileData() {