1
- // ===-- llvm/Bitcode/BitcodeReader.h - Bitcode reader ----*- C++ -*-===//
1
+ // ===- llvm/Bitcode/BitcodeReader.h - Bitcode reader -------- ----*- C++ -*-===//
2
2
//
3
3
// The LLVM Compiler Infrastructure
4
4
//
14
14
#ifndef LLVM_BITCODE_BITCODEREADER_H
15
15
#define LLVM_BITCODE_BITCODEREADER_H
16
16
17
+ #include " llvm/ADT/ArrayRef.h"
18
+ #include " llvm/ADT/StringRef.h"
17
19
#include " llvm/Bitcode/BitCodes.h"
18
- #include " llvm/IR/DiagnosticInfo.h"
19
20
#include " llvm/IR/ModuleSummaryIndex.h"
20
21
#include " llvm/Support/Endian.h"
21
22
#include " llvm/Support/Error.h"
22
23
#include " llvm/Support/ErrorOr.h"
23
24
#include " llvm/Support/MemoryBuffer.h"
25
+ #include < cstdint>
24
26
#include < memory>
25
-
27
+ #include < string>
28
+ #include < system_error>
29
+ #include < vector>
26
30
namespace llvm {
27
- class LLVMContext ;
28
- class Module ;
31
+
32
+ class LLVMContext ;
33
+ class Module ;
29
34
30
35
// These functions are for converting Expected/Error values to
31
36
// ErrorOr/std::error_code for compatibility with legacy clients. FIXME:
@@ -81,6 +86,7 @@ namespace llvm {
81
86
StringRef getBuffer () const {
82
87
return StringRef ((const char *)Buffer.begin (), Buffer.size ());
83
88
}
89
+
84
90
StringRef getStrtab () const { return Strtab; }
85
91
86
92
StringRef getModuleIdentifier () const { return ModuleIdentifier; }
@@ -182,7 +188,6 @@ namespace llvm {
182
188
183
189
// / isBitcodeWrapper - Return true if the given bytes are the magic bytes
184
190
// / for an LLVM IR bitcode wrapper.
185
- // /
186
191
inline bool isBitcodeWrapper (const unsigned char *BufPtr,
187
192
const unsigned char *BufEnd) {
188
193
// See if you can find the hidden message in the magic bytes :-).
@@ -196,7 +201,6 @@ namespace llvm {
196
201
197
202
// / isRawBitcode - Return true if the given bytes are the magic bytes for
198
203
// / raw LLVM IR bitcode (without a wrapper).
199
- // /
200
204
inline bool isRawBitcode (const unsigned char *BufPtr,
201
205
const unsigned char *BufEnd) {
202
206
// These bytes sort of have a hidden message, but it's not in
@@ -210,7 +214,6 @@ namespace llvm {
210
214
211
215
// / isBitcode - Return true if the given bytes are the magic bytes for
212
216
// / LLVM IR bitcode, either with or without a wrapper.
213
- // /
214
217
inline bool isBitcode (const unsigned char *BufPtr,
215
218
const unsigned char *BufEnd) {
216
219
return isBitcodeWrapper (BufPtr, BufEnd) ||
@@ -258,10 +261,12 @@ namespace llvm {
258
261
return std::error_code (static_cast <int >(E), BitcodeErrorCategory ());
259
262
}
260
263
261
- } // End llvm namespace
264
+ } // end namespace llvm
262
265
263
266
namespace std {
267
+
264
268
template <> struct is_error_code_enum <llvm::BitcodeError> : std::true_type {};
265
- }
266
269
267
- #endif
270
+ } // end namespace std
271
+
272
+ #endif // LLVM_BITCODE_BITCODEREADER_H
0 commit comments