Index: llvm/trunk/include/llvm/Bitcode/BitCodes.h =================================================================== --- llvm/trunk/include/llvm/Bitcode/BitCodes.h +++ llvm/trunk/include/llvm/Bitcode/BitCodes.h @@ -25,6 +25,14 @@ #include namespace llvm { +/// Offsets of the 32-bit fields of bitcode wrapper header. +static const unsigned BWH_MagicField = 0 * 4; +static const unsigned BWH_VersionField = 1 * 4; +static const unsigned BWH_OffsetField = 2 * 4; +static const unsigned BWH_SizeField = 3 * 4; +static const unsigned BWH_CPUTypeField = 4 * 4; +static const unsigned BWH_HeaderSize = 5 * 4; + namespace bitc { enum StandardWidths { BlockIDWidth = 8, // We use VBR-8 for block IDs. Index: llvm/trunk/include/llvm/Bitcode/BitcodeReader.h =================================================================== --- llvm/trunk/include/llvm/Bitcode/BitcodeReader.h +++ llvm/trunk/include/llvm/Bitcode/BitcodeReader.h @@ -0,0 +1,159 @@ +//===-- llvm/Bitcode/BitcodeReader.h - Bitcode reader ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This header defines interfaces to read LLVM bitcode files/streams. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_BITCODE_BITCODEREADER_H +#define LLVM_BITCODE_BITCODEREADER_H + +#include "llvm/Bitcode/BitCodes.h" +#include "llvm/IR/DiagnosticInfo.h" +#include "llvm/IR/ModuleSummaryIndex.h" +#include "llvm/Support/Endian.h" +#include "llvm/Support/ErrorOr.h" +#include "llvm/Support/MemoryBuffer.h" +#include + +namespace llvm { + class LLVMContext; + class Module; + + /// Read the header of the specified bitcode buffer and prepare for lazy + /// deserialization of function bodies. If ShouldLazyLoadMetadata is true, + /// lazily load metadata as well. + ErrorOr> + getLazyBitcodeModule(MemoryBufferRef Buffer, LLVMContext &Context, + bool ShouldLazyLoadMetadata = false); + + /// Like getLazyBitcodeModule, except that the module takes ownership of + /// the memory buffer if successful. If successful, this moves Buffer. On + /// error, this *does not* move Buffer. + ErrorOr> + getOwningLazyBitcodeModule(std::unique_ptr &&Buffer, + LLVMContext &Context, + bool ShouldLazyLoadMetadata = false); + + /// Read the header of the specified bitcode buffer and extract just the + /// triple information. If successful, this returns a string. On error, this + /// returns "". + std::string getBitcodeTargetTriple(MemoryBufferRef Buffer, + LLVMContext &Context); + + /// Return true if \p Buffer contains a bitcode file with ObjC code (category + /// or class) in it. + bool isBitcodeContainingObjCCategory(MemoryBufferRef Buffer, + LLVMContext &Context); + + /// Read the header of the specified bitcode buffer and extract just the + /// producer string information. If successful, this returns a string. On + /// error, this returns "". + std::string getBitcodeProducerString(MemoryBufferRef Buffer, + LLVMContext &Context); + + /// Read the specified bitcode file, returning the module. + ErrorOr> parseBitcodeFile(MemoryBufferRef Buffer, + LLVMContext &Context); + + /// Check if the given bitcode buffer contains a summary block. + bool + hasGlobalValueSummary(MemoryBufferRef Buffer, + const DiagnosticHandlerFunction &DiagnosticHandler); + + /// Parse the specified bitcode buffer, returning the module summary index. + ErrorOr> + getModuleSummaryIndex(MemoryBufferRef Buffer, + const DiagnosticHandlerFunction &DiagnosticHandler); + + /// isBitcodeWrapper - Return true if the given bytes are the magic bytes + /// for an LLVM IR bitcode wrapper. + /// + inline bool isBitcodeWrapper(const unsigned char *BufPtr, + const unsigned char *BufEnd) { + // See if you can find the hidden message in the magic bytes :-). + // (Hint: it's a little-endian encoding.) + return BufPtr != BufEnd && + BufPtr[0] == 0xDE && + BufPtr[1] == 0xC0 && + BufPtr[2] == 0x17 && + BufPtr[3] == 0x0B; + } + + /// isRawBitcode - Return true if the given bytes are the magic bytes for + /// raw LLVM IR bitcode (without a wrapper). + /// + inline bool isRawBitcode(const unsigned char *BufPtr, + const unsigned char *BufEnd) { + // These bytes sort of have a hidden message, but it's not in + // little-endian this time, and it's a little redundant. + return BufPtr != BufEnd && + BufPtr[0] == 'B' && + BufPtr[1] == 'C' && + BufPtr[2] == 0xc0 && + BufPtr[3] == 0xde; + } + + /// isBitcode - Return true if the given bytes are the magic bytes for + /// LLVM IR bitcode, either with or without a wrapper. + /// + inline bool isBitcode(const unsigned char *BufPtr, + const unsigned char *BufEnd) { + return isBitcodeWrapper(BufPtr, BufEnd) || + isRawBitcode(BufPtr, BufEnd); + } + + /// SkipBitcodeWrapperHeader - Some systems wrap bc files with a special + /// header for padding or other reasons. The format of this header is: + /// + /// struct bc_header { + /// uint32_t Magic; // 0x0B17C0DE + /// uint32_t Version; // Version, currently always 0. + /// uint32_t BitcodeOffset; // Offset to traditional bitcode file. + /// uint32_t BitcodeSize; // Size of traditional bitcode file. + /// ... potentially other gunk ... + /// }; + /// + /// This function is called when we find a file with a matching magic number. + /// In this case, skip down to the subsection of the file that is actually a + /// BC file. + /// If 'VerifyBufferSize' is true, check that the buffer is large enough to + /// contain the whole bitcode file. + inline bool SkipBitcodeWrapperHeader(const unsigned char *&BufPtr, + const unsigned char *&BufEnd, + bool VerifyBufferSize) { + // Must contain the offset and size field! + if (unsigned(BufEnd - BufPtr) < BWH_SizeField + 4) + return true; + + unsigned Offset = support::endian::read32le(&BufPtr[BWH_OffsetField]); + unsigned Size = support::endian::read32le(&BufPtr[BWH_SizeField]); + uint64_t BitcodeOffsetEnd = (uint64_t)Offset + (uint64_t)Size; + + // Verify that Offset+Size fits in the file. + if (VerifyBufferSize && BitcodeOffsetEnd > uint64_t(BufEnd-BufPtr)) + return true; + BufPtr += Offset; + BufEnd = BufPtr+Size; + return false; + } + + const std::error_category &BitcodeErrorCategory(); + enum class BitcodeError { CorruptedBitcode = 1 }; + inline std::error_code make_error_code(BitcodeError E) { + return std::error_code(static_cast(E), BitcodeErrorCategory()); + } + +} // End llvm namespace + +namespace std { +template <> struct is_error_code_enum : std::true_type {}; +} + +#endif Index: llvm/trunk/include/llvm/Bitcode/ReaderWriter.h =================================================================== --- llvm/trunk/include/llvm/Bitcode/ReaderWriter.h +++ llvm/trunk/include/llvm/Bitcode/ReaderWriter.h @@ -1,198 +0,0 @@ -//===-- llvm/Bitcode/ReaderWriter.h - Bitcode reader/writers ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This header defines interfaces to read and write LLVM bitcode files/streams. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_BITCODE_READERWRITER_H -#define LLVM_BITCODE_READERWRITER_H - -#include "llvm/IR/DiagnosticInfo.h" -#include "llvm/IR/ModuleSummaryIndex.h" -#include "llvm/Support/Endian.h" -#include "llvm/Support/ErrorOr.h" -#include "llvm/Support/MemoryBuffer.h" -#include -#include - -namespace llvm { - class BitstreamWriter; - class LLVMContext; - class Module; - class ModulePass; - class raw_ostream; - - /// Offsets of the 32-bit fields of bitcode wrapper header. - static const unsigned BWH_MagicField = 0*4; - static const unsigned BWH_VersionField = 1*4; - static const unsigned BWH_OffsetField = 2*4; - static const unsigned BWH_SizeField = 3*4; - static const unsigned BWH_CPUTypeField = 4*4; - static const unsigned BWH_HeaderSize = 5*4; - - /// Read the header of the specified bitcode buffer and prepare for lazy - /// deserialization of function bodies. If ShouldLazyLoadMetadata is true, - /// lazily load metadata as well. - ErrorOr> - getLazyBitcodeModule(MemoryBufferRef Buffer, LLVMContext &Context, - bool ShouldLazyLoadMetadata = false); - - /// Like getLazyBitcodeModule, except that the module takes ownership of - /// the memory buffer if successful. If successful, this moves Buffer. On - /// error, this *does not* move Buffer. - ErrorOr> - getOwningLazyBitcodeModule(std::unique_ptr &&Buffer, - LLVMContext &Context, - bool ShouldLazyLoadMetadata = false); - - /// Read the header of the specified bitcode buffer and extract just the - /// triple information. If successful, this returns a string. On error, this - /// returns "". - std::string getBitcodeTargetTriple(MemoryBufferRef Buffer, - LLVMContext &Context); - - /// Return true if \p Buffer contains a bitcode file with ObjC code (category - /// or class) in it. - bool isBitcodeContainingObjCCategory(MemoryBufferRef Buffer, - LLVMContext &Context); - - /// Read the header of the specified bitcode buffer and extract just the - /// producer string information. If successful, this returns a string. On - /// error, this returns "". - std::string getBitcodeProducerString(MemoryBufferRef Buffer, - LLVMContext &Context); - - /// Read the specified bitcode file, returning the module. - ErrorOr> parseBitcodeFile(MemoryBufferRef Buffer, - LLVMContext &Context); - - /// Check if the given bitcode buffer contains a summary block. - bool - hasGlobalValueSummary(MemoryBufferRef Buffer, - const DiagnosticHandlerFunction &DiagnosticHandler); - - /// Parse the specified bitcode buffer, returning the module summary index. - ErrorOr> - getModuleSummaryIndex(MemoryBufferRef Buffer, - const DiagnosticHandlerFunction &DiagnosticHandler); - - /// \brief Write the specified module to the specified raw output stream. - /// - /// For streams where it matters, the given stream should be in "binary" - /// mode. - /// - /// If \c ShouldPreserveUseListOrder, encode the use-list order for each \a - /// Value in \c M. These will be reconstructed exactly when \a M is - /// deserialized. - /// - /// If \c Index is supplied, the bitcode will contain the summary index - /// (currently for use in ThinLTO optimization). - /// - /// \p GenerateHash enables hashing the Module and including the hash in the - /// bitcode (currently for use in ThinLTO incremental build). - void WriteBitcodeToFile(const Module *M, raw_ostream &Out, - bool ShouldPreserveUseListOrder = false, - const ModuleSummaryIndex *Index = nullptr, - bool GenerateHash = false); - - /// Write the specified module summary index to the given raw output stream, - /// where it will be written in a new bitcode block. This is used when - /// writing the combined index file for ThinLTO. When writing a subset of the - /// index for a distributed backend, provide the \p ModuleToSummariesForIndex - /// map. - void WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out, - const std::map - *ModuleToSummariesForIndex = nullptr); - - /// isBitcodeWrapper - Return true if the given bytes are the magic bytes - /// for an LLVM IR bitcode wrapper. - /// - inline bool isBitcodeWrapper(const unsigned char *BufPtr, - const unsigned char *BufEnd) { - // See if you can find the hidden message in the magic bytes :-). - // (Hint: it's a little-endian encoding.) - return BufPtr != BufEnd && - BufPtr[0] == 0xDE && - BufPtr[1] == 0xC0 && - BufPtr[2] == 0x17 && - BufPtr[3] == 0x0B; - } - - /// isRawBitcode - Return true if the given bytes are the magic bytes for - /// raw LLVM IR bitcode (without a wrapper). - /// - inline bool isRawBitcode(const unsigned char *BufPtr, - const unsigned char *BufEnd) { - // These bytes sort of have a hidden message, but it's not in - // little-endian this time, and it's a little redundant. - return BufPtr != BufEnd && - BufPtr[0] == 'B' && - BufPtr[1] == 'C' && - BufPtr[2] == 0xc0 && - BufPtr[3] == 0xde; - } - - /// isBitcode - Return true if the given bytes are the magic bytes for - /// LLVM IR bitcode, either with or without a wrapper. - /// - inline bool isBitcode(const unsigned char *BufPtr, - const unsigned char *BufEnd) { - return isBitcodeWrapper(BufPtr, BufEnd) || - isRawBitcode(BufPtr, BufEnd); - } - - /// SkipBitcodeWrapperHeader - Some systems wrap bc files with a special - /// header for padding or other reasons. The format of this header is: - /// - /// struct bc_header { - /// uint32_t Magic; // 0x0B17C0DE - /// uint32_t Version; // Version, currently always 0. - /// uint32_t BitcodeOffset; // Offset to traditional bitcode file. - /// uint32_t BitcodeSize; // Size of traditional bitcode file. - /// ... potentially other gunk ... - /// }; - /// - /// This function is called when we find a file with a matching magic number. - /// In this case, skip down to the subsection of the file that is actually a - /// BC file. - /// If 'VerifyBufferSize' is true, check that the buffer is large enough to - /// contain the whole bitcode file. - inline bool SkipBitcodeWrapperHeader(const unsigned char *&BufPtr, - const unsigned char *&BufEnd, - bool VerifyBufferSize) { - // Must contain the offset and size field! - if (unsigned(BufEnd - BufPtr) < BWH_SizeField + 4) - return true; - - unsigned Offset = support::endian::read32le(&BufPtr[BWH_OffsetField]); - unsigned Size = support::endian::read32le(&BufPtr[BWH_SizeField]); - uint64_t BitcodeOffsetEnd = (uint64_t)Offset + (uint64_t)Size; - - // Verify that Offset+Size fits in the file. - if (VerifyBufferSize && BitcodeOffsetEnd > uint64_t(BufEnd-BufPtr)) - return true; - BufPtr += Offset; - BufEnd = BufPtr+Size; - return false; - } - - const std::error_category &BitcodeErrorCategory(); - enum class BitcodeError { CorruptedBitcode = 1 }; - inline std::error_code make_error_code(BitcodeError E) { - return std::error_code(static_cast(E), BitcodeErrorCategory()); - } - -} // End llvm namespace - -namespace std { -template <> struct is_error_code_enum : std::true_type {}; -} - -#endif Index: llvm/trunk/lib/Bitcode/Reader/BitReader.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitReader.cpp +++ llvm/trunk/lib/Bitcode/Reader/BitReader.cpp @@ -9,7 +9,7 @@ #include "llvm-c/BitReader.h" #include "llvm-c/Core.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/DiagnosticPrinter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" Index: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/ArrayRef.h" @@ -20,7 +21,6 @@ #include "llvm/ADT/Twine.h" #include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Bitcode/LLVMBitCodes.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/AutoUpgrade.h" Index: llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp +++ llvm/trunk/lib/Bitcode/Writer/BitWriter.cpp @@ -8,9 +8,10 @@ //===----------------------------------------------------------------------===// #include "llvm-c/BitWriter.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/Module.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; Index: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -11,12 +11,12 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Bitcode/BitcodeWriter.h" #include "ValueEnumerator.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Triple.h" #include "llvm/Bitcode/BitstreamWriter.h" #include "llvm/Bitcode/LLVMBitCodes.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DebugInfoMetadata.h" Index: llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp =================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriterPass.cpp @@ -13,7 +13,7 @@ #include "llvm/Bitcode/BitcodeWriterPass.h" #include "llvm/Analysis/ModuleSummaryAnalysis.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/Module.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" Index: llvm/trunk/lib/CodeGen/ParallelCG.cpp =================================================================== --- llvm/trunk/lib/CodeGen/ParallelCG.cpp +++ llvm/trunk/lib/CodeGen/ParallelCG.cpp @@ -12,7 +12,8 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/ParallelCG.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" Index: llvm/trunk/lib/IR/Core.cpp =================================================================== --- llvm/trunk/lib/IR/Core.cpp +++ llvm/trunk/lib/IR/Core.cpp @@ -14,7 +14,7 @@ #include "llvm-c/Core.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/Attributes.h" #include "AttributeSetNode.h" #include "llvm/IR/CallSite.h" Index: llvm/trunk/lib/IRReader/IRReader.cpp =================================================================== --- llvm/trunk/lib/IRReader/IRReader.cpp +++ llvm/trunk/lib/IRReader/IRReader.cpp @@ -11,7 +11,7 @@ #include "llvm-c/Core.h" #include "llvm-c/IRReader.h" #include "llvm/AsmParser/Parser.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/Support/MemoryBuffer.h" Index: llvm/trunk/lib/LTO/LTO.cpp =================================================================== --- llvm/trunk/lib/LTO/LTO.cpp +++ llvm/trunk/lib/LTO/LTO.cpp @@ -14,7 +14,8 @@ #include "llvm/LTO/LTO.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/CodeGen/Analysis.h" #include "llvm/IR/AutoUpgrade.h" #include "llvm/IR/DiagnosticPrinter.h" Index: llvm/trunk/lib/LTO/LTOBackend.cpp =================================================================== --- llvm/trunk/lib/LTO/LTOBackend.cpp +++ llvm/trunk/lib/LTO/LTOBackend.cpp @@ -20,7 +20,8 @@ #include "llvm/Analysis/LoopPassManager.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/PassManager.h" #include "llvm/IR/Verifier.h" Index: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp =================================================================== --- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp +++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp @@ -19,7 +19,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/CodeGen/ParallelCG.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/Config/config.h" Index: llvm/trunk/lib/LTO/LTOModule.cpp =================================================================== --- llvm/trunk/lib/LTO/LTOModule.cpp +++ llvm/trunk/lib/LTO/LTOModule.cpp @@ -14,7 +14,7 @@ #include "llvm/LTO/legacy/LTOModule.h" #include "llvm/ADT/Triple.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/CodeGen/Analysis.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DiagnosticPrinter.h" Index: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp =================================================================== --- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp +++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp @@ -24,8 +24,9 @@ #include "llvm/Analysis/ProfileSummaryInfo.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/Bitcode/BitcodeWriterPass.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/ExecutionEngine/ObjectMemoryBuffer.h" #include "llvm/IR/DiagnosticPrinter.h" #include "llvm/IR/LLVMContext.h" Index: llvm/trunk/lib/Object/IRObjectFile.cpp =================================================================== --- llvm/trunk/lib/Object/IRObjectFile.cpp +++ llvm/trunk/lib/Object/IRObjectFile.cpp @@ -14,7 +14,7 @@ #include "llvm/Object/IRObjectFile.h" #include "RecordStreamer.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/GVMaterializer.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Mangler.h" Index: llvm/trunk/lib/Object/ModuleSummaryIndexObjectFile.cpp =================================================================== --- llvm/trunk/lib/Object/ModuleSummaryIndexObjectFile.cpp +++ llvm/trunk/lib/Object/ModuleSummaryIndexObjectFile.cpp @@ -13,7 +13,7 @@ #include "llvm/Object/ModuleSummaryIndexObjectFile.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/MC/MCStreamer.h" #include "llvm/Object/ObjectFile.h" Index: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp =================================================================== --- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp +++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "BugDriver.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/Module.h" Index: llvm/trunk/tools/gold/gold-plugin.cpp =================================================================== --- llvm/trunk/tools/gold/gold-plugin.cpp +++ llvm/trunk/tools/gold/gold-plugin.cpp @@ -12,7 +12,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/CodeGen/CommandFlags.h" #include "llvm/Config/config.h" // plugin-api.h requires HAVE_STDINT_H #include "llvm/IR/Constants.h" Index: llvm/trunk/tools/lli/lli.cpp =================================================================== --- llvm/trunk/tools/lli/lli.cpp +++ llvm/trunk/tools/lli/lli.cpp @@ -18,7 +18,7 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Triple.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/Interpreter.h" Index: llvm/trunk/tools/llvm-as/llvm-as.cpp =================================================================== --- llvm/trunk/tools/llvm-as/llvm-as.cpp +++ llvm/trunk/tools/llvm-as/llvm-as.cpp @@ -16,7 +16,7 @@ //===----------------------------------------------------------------------===// #include "llvm/AsmParser/Parser.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Verifier.h" Index: llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp =================================================================== --- llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ llvm/trunk/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp @@ -28,9 +28,9 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/StringExtras.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Bitcode/LLVMBitCodes.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Verifier.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Format.h" Index: llvm/trunk/tools/llvm-dis/llvm-dis.cpp =================================================================== --- llvm/trunk/tools/llvm-dis/llvm-dis.cpp +++ llvm/trunk/tools/llvm-dis/llvm-dis.cpp @@ -17,7 +17,7 @@ //===----------------------------------------------------------------------===// #include "llvm/IR/LLVMContext.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/IR/AssemblyAnnotationWriter.h" #include "llvm/IR/DebugInfo.h" #include "llvm/IR/DiagnosticInfo.h" Index: llvm/trunk/tools/llvm-link/llvm-link.cpp =================================================================== --- llvm/trunk/tools/llvm-link/llvm-link.cpp +++ llvm/trunk/tools/llvm-link/llvm-link.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/STLExtras.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/AutoUpgrade.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/DiagnosticPrinter.h" Index: llvm/trunk/tools/llvm-lto/llvm-lto.cpp =================================================================== --- llvm/trunk/tools/llvm-lto/llvm-lto.cpp +++ llvm/trunk/tools/llvm-lto/llvm-lto.cpp @@ -13,7 +13,8 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/StringSet.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/CodeGen/CommandFlags.h" #include "llvm/IR/DiagnosticPrinter.h" #include "llvm/IR/LLVMContext.h" Index: llvm/trunk/tools/llvm-split/llvm-split.cpp =================================================================== --- llvm/trunk/tools/llvm-split/llvm-split.cpp +++ llvm/trunk/tools/llvm-split/llvm-split.cpp @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/StringExtras.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Verifier.h" #include "llvm/IRReader/IRReader.h" Index: llvm/trunk/tools/lto/lto.cpp =================================================================== --- llvm/trunk/tools/lto/lto.cpp +++ llvm/trunk/tools/lto/lto.cpp @@ -14,7 +14,7 @@ #include "llvm-c/lto.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" #include "llvm/CodeGen/CommandFlags.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/DiagnosticPrinter.h" Index: llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp =================================================================== --- llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp +++ llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp @@ -30,7 +30,8 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/AsmParser/Parser.h" -#include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/UseListOrder.h" Index: llvm/trunk/unittests/Bitcode/BitReaderTest.cpp =================================================================== --- llvm/trunk/unittests/Bitcode/BitReaderTest.cpp +++ llvm/trunk/unittests/Bitcode/BitReaderTest.cpp @@ -7,12 +7,13 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" #include "llvm/AsmParser/Parser.h" +#include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/Bitcode/BitcodeWriter.h" #include "llvm/Bitcode/BitstreamReader.h" #include "llvm/Bitcode/BitstreamWriter.h" -#include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h"