From 044eb2f6afba375a914ac9d8024f8f5142bb912e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:10:56 +0000 Subject: Vendor import of llvm trunk r321017: https://llvm.org/svn/llvm-project/llvm/trunk@321017 --- include/llvm/Bitcode/BitcodeReader.h | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'include/llvm/Bitcode/BitcodeReader.h') diff --git a/include/llvm/Bitcode/BitcodeReader.h b/include/llvm/Bitcode/BitcodeReader.h index 160ddad5761f8..ce8bdd9cf0b4a 100644 --- a/include/llvm/Bitcode/BitcodeReader.h +++ b/include/llvm/Bitcode/BitcodeReader.h @@ -1,4 +1,4 @@ -//===-- llvm/Bitcode/BitcodeReader.h - Bitcode reader ----*- C++ -*-===// +//===- llvm/Bitcode/BitcodeReader.h - Bitcode reader ------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -14,18 +14,23 @@ #ifndef LLVM_BITCODE_BITCODEREADER_H #define LLVM_BITCODE_BITCODEREADER_H +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Bitcode/BitCodes.h" -#include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" +#include #include - +#include +#include +#include namespace llvm { - class LLVMContext; - class Module; + +class LLVMContext; +class Module; // These functions are for converting Expected/Error values to // ErrorOr/std::error_code for compatibility with legacy clients. FIXME: @@ -81,6 +86,7 @@ namespace llvm { StringRef getBuffer() const { return StringRef((const char *)Buffer.begin(), Buffer.size()); } + StringRef getStrtab() const { return Strtab; } StringRef getModuleIdentifier() const { return ModuleIdentifier; } @@ -182,7 +188,6 @@ namespace llvm { /// 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 :-). @@ -196,7 +201,6 @@ namespace llvm { /// 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 @@ -210,7 +214,6 @@ namespace llvm { /// 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) || @@ -258,10 +261,12 @@ namespace llvm { return std::error_code(static_cast(E), BitcodeErrorCategory()); } -} // End llvm namespace +} // end namespace llvm namespace std { + template <> struct is_error_code_enum : std::true_type {}; -} -#endif +} // end namespace std + +#endif // LLVM_BITCODE_BITCODEREADER_H -- cgit v1.2.3