Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
BitcodeReader.h
Go to the documentation of this file.
1//===- llvm/Bitcode/BitcodeReader.h - Bitcode reader ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This header defines interfaces to read LLVM bitcode files/streams.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_BITCODE_BITCODEREADER_H
14#define LLVM_BITCODE_BITCODEREADER_H
15
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/StringRef.h"
18#include "llvm/Bitstream/BitCodeEnums.h"
19#include "llvm/IR/GlobalValue.h"
20#include "llvm/Support/Endian.h"
21#include "llvm/Support/Error.h"
22#include "llvm/Support/ErrorOr.h"
23#include "llvm/Support/MemoryBufferRef.h"
24#include <cstdint>
25#include <memory>
26#include <optional>
27#include <string>
28#include <system_error>
29#include <vector>
30namespacellvm {
31
32classLLVMContext;
33classModule;
34classMemoryBuffer;
35classMetadata;
36classModuleSummaryIndex;
37classType;
38classValue;
39
40// Callback to override the data layout string of an imported bitcode module.
41// The first argument is the target triple, the second argument the data layout
42// string from the input, or a default string. It will be used if the callback
43// returns std::nullopt.
44typedef std::function<std::optional<std::string>(StringRef, StringRef)>
45DataLayoutCallbackFuncTy;
46
47typedef std::function<Type *(unsigned)>GetTypeByIDTy;
48
49typedef std::function<unsigned(unsigned,unsigned)>GetContainedTypeIDTy;
50
51typedef std::function<void(Value *,unsigned,GetTypeByIDTy,
52GetContainedTypeIDTy)>
53ValueTypeCallbackTy;
54
55typedef std::function<void(Metadata **,unsigned,GetTypeByIDTy,
56GetContainedTypeIDTy)>
57MDTypeCallbackTy;
58
59// These functions are for converting Expected/Error values to
60// ErrorOr/std::error_code for compatibility with legacy clients. FIXME:
61// Remove these functions once no longer needed by the C and libLTO APIs.
62
63std::error_codeerrorToErrorCodeAndEmitErrors(LLVMContext &Ctx,Error Err);
64
65template <typename T>
66ErrorOr<T>expectedToErrorOrAndEmitErrors(LLVMContext &Ctx,Expected<T> Val) {
67if (!Val)
68returnerrorToErrorCodeAndEmitErrors(Ctx, Val.takeError());
69return std::move(*Val);
70}
71
72structParserCallbacks {
73 std::optional<DataLayoutCallbackFuncTy>DataLayout;
74 /// The ValueType callback is called for every function definition or
75 /// declaration and allows accessing the type information, also behind
76 /// pointers. This can be useful, when the opaque pointer upgrade cleans all
77 /// type information behind pointers.
78 /// The second argument to ValueTypeCallback is the type ID of the
79 /// function, the two passed functions can be used to extract type
80 /// information.
81 std::optional<ValueTypeCallbackTy>ValueType;
82 /// The MDType callback is called for every value in metadata.
83 std::optional<MDTypeCallbackTy>MDType;
84
85ParserCallbacks() =default;
86explicitParserCallbacks(DataLayoutCallbackFuncTyDataLayout)
87 :DataLayout(DataLayout) {}
88};
89
90structBitcodeFileContents;
91
92 /// Basic information extracted from a bitcode module to be used for LTO.
93structBitcodeLTOInfo {
94boolIsThinLTO;
95boolHasSummary;
96boolEnableSplitLTOUnit;
97boolUnifiedLTO;
98 };
99
100 /// Represents a module in a bitcode file.
101classBitcodeModule {
102// This covers the identification (if present) and module blocks.
103ArrayRef<uint8_t> Buffer;
104StringRef ModuleIdentifier;
105
106// The string table used to interpret this module.
107StringRef Strtab;
108
109// The bitstream location of the IDENTIFICATION_BLOCK.
110uint64_t IdentificationBit;
111
112// The bitstream location of this module's MODULE_BLOCK.
113uint64_t ModuleBit;
114
115BitcodeModule(ArrayRef<uint8_t> Buffer,StringRef ModuleIdentifier,
116uint64_t IdentificationBit,uint64_t ModuleBit)
117 : Buffer(Buffer), ModuleIdentifier(ModuleIdentifier),
118 IdentificationBit(IdentificationBit), ModuleBit(ModuleBit) {}
119
120// Calls the ctor.
121friendExpected<BitcodeFileContents>
122getBitcodeFileContents(MemoryBufferRef Buffer);
123
124Expected<std::unique_ptr<Module>>
125 getModuleImpl(LLVMContext &Context,bool MaterializeAll,
126bool ShouldLazyLoadMetadata,bool IsImporting,
127ParserCallbacks Callbacks = {});
128
129public:
130StringRefgetBuffer() const{
131returnStringRef((constchar *)Buffer.begin(), Buffer.size());
132 }
133
134StringRefgetStrtab() const{return Strtab; }
135
136StringRefgetModuleIdentifier() const{return ModuleIdentifier; }
137
138 /// Read the bitcode module and prepare for lazy deserialization of function
139 /// bodies. If ShouldLazyLoadMetadata is true, lazily load metadata as well.
140 /// If IsImporting is true, this module is being parsed for ThinLTO
141 /// importing into another module.
142Expected<std::unique_ptr<Module>>
143getLazyModule(LLVMContext &Context,bool ShouldLazyLoadMetadata,
144bool IsImporting,ParserCallbacks Callbacks = {});
145
146 /// Read the entire bitcode module and return it.
147 Expected<std::unique_ptr<Module>>
148parseModule(LLVMContext &Context, ParserCallbacks Callbacks = {});
149
150 /// Returns information about the module to be used for LTO: whether to
151 /// compile with ThinLTO, and whether it has a summary.
152 Expected<BitcodeLTOInfo>getLTOInfo();
153
154 /// Parse the specified bitcode buffer, returning the module summary index.
155 Expected<std::unique_ptr<ModuleSummaryIndex>>getSummary();
156
157 /// Parse the specified bitcode buffer and merge its module summary index
158 /// into CombinedIndex.
159Error
160readSummary(ModuleSummaryIndex &CombinedIndex, StringRef ModulePath,
161 std::function<bool(GlobalValue::GUID)> IsPrevailing =nullptr);
162 };
163
164structBitcodeFileContents {
165 std::vector<BitcodeModule>Mods;
166StringRefSymtab,StrtabForSymtab;
167 };
168
169 /// Returns the contents of a bitcode file. This includes the raw contents of
170 /// the symbol table embedded in the bitcode file. Clients which require a
171 /// symbol table should prefer to use irsymtab::read instead of this function
172 /// because it creates a reader for the irsymtab and handles upgrading bitcode
173 /// files without a symbol table or with an old symbol table.
174Expected<BitcodeFileContents>getBitcodeFileContents(MemoryBufferRef Buffer);
175
176 /// Returns a list of modules in the specified bitcode buffer.
177Expected<std::vector<BitcodeModule>>
178getBitcodeModuleList(MemoryBufferRef Buffer);
179
180 /// Read the header of the specified bitcode buffer and prepare for lazy
181 /// deserialization of function bodies. If ShouldLazyLoadMetadata is true,
182 /// lazily load metadata as well. If IsImporting is true, this module is
183 /// being parsed for ThinLTO importing into another module.
184Expected<std::unique_ptr<Module>>
185getLazyBitcodeModule(MemoryBufferRef Buffer,LLVMContext &Context,
186bool ShouldLazyLoadMetadata =false,
187bool IsImporting =false,
188ParserCallbacks Callbacks = {});
189
190 /// Like getLazyBitcodeModule, except that the module takes ownership of
191 /// the memory buffer if successful. If successful, this moves Buffer. On
192 /// error, this *does not* move Buffer. If IsImporting is true, this module is
193 /// being parsed for ThinLTO importing into another module.
194 Expected<std::unique_ptr<Module>>getOwningLazyBitcodeModule(
195 std::unique_ptr<MemoryBuffer> &&Buffer, LLVMContext &Context,
196bool ShouldLazyLoadMetadata =false,bool IsImporting =false,
197 ParserCallbacks Callbacks = {});
198
199 /// Read the header of the specified bitcode buffer and extract just the
200 /// triple information. If successful, this returns a string. On error, this
201 /// returns "".
202 Expected<std::string>getBitcodeTargetTriple(MemoryBufferRef Buffer);
203
204 /// Return true if \p Buffer contains a bitcode file with ObjC code (category
205 /// or class) in it.
206 Expected<bool>isBitcodeContainingObjCCategory(MemoryBufferRef Buffer);
207
208 /// Read the header of the specified bitcode buffer and extract just the
209 /// producer string information. If successful, this returns a string. On
210 /// error, this returns "".
211 Expected<std::string>getBitcodeProducerString(MemoryBufferRef Buffer);
212
213 /// Read the specified bitcode file, returning the module.
214 Expected<std::unique_ptr<Module>>
215parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context,
216 ParserCallbacks Callbacks = {});
217
218 /// Returns LTO information for the specified bitcode file.
219 Expected<BitcodeLTOInfo>getBitcodeLTOInfo(MemoryBufferRef Buffer);
220
221 /// Parse the specified bitcode buffer, returning the module summary index.
222 Expected<std::unique_ptr<ModuleSummaryIndex>>
223getModuleSummaryIndex(MemoryBufferRef Buffer);
224
225 /// Parse the specified bitcode buffer and merge the index into CombinedIndex.
226ErrorreadModuleSummaryIndex(MemoryBufferRef Buffer,
227 ModuleSummaryIndex &CombinedIndex);
228
229 /// Parse the module summary index out of an IR file and return the module
230 /// summary index object if found, or an empty summary if not. If Path refers
231 /// to an empty file and IgnoreEmptyThinLTOIndexFile is true, then
232 /// this function will return nullptr.
233 Expected<std::unique_ptr<ModuleSummaryIndex>>
234getModuleSummaryIndexForFile(StringRef Path,
235bool IgnoreEmptyThinLTOIndexFile =false);
236
237 /// isBitcodeWrapper - Return true if the given bytes are the magic bytes
238 /// for an LLVM IR bitcode wrapper.
239inlineboolisBitcodeWrapper(constunsignedchar *BufPtr,
240constunsignedchar *BufEnd) {
241// See if you can find the hidden message in the magic bytes :-).
242// (Hint: it's a little-endian encoding.)
243return BufPtr != BufEnd &&
244 BufPtr[0] == 0xDE &&
245 BufPtr[1] == 0xC0 &&
246 BufPtr[2] == 0x17 &&
247 BufPtr[3] == 0x0B;
248 }
249
250 /// isRawBitcode - Return true if the given bytes are the magic bytes for
251 /// raw LLVM IR bitcode (without a wrapper).
252inlineboolisRawBitcode(constunsignedchar *BufPtr,
253constunsignedchar *BufEnd) {
254// These bytes sort of have a hidden message, but it's not in
255// little-endian this time, and it's a little redundant.
256return BufPtr != BufEnd &&
257 BufPtr[0] =='B' &&
258 BufPtr[1] =='C' &&
259 BufPtr[2] == 0xc0 &&
260 BufPtr[3] == 0xde;
261 }
262
263 /// isBitcode - Return true if the given bytes are the magic bytes for
264 /// LLVM IR bitcode, either with or without a wrapper.
265inlineboolisBitcode(constunsignedchar *BufPtr,
266constunsignedchar *BufEnd) {
267returnisBitcodeWrapper(BufPtr, BufEnd) ||
268isRawBitcode(BufPtr, BufEnd);
269 }
270
271 /// SkipBitcodeWrapperHeader - Some systems wrap bc files with a special
272 /// header for padding or other reasons. The format of this header is:
273 ///
274 /// struct bc_header {
275 /// uint32_t Magic; // 0x0B17C0DE
276 /// uint32_t Version; // Version, currently always 0.
277 /// uint32_t BitcodeOffset; // Offset to traditional bitcode file.
278 /// uint32_t BitcodeSize; // Size of traditional bitcode file.
279 /// ... potentially other gunk ...
280 /// };
281 ///
282 /// This function is called when we find a file with a matching magic number.
283 /// In this case, skip down to the subsection of the file that is actually a
284 /// BC file.
285 /// If 'VerifyBufferSize' is true, check that the buffer is large enough to
286 /// contain the whole bitcode file.
287inlineboolSkipBitcodeWrapperHeader(constunsignedchar *&BufPtr,
288constunsignedchar *&BufEnd,
289bool VerifyBufferSize) {
290// Must contain the offset and size field!
291if (unsigned(BufEnd - BufPtr) <BWH_SizeField + 4)
292returntrue;
293
294unsignedOffset =support::endian::read32le(&BufPtr[BWH_OffsetField]);
295unsignedSize =support::endian::read32le(&BufPtr[BWH_SizeField]);
296uint64_t BitcodeOffsetEnd = (uint64_t)Offset + (uint64_t)Size;
297
298// Verify that Offset+Size fits in the file.
299if (VerifyBufferSize && BitcodeOffsetEnd >uint64_t(BufEnd-BufPtr))
300returntrue;
301 BufPtr +=Offset;
302 BufEnd = BufPtr+Size;
303returnfalse;
304 }
305
306 APIntreadWideAPInt(ArrayRef<uint64_t> Vals,unsigned TypeBits);
307
308const std::error_category &BitcodeErrorCategory();
309enum classBitcodeError {CorruptedBitcode = 1 };
310inline std::error_codemake_error_code(BitcodeErrorE) {
311return std::error_code(static_cast<int>(E),BitcodeErrorCategory());
312 }
313
314}// end namespace llvm
315
316namespacestd {
317
318template <>structis_error_code_enum<llvm::BitcodeError> : std::true_type {};
319
320}// end namespace std
321
322#endif// LLVM_BITCODE_BITCODEREADER_H
ArrayRef.h
BitCodeEnums.h
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Type
RelocType Type
Definition:COFFYAML.cpp:410
Metadata
dxil translate DXIL Translate Metadata
Definition:DXILTranslateMetadata.cpp:467
Size
uint64_t Size
Definition:ELFObjHandler.cpp:81
Endian.h
ErrorOr.h
Provides ErrorOr<T> smart pointer.
GlobalValue.h
Module
Machine Check Debug Module
Definition:MachineCheckDebugify.cpp:124
MemoryBufferRef.h
StringRef.h
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition:ArrayRef.h:41
llvm::ArrayRef::size
size_t size() const
size - Get the array size.
Definition:ArrayRef.h:168
llvm::ArrayRef::begin
iterator begin() const
Definition:ArrayRef.h:156
llvm::BitcodeModule
Represents a module in a bitcode file.
Definition:BitcodeReader.h:101
llvm::BitcodeModule::getModuleIdentifier
StringRef getModuleIdentifier() const
Definition:BitcodeReader.h:136
llvm::BitcodeModule::getSummary
Expected< std::unique_ptr< ModuleSummaryIndex > > getSummary()
Parse the specified bitcode buffer, returning the module summary index.
Definition:BitcodeReader.cpp:8554
llvm::BitcodeModule::getLTOInfo
Expected< BitcodeLTOInfo > getLTOInfo()
Returns information about the module to be used for LTO: whether to compile with ThinLTO,...
Definition:BitcodeReader.cpp:8621
llvm::BitcodeModule::getBuffer
StringRef getBuffer() const
Definition:BitcodeReader.h:130
llvm::BitcodeModule::readSummary
Error readSummary(ModuleSummaryIndex &CombinedIndex, StringRef ModulePath, std::function< bool(GlobalValue::GUID)> IsPrevailing=nullptr)
Parse the specified bitcode buffer and merge its module summary index into CombinedIndex.
Definition:BitcodeReader.cpp:8541
llvm::BitcodeModule::parseModule
Expected< std::unique_ptr< Module > > parseModule(LLVMContext &Context, ParserCallbacks Callbacks={})
Read the entire bitcode module and return it.
Definition:BitcodeReader.cpp:8714
llvm::BitcodeModule::getStrtab
StringRef getStrtab() const
Definition:BitcodeReader.h:134
llvm::BitcodeModule::getBitcodeFileContents
friend Expected< BitcodeFileContents > getBitcodeFileContents(MemoryBufferRef Buffer)
Returns the contents of a bitcode file.
llvm::BitcodeModule::getLazyModule
Expected< std::unique_ptr< Module > > getLazyModule(LLVMContext &Context, bool ShouldLazyLoadMetadata, bool IsImporting, ParserCallbacks Callbacks={})
Read the bitcode module and prepare for lazy deserialization of function bodies.
Definition:BitcodeReader.cpp:8531
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition:DataLayout.h:63
llvm::ErrorOr
Represents either an error or a value T.
Definition:ErrorOr.h:56
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition:Error.h:160
llvm::Expected
Tagged union holding either a T or a Error.
Definition:Error.h:481
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition:Error.h:608
llvm::GlobalValue::GUID
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
Definition:GlobalValue.h:588
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition:LLVMContext.h:67
llvm::MemoryBufferRef
Definition:MemoryBufferRef.h:22
llvm::Metadata
Root of the metadata hierarchy.
Definition:Metadata.h:62
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::Value
LLVM Value Representation.
Definition:Value.h:74
uint64_t
unsigned
Error.h
llvm::TargetStackID::Value
Value
Definition:TargetFrameLowering.h:29
llvm::lltok::Error
@ Error
Definition:LLToken.h:21
llvm::support::endian::read32le
uint32_t read32le(const void *P)
Definition:Endian.h:425
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Offset
@ Offset
Definition:DWP.cpp:480
llvm::BitcodeErrorCategory
const std::error_category & BitcodeErrorCategory()
Definition:BitcodeReader.cpp:8316
llvm::parseBitcodeFile
Expected< std::unique_ptr< Module > > parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context, ParserCallbacks Callbacks={})
Read the specified bitcode file, returning the module.
Definition:BitcodeReader.cpp:8721
llvm::make_error_code
std::error_code make_error_code(BitcodeError E)
Definition:BitcodeReader.h:310
llvm::GetTypeByIDTy
std::function< Type *(unsigned)> GetTypeByIDTy
Definition:BitcodeReader.h:47
llvm::isBitcodeContainingObjCCategory
Expected< bool > isBitcodeContainingObjCCategory(MemoryBufferRef Buffer)
Return true if Buffer contains a bitcode file with ObjC code (category or class) in it.
Definition:BitcodeReader.cpp:8738
llvm::GetContainedTypeIDTy
std::function< unsigned(unsigned, unsigned)> GetContainedTypeIDTy
Definition:BitcodeReader.h:49
llvm::BWH_OffsetField
@ BWH_OffsetField
Definition:BitCodeEnums.h:29
llvm::BWH_SizeField
@ BWH_SizeField
Definition:BitCodeEnums.h:30
llvm::getBitcodeTargetTriple
Expected< std::string > getBitcodeTargetTriple(MemoryBufferRef Buffer)
Read the header of the specified bitcode buffer and extract just the triple information.
Definition:BitcodeReader.cpp:8730
llvm::getBitcodeFileContents
Expected< BitcodeFileContents > getBitcodeFileContents(MemoryBufferRef Buffer)
Returns the contents of a bitcode file.
Definition:BitcodeReader.cpp:8372
llvm::expectedToErrorOrAndEmitErrors
ErrorOr< T > expectedToErrorOrAndEmitErrors(LLVMContext &Ctx, Expected< T > Val)
Definition:BitcodeReader.h:66
llvm::isRawBitcode
bool isRawBitcode(const unsigned char *BufPtr, const unsigned char *BufEnd)
isRawBitcode - Return true if the given bytes are the magic bytes for raw LLVM IR bitcode (without a ...
Definition:BitcodeReader.h:252
llvm::getModuleSummaryIndex
Expected< std::unique_ptr< ModuleSummaryIndex > > getModuleSummaryIndex(MemoryBufferRef Buffer)
Parse the specified bitcode buffer, returning the module summary index.
Definition:BitcodeReader.cpp:8764
llvm::getBitcodeProducerString
Expected< std::string > getBitcodeProducerString(MemoryBufferRef Buffer)
Read the header of the specified bitcode buffer and extract just the producer string information.
Definition:BitcodeReader.cpp:8746
llvm::getLazyBitcodeModule
Expected< std::unique_ptr< Module > > getLazyBitcodeModule(MemoryBufferRef Buffer, LLVMContext &Context, bool ShouldLazyLoadMetadata=false, bool IsImporting=false, ParserCallbacks Callbacks={})
Read the header of the specified bitcode buffer and prepare for lazy deserialization of function bodi...
Definition:BitcodeReader.cpp:8692
llvm::MDTypeCallbackTy
std::function< void(Metadata **, unsigned, GetTypeByIDTy, GetContainedTypeIDTy)> MDTypeCallbackTy
Definition:BitcodeReader.h:57
llvm::getBitcodeModuleList
Expected< std::vector< BitcodeModule > > getBitcodeModuleList(MemoryBufferRef Buffer)
Returns a list of modules in the specified bitcode buffer.
Definition:BitcodeReader.cpp:8364
llvm::getBitcodeLTOInfo
Expected< BitcodeLTOInfo > getBitcodeLTOInfo(MemoryBufferRef Buffer)
Returns LTO information for the specified bitcode file.
Definition:BitcodeReader.cpp:8772
llvm::SkipBitcodeWrapperHeader
bool SkipBitcodeWrapperHeader(const unsigned char *&BufPtr, const unsigned char *&BufEnd, bool VerifyBufferSize)
SkipBitcodeWrapperHeader - Some systems wrap bc files with a special header for padding or other reas...
Definition:BitcodeReader.h:287
llvm::isBitcodeWrapper
bool isBitcodeWrapper(const unsigned char *BufPtr, const unsigned char *BufEnd)
isBitcodeWrapper - Return true if the given bytes are the magic bytes for an LLVM IR bitcode wrapper.
Definition:BitcodeReader.h:239
llvm::readWideAPInt
APInt readWideAPInt(ArrayRef< uint64_t > Vals, unsigned TypeBits)
Definition:BitcodeReader.cpp:3188
llvm::ValueTypeCallbackTy
std::function< void(Value *, unsigned, GetTypeByIDTy, GetContainedTypeIDTy)> ValueTypeCallbackTy
Definition:BitcodeReader.h:53
llvm::DataLayoutCallbackFuncTy
std::function< std::optional< std::string >(StringRef, StringRef)> DataLayoutCallbackFuncTy
Definition:BitcodeReader.h:45
llvm::isBitcode
bool isBitcode(const unsigned char *BufPtr, const unsigned char *BufEnd)
isBitcode - Return true if the given bytes are the magic bytes for LLVM IR bitcode,...
Definition:BitcodeReader.h:265
llvm::readModuleSummaryIndex
Error readModuleSummaryIndex(MemoryBufferRef Buffer, ModuleSummaryIndex &CombinedIndex)
Parse the specified bitcode buffer and merge the index into CombinedIndex.
Definition:BitcodeReader.cpp:8754
llvm::getModuleSummaryIndexForFile
Expected< std::unique_ptr< ModuleSummaryIndex > > getModuleSummaryIndexForFile(StringRef Path, bool IgnoreEmptyThinLTOIndexFile=false)
Parse the module summary index out of an IR file and return the module summary index object if found,...
Definition:BitcodeReader.cpp:8781
llvm::getOwningLazyBitcodeModule
Expected< std::unique_ptr< Module > > getOwningLazyBitcodeModule(std::unique_ptr< MemoryBuffer > &&Buffer, LLVMContext &Context, bool ShouldLazyLoadMetadata=false, bool IsImporting=false, ParserCallbacks Callbacks={})
Like getLazyBitcodeModule, except that the module takes ownership of the memory buffer if successful.
Definition:BitcodeReader.cpp:8703
llvm::errorToErrorCodeAndEmitErrors
std::error_code errorToErrorCodeAndEmitErrors(LLVMContext &Ctx, Error Err)
Definition:BitcodeReader.cpp:1033
llvm::BitcodeError
BitcodeError
Definition:BitcodeReader.h:309
llvm::BitcodeError::CorruptedBitcode
@ CorruptedBitcode
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
llvm::BitcodeFileContents
Definition:BitcodeReader.h:164
llvm::BitcodeFileContents::StrtabForSymtab
StringRef StrtabForSymtab
Definition:BitcodeReader.h:166
llvm::BitcodeFileContents::Symtab
StringRef Symtab
Definition:BitcodeReader.h:166
llvm::BitcodeFileContents::Mods
std::vector< BitcodeModule > Mods
Definition:BitcodeReader.h:165
llvm::BitcodeLTOInfo
Basic information extracted from a bitcode module to be used for LTO.
Definition:BitcodeReader.h:93
llvm::BitcodeLTOInfo::UnifiedLTO
bool UnifiedLTO
Definition:BitcodeReader.h:97
llvm::BitcodeLTOInfo::IsThinLTO
bool IsThinLTO
Definition:BitcodeReader.h:94
llvm::BitcodeLTOInfo::EnableSplitLTOUnit
bool EnableSplitLTOUnit
Definition:BitcodeReader.h:96
llvm::BitcodeLTOInfo::HasSummary
bool HasSummary
Definition:BitcodeReader.h:95
llvm::ParserCallbacks
Definition:BitcodeReader.h:72
llvm::ParserCallbacks::ValueType
std::optional< ValueTypeCallbackTy > ValueType
The ValueType callback is called for every function definition or declaration and allows accessing th...
Definition:BitcodeReader.h:81
llvm::ParserCallbacks::DataLayout
std::optional< DataLayoutCallbackFuncTy > DataLayout
Definition:BitcodeReader.h:73
llvm::ParserCallbacks::ParserCallbacks
ParserCallbacks(DataLayoutCallbackFuncTy DataLayout)
Definition:BitcodeReader.h:86
llvm::ParserCallbacks::MDType
std::optional< MDTypeCallbackTy > MDType
The MDType callback is called for every value in metadata.
Definition:BitcodeReader.h:83
llvm::ParserCallbacks::ParserCallbacks
ParserCallbacks()=default

Generated on Fri Jul 18 2025 09:01:36 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp