From ec216500f23f757d8007e6f071250c0a7ba38101 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 13 Feb 2015 19:48:37 +0000 Subject: [PATCH] [modules] Improve llvm-bcanalyzer output on AST files a little. No functionality change. llvm-svn: 229145 --- clang/include/clang/Serialization/ASTBitCodes.h | 4 ++-- clang/include/clang/Serialization/Module.h | 2 +- clang/lib/Serialization/ASTReader.cpp | 4 ++-- clang/lib/Serialization/ASTWriter.cpp | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/clang/include/clang/Serialization/ASTBitCodes.h b/clang/include/clang/Serialization/ASTBitCodes.h index 3874f3a..ef5f1dd 100644 --- a/clang/include/clang/Serialization/ASTBitCodes.h +++ b/clang/include/clang/Serialization/ASTBitCodes.h @@ -1094,13 +1094,13 @@ namespace clang { /// /// These constants describe the records that describe statements /// or expressions. These records occur within type and declarations - /// block, so they begin with record values of 100. Each constant + /// block, so they begin with record values of 128. Each constant /// describes a record for a specific statement or expression class in the /// AST. enum StmtCode { /// \brief A marker record that indicates that we are at the end /// of an expression. - STMT_STOP = 100, + STMT_STOP = 128, /// \brief A NULL expression. STMT_NULL_PTR, /// \brief A reference to a previously [de]serialized Stmt record. diff --git a/clang/include/clang/Serialization/Module.h b/clang/include/clang/Serialization/Module.h index 426cec5..3eec83c 100644 --- a/clang/include/clang/Serialization/Module.h +++ b/clang/include/clang/Serialization/Module.h @@ -206,7 +206,7 @@ public: llvm::BitstreamCursor InputFilesCursor; /// \brief Offsets for all of the input file entries in the AST file. - const uint32_t *InputFileOffsets; + const uint64_t *InputFileOffsets; /// \brief The input files that have been loaded from this AST file. std::vector InputFilesLoaded; diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index fe5c71f..610cd7e 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2543,7 +2543,7 @@ ASTReader::ReadControlBlock(ModuleFile &F, case INPUT_FILE_OFFSETS: NumInputs = Record[0]; NumUserInputs = Record[1]; - F.InputFileOffsets = (const uint32_t *)Blob.data(); + F.InputFileOffsets = (const uint64_t *)Blob.data(); F.InputFilesLoaded.resize(NumInputs); break; } @@ -4350,7 +4350,7 @@ bool ASTReader::readASTFileControlBlock(StringRef Filename, unsigned NumInputFiles = Record[0]; unsigned NumUserFiles = Record[1]; - const uint32_t *InputFileOffs = (const uint32_t *)Blob.data(); + const uint64_t *InputFileOffs = (const uint64_t *)Blob.data(); for (unsigned I = 0; I != NumInputFiles; ++I) { // Go find this input file. bool isSystemFile = I >= NumUserFiles; diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 2526c63..5745350 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -941,10 +941,11 @@ void ASTWriter::WriteBlockInfoBlock() { // Preprocessor Block. BLOCK(PREPROCESSOR_BLOCK); + RECORD(PP_MACRO_DIRECTIVE_HISTORY); RECORD(PP_MACRO_OBJECT_LIKE); RECORD(PP_MACRO_FUNCTION_LIKE); RECORD(PP_TOKEN); - + // Decls and Types block. BLOCK(DECLTYPES_BLOCK); RECORD(TYPE_EXT_QUAL); @@ -1469,7 +1470,7 @@ void ASTWriter::WriteInputFiles(SourceManager &SourceMgr, unsigned UserFilesNum = 0; // Write out all of the input files. - std::vector InputFileOffsets; + std::vector InputFileOffsets; for (std::deque::iterator I = SortedFiles.begin(), E = SortedFiles.end(); I != E; ++I) { const InputFileEntry &Entry = *I; -- 2.7.4