//===- BitstreamReader.h - Low-level bitstream reader interface -*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This header defines the BitstreamReader class. This class can be used to // read an arbitrary bitstream, regardless of its contents. // //===----------------------------------------------------------------------===// #ifndef LLVM_BITSTREAM_BITSTREAMREADER_H #define LLVM_BITSTREAM_BITSTREAMREADER_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Bitstream/BitCodes.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" #include "llvm/Support/MemoryBufferRef.h" #include <algorithm> #include <cassert> #include <climits> #include <cstddef> #include <cstdint> #include <memory> #include <optional> #include <string> #include <utility> #include <vector> namespace llvm { /// This class maintains the abbreviations read from a block info block. class BitstreamBlockInfo { … }; /// This represents a position within a bitstream. There may be multiple /// independent cursors reading within one bitstream, each maintaining their /// own local state. class SimpleBitstreamCursor { … }; /// When advancing through a bitstream cursor, each advance can discover a few /// different kinds of entries: struct BitstreamEntry { … }; /// This represents a position within a bitcode file, implemented on top of a /// SimpleBitstreamCursor. /// /// Unlike iterators, BitstreamCursors are heavy-weight objects that should not /// be passed by value. class BitstreamCursor : SimpleBitstreamCursor { … }; } // end llvm namespace #endif // LLVM_BITSTREAM_BITSTREAMREADER_H