summaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode/BitcodeReader.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:10:56 +0000
commit044eb2f6afba375a914ac9d8024f8f5142bb912e (patch)
tree1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/Bitcode/BitcodeReader.h
parenteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff)
Notes
Diffstat (limited to 'include/llvm/Bitcode/BitcodeReader.h')
-rw-r--r--include/llvm/Bitcode/BitcodeReader.h27
1 files changed, 16 insertions, 11 deletions
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 <cstdint>
#include <memory>
-
+#include <string>
+#include <system_error>
+#include <vector>
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<int>(E), BitcodeErrorCategory());
}
-} // End llvm namespace
+} // end namespace llvm
namespace std {
+
template <> struct is_error_code_enum<llvm::BitcodeError> : std::true_type {};
-}
-#endif
+} // end namespace std
+
+#endif // LLVM_BITCODE_BITCODEREADER_H