LLVM  15.0.0git
Object.cpp
Go to the documentation of this file.
1 //===- Object.cpp - C bindings to the object file library--------*- 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 file defines the C bindings to the file-format-independent object
10 // library.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm-c/Object.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/IR/LLVMContext.h"
17 #include "llvm/Object/ObjectFile.h"
19 #include "llvm/Support/MemAlloc.h"
20 
21 using namespace llvm;
22 using namespace object;
23 
24 inline OwningBinary<ObjectFile> *unwrap(LLVMObjectFileRef OF) {
25  return reinterpret_cast<OwningBinary<ObjectFile> *>(OF);
26 }
27 
28 inline LLVMObjectFileRef wrap(const OwningBinary<ObjectFile> *OF) {
29  return reinterpret_cast<LLVMObjectFileRef>(
30  const_cast<OwningBinary<ObjectFile> *>(OF));
31 }
32 
34  return reinterpret_cast<section_iterator*>(SI);
35 }
36 
39  return reinterpret_cast<LLVMSectionIteratorRef>
40  (const_cast<section_iterator*>(SI));
41 }
42 
43 inline symbol_iterator *unwrap(LLVMSymbolIteratorRef SI) {
44  return reinterpret_cast<symbol_iterator*>(SI);
45 }
46 
48 wrap(const symbol_iterator *SI) {
49  return reinterpret_cast<LLVMSymbolIteratorRef>
50  (const_cast<symbol_iterator*>(SI));
51 }
52 
54  return reinterpret_cast<relocation_iterator*>(SI);
55 }
56 
59  return reinterpret_cast<LLVMRelocationIteratorRef>
60  (const_cast<relocation_iterator*>(SI));
61 }
62 
63 /*--.. Operations on binary files ..........................................--*/
64 
67  char **ErrorMessage) {
68  auto maybeContext = Context ? unwrap(Context) : nullptr;
70  createBinary(unwrap(MemBuf)->getMemBufferRef(), maybeContext));
71  if (!ObjOrErr) {
72  *ErrorMessage = strdup(toString(ObjOrErr.takeError()).c_str());
73  return nullptr;
74  }
75 
76  return wrap(ObjOrErr.get().release());
77 }
78 
80  auto Buf = unwrap(BR)->getMemoryBufferRef();
82  Buf.getBuffer(), Buf.getBufferIdentifier(),
83  /*RequiresNullTerminator*/false).release());
84 }
85 
87  delete unwrap(BR);
88 }
89 
91  class BinaryTypeMapper final : public Binary {
92  public:
93  static LLVMBinaryType mapBinaryTypeToLLVMBinaryType(unsigned Kind) {
94  switch (Kind) {
95  case ID_Archive:
96  return LLVMBinaryTypeArchive;
97  case ID_MachOUniversalBinary:
99  case ID_COFFImportFile:
101  case ID_IR:
102  return LLVMBinaryTypeIR;
103  case ID_WinRes:
104  return LLVMBinaryTypeWinRes;
105  case ID_COFF:
106  return LLVMBinaryTypeCOFF;
107  case ID_ELF32L:
108  return LLVMBinaryTypeELF32L;
109  case ID_ELF32B:
110  return LLVMBinaryTypeELF32B;
111  case ID_ELF64L:
112  return LLVMBinaryTypeELF64L;
113  case ID_ELF64B:
114  return LLVMBinaryTypeELF64B;
115  case ID_MachO32L:
116  return LLVMBinaryTypeMachO32L;
117  case ID_MachO32B:
118  return LLVMBinaryTypeMachO32B;
119  case ID_MachO64L:
120  return LLVMBinaryTypeMachO64L;
121  case ID_MachO64B:
122  return LLVMBinaryTypeMachO64B;
123  case ID_Offload:
124  return LLVMBinaryTypeOffload;
125  case ID_Wasm:
126  return LLVMBinaryTypeWasm;
127  case ID_StartObjects:
128  case ID_EndObjects:
129  llvm_unreachable("Marker types are not valid binary kinds!");
130  default:
131  llvm_unreachable("Unknown binary kind!");
132  }
133  }
134  };
135  return BinaryTypeMapper::mapBinaryTypeToLLVMBinaryType(unwrap(BR)->getType());
136 }
137 
139  const char *Arch,
140  size_t ArchLen,
141  char **ErrorMessage) {
142  auto universal = cast<MachOUniversalBinary>(unwrap(BR));
144  universal->getMachOObjectForArch({Arch, ArchLen}));
145  if (!ObjOrErr) {
146  *ErrorMessage = strdup(toString(ObjOrErr.takeError()).c_str());
147  return nullptr;
148  }
149  return wrap(ObjOrErr.get().release());
150 }
151 
153  auto OF = cast<ObjectFile>(unwrap(BR));
154  auto sections = OF->sections();
155  if (sections.begin() == sections.end())
156  return nullptr;
157  return wrap(new section_iterator(sections.begin()));
158 }
159 
162  auto OF = cast<ObjectFile>(unwrap(BR));
163  return (*unwrap(SI) == OF->section_end()) ? 1 : 0;
164 }
165 
167  auto OF = cast<ObjectFile>(unwrap(BR));
168  auto symbols = OF->symbols();
169  if (symbols.begin() == symbols.end())
170  return nullptr;
171  return wrap(new symbol_iterator(symbols.begin()));
172 }
173 
176  auto OF = cast<ObjectFile>(unwrap(BR));
177  return (*unwrap(SI) == OF->symbol_end()) ? 1 : 0;
178 }
179 
180 // ObjectFile creation
182  std::unique_ptr<MemoryBuffer> Buf(unwrap(MemBuf));
184  ObjectFile::createObjectFile(Buf->getMemBufferRef()));
185  std::unique_ptr<ObjectFile> Obj;
186  if (!ObjOrErr) {
187  // TODO: Actually report errors helpfully.
188  consumeError(ObjOrErr.takeError());
189  return nullptr;
190  }
191 
192  auto *Ret = new OwningBinary<ObjectFile>(std::move(ObjOrErr.get()), std::move(Buf));
193  return wrap(Ret);
194 }
195 
197  delete unwrap(ObjectFile);
198 }
199 
200 // ObjectFile Section iterators
202  OwningBinary<ObjectFile> *OB = unwrap(OF);
203  section_iterator SI = OB->getBinary()->section_begin();
204  return wrap(new section_iterator(SI));
205 }
206 
208  delete unwrap(SI);
209 }
210 
213  OwningBinary<ObjectFile> *OB = unwrap(OF);
214  return (*unwrap(SI) == OB->getBinary()->section_end()) ? 1 : 0;
215 }
216 
218  ++(*unwrap(SI));
219 }
220 
222  LLVMSymbolIteratorRef Sym) {
223  Expected<section_iterator> SecOrErr = (*unwrap(Sym))->getSection();
224  if (!SecOrErr) {
225  std::string Buf;
226  raw_string_ostream OS(Buf);
227  logAllUnhandledErrors(SecOrErr.takeError(), OS);
229  }
230  *unwrap(Sect) = *SecOrErr;
231 }
232 
233 // ObjectFile Symbol iterators
235  OwningBinary<ObjectFile> *OB = unwrap(OF);
236  symbol_iterator SI = OB->getBinary()->symbol_begin();
237  return wrap(new symbol_iterator(SI));
238 }
239 
241  delete unwrap(SI);
242 }
243 
246  OwningBinary<ObjectFile> *OB = unwrap(OF);
247  return (*unwrap(SI) == OB->getBinary()->symbol_end()) ? 1 : 0;
248 }
249 
251  ++(*unwrap(SI));
252 }
253 
254 // SectionRef accessors
256  auto NameOrErr = (*unwrap(SI))->getName();
257  if (!NameOrErr)
258  report_fatal_error(NameOrErr.takeError());
259  return NameOrErr->data();
260 }
261 
263  return (*unwrap(SI))->getSize();
264 }
265 
267  if (Expected<StringRef> E = (*unwrap(SI))->getContents())
268  return E->data();
269  else
270  report_fatal_error(E.takeError());
271 }
272 
274  return (*unwrap(SI))->getAddress();
275 }
276 
278  LLVMSymbolIteratorRef Sym) {
279  return (*unwrap(SI))->containsSymbol(**unwrap(Sym));
280 }
281 
282 // Section Relocation iterators
284  relocation_iterator SI = (*unwrap(Section))->relocation_begin();
285  return wrap(new relocation_iterator(SI));
286 }
287 
289  delete unwrap(SI);
290 }
291 
294  return (*unwrap(SI) == (*unwrap(Section))->relocation_end()) ? 1 : 0;
295 }
296 
298  ++(*unwrap(SI));
299 }
300 
301 
302 // SymbolRef accessors
305  if (!Ret) {
306  std::string Buf;
307  raw_string_ostream OS(Buf);
308  logAllUnhandledErrors(Ret.takeError(), OS);
310  }
311  return Ret->data();
312 }
313 
315  Expected<uint64_t> Ret = (*unwrap(SI))->getAddress();
316  if (!Ret) {
317  std::string Buf;
318  raw_string_ostream OS(Buf);
319  logAllUnhandledErrors(Ret.takeError(), OS);
321  }
322  return *Ret;
323 }
324 
326  return (*unwrap(SI))->getCommonSize();
327 }
328 
329 // RelocationRef accessors
331  return (*unwrap(RI))->getOffset();
332 }
333 
335  symbol_iterator ret = (*unwrap(RI))->getSymbol();
336  return wrap(new symbol_iterator(ret));
337 }
338 
340  return (*unwrap(RI))->getType();
341 }
342 
343 // NOTE: Caller takes ownership of returned string.
346  (*unwrap(RI))->getTypeName(ret);
347  char *str = static_cast<char*>(safe_malloc(ret.size()));
348  llvm::copy(ret, str);
349  return str;
350 }
351 
352 // NOTE: Caller takes ownership of returned string.
354  return strdup("");
355 }
356 
LLVMGetSectionContainsSymbol
LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym)
Definition: Object.cpp:277
getName
static StringRef getName(Value *V)
Definition: ProvenanceAnalysisEvaluator.cpp:42
llvm::object::Kind
Kind
Definition: COFFModuleDefinition.cpp:31
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
LLVMContextRef
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
Definition: Types.h:53
LLVMGetRelocationOffset
uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:330
LLVMCreateObjectFile
LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf)
Deprecated: Use LLVMCreateBinary instead.
Definition: Object.cpp:181
LLVMMoveToNextSection
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI)
Definition: Object.cpp:217
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
LLVMBinaryTypeOffload
@ LLVMBinaryTypeOffload
Offloading fatbinary.
Definition: Object.h:56
llvm::SmallVector< char, 0 >
LLVMIsSymbolIteratorAtEnd
LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef OF, LLVMSymbolIteratorRef SI)
Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead.
Definition: Object.cpp:244
LLVMGetSymbolSize
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:325
LLVMDisposeSectionIterator
void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI)
Definition: Object.cpp:207
llvm::object::relocation_iterator
content_iterator< RelocationRef > relocation_iterator
Definition: ObjectFile.h:76
llvm::object::getSection
Expected< const typename ELFT::Shdr * > getSection(typename ELFT::ShdrRange Sections, uint32_t Index)
Definition: ELF.h:401
llvm::copy
OutputIt copy(R &&Range, OutputIt Out)
Definition: STLExtras.h:1668
ret
to esp esp setne al movzbw ax esp setg cl movzbw cx cmove cx cl jne LBB1_2 esp ret(also really horrible code on ppc). This is due to the expand code for 64-bit compares. GCC produces multiple branches
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:119
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
LLVMDisposeBinary
void LLVMDisposeBinary(LLVMBinaryRef BR)
Dispose of a binary file.
Definition: Object.cpp:86
LLVMIsRelocationIteratorAtEnd
LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, LLVMRelocationIteratorRef SI)
Definition: Object.cpp:292
LLVMBinaryGetType
LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR)
Retrieve the specific type of a binary.
Definition: Object.cpp:90
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1043
LLVMMachOUniversalBinaryCopyObjectForArch
LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR, const char *Arch, size_t ArchLen, char **ErrorMessage)
Definition: Object.cpp:138
LLVMGetSectionAddress
uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI)
Definition: Object.cpp:273
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
LLVMBinaryTypeELF32B
@ LLVMBinaryTypeELF32B
ELF 32-bit, big endian.
Definition: Object.h:48
LLVMBinaryTypeWinRes
@ LLVMBinaryTypeWinRes
Windows resource (.res) file.
Definition: Object.h:45
llvm::Intrinsic::getType
FunctionType * getType(LLVMContext &Context, ID id, ArrayRef< Type * > Tys=None)
Return the function type for an intrinsic.
Definition: Function.cpp:1374
llvm::MemoryBuffer::getMemBuffer
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
Definition: MemoryBuffer.cpp:115
LLVMCreateBinary
LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf, LLVMContextRef Context, char **ErrorMessage)
Create a binary file from the given memory buffer.
Definition: Object.cpp:65
LLVMObjectFileRef
struct LLVMOpaqueObjectFile * LLVMObjectFileRef
Deprecated: Use LLVMBinaryRef instead.
Definition: Object.h:205
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVMBinaryTypeMachO32L
@ LLVMBinaryTypeMachO32L
MachO 32-bit, little endian.
Definition: Object.h:51
LLVMBinaryTypeCOFFImportFile
@ LLVMBinaryTypeCOFFImportFile
COFF Import file.
Definition: Object.h:43
LLVMMoveToNextRelocation
void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef SI)
Definition: Object.cpp:297
MachOUniversal.h
LLVMBinaryTypeELF32L
@ LLVMBinaryTypeELF32L
ELF 32-bit, little endian.
Definition: Object.h:47
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:280
llvm::report_fatal_error
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:143
LLVMMoveToContainingSection
void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect, LLVMSymbolIteratorRef Sym)
Definition: Object.cpp:221
LLVMGetSectionContents
const char * LLVMGetSectionContents(LLVMSectionIteratorRef SI)
Definition: Object.cpp:266
LLVMSectionIteratorRef
struct LLVMOpaqueSectionIterator * LLVMSectionIteratorRef
Definition: Object.h:36
MemAlloc.h
LLVMDisposeRelocationIterator
void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI)
Definition: Object.cpp:288
LLVMSymbolIteratorRef
struct LLVMOpaqueSymbolIterator * LLVMSymbolIteratorRef
Definition: Object.h:37
object
bar al al movzbl eax ret Missed when stored in a memory object
Definition: README.txt:1411
uint64_t
LLVMObjectFileCopySymbolIterator
LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR)
Retrieve a copy of the symbol iterator for this object file.
Definition: Object.cpp:166
LLVMDisposeSymbolIterator
void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:240
LLVMBinaryTypeMachO64L
@ LLVMBinaryTypeMachO64L
MachO 64-bit, little endian.
Definition: Object.h:53
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
symbols
Itanium Name Demangler i e convert the string _Z1fv into and both[sub] projects need to demangle symbols
Definition: README.txt:20
LLVMGetSymbolName
const char * LLVMGetSymbolName(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:303
LLVMGetSymbols
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef OF)
Deprecated: Use LLVMObjectFileCopySymbolIterator instead.
Definition: Object.cpp:234
LLVMIsSectionIteratorAtEnd
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef OF, LLVMSectionIteratorRef SI)
Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead.
Definition: Object.cpp:211
llvm::object::ObjectFile::createObjectFile
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Definition: ObjectFile.cpp:188
LLVMGetSectionSize
uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI)
Definition: Object.cpp:262
ObjectFile.h
LLVMGetSections
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef OF)
Deprecated: Use LLVMObjectFileCopySectionIterator instead.
Definition: Object.cpp:201
SI
StandardInstrumentations SI(Debug, VerifyEach)
LLVMObjectFileIsSymbolIteratorAtEnd
LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR, LLVMSymbolIteratorRef SI)
Returns whether the given symbol iterator is at the end.
Definition: Object.cpp:174
Object.h
LLVMGetRelocations
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section)
Definition: Object.cpp:283
LLVMBinaryRef
struct LLVMOpaqueBinary * LLVMBinaryRef
Definition: Types.h:168
LLVMBinaryType
LLVMBinaryType
Definition: Object.h:40
LLVMBinaryTypeCOFF
@ LLVMBinaryTypeCOFF
COFF Object file.
Definition: Object.h:46
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition: Attributes.h:275
LLVMGetRelocationSymbol
LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:334
llvm::object::section_iterator
content_iterator< SectionRef > section_iterator
Definition: ObjectFile.h:47
llvm::getTypeName
StringRef getTypeName()
We provide a function which tries to compute the (demangled) name of a type statically.
Definition: TypeName.h:27
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::Expected::get
reference get()
Returns a reference to the stored T value.
Definition: Error.h:567
LLVMBinaryTypeMachO32B
@ LLVMBinaryTypeMachO32B
MachO 32-bit, big endian.
Definition: Object.h:52
LLVMBinaryTypeELF64B
@ LLVMBinaryTypeELF64B
ELF 64-bit, big endian.
Definition: Object.h:50
llvm::logAllUnhandledErrors
void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner={})
Log all errors (if any) in E to OS.
Definition: Error.cpp:61
LLVMRelocationIteratorRef
struct LLVMOpaqueRelocationIterator * LLVMRelocationIteratorRef
Definition: Object.h:38
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
LLVMBool
int LLVMBool
Definition: Types.h:28
llvm::toString
const char * toString(DWARFSectionKind Kind)
Definition: DWARFUnitIndex.h:67
llvm::ISD::BR
@ BR
Control flow instructions. These all have token chains.
Definition: ISDOpcodes.h:982
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
LLVMDisposeObjectFile
void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile)
Deprecated: Use LLVMDisposeBinary instead.
Definition: Object.cpp:196
LLVMGetRelocationValueString
const char * LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:353
LLVMObjectFileCopySectionIterator
LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR)
Retrieve a copy of the section iterator for this object file.
Definition: Object.cpp:152
LLVMBinaryTypeArchive
@ LLVMBinaryTypeArchive
Archive file.
Definition: Object.h:41
LLVMGetSectionName
const char * LLVMGetSectionName(LLVMSectionIteratorRef SI)
Definition: Object.cpp:255
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:597
LLVMBinaryCopyMemoryBuffer
LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR)
Retrieves a copy of the memory buffer associated with this object file.
Definition: Object.cpp:79
LLVMGetRelocationType
uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:339
LLVMBinaryTypeELF64L
@ LLVMBinaryTypeELF64L
ELF 64-bit, little endian.
Definition: Object.h:49
SmallVector.h
LLVMGetSymbolAddress
uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:314
LLVMObjectFileIsSectionIteratorAtEnd
LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, LLVMSectionIteratorRef SI)
Returns whether the given section iterator is at the end.
Definition: Object.cpp:160
llvm::object::createBinary
Expected< std::unique_ptr< Binary > > createBinary(MemoryBufferRef Source, LLVMContext *Context=nullptr, bool InitContent=true)
Create a Binary from Source, autodetecting the file type.
Definition: Binary.cpp:45
LLVMMemoryBufferRef
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
LLVM uses a polymorphic type hierarchy which C cannot represent, therefore parameters must be passed ...
Definition: Types.h:48
LLVMGetRelocationTypeName
const char * LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:344
LLVMBinaryTypeIR
@ LLVMBinaryTypeIR
LLVM IR.
Definition: Object.h:44
LLVMContext.h
LLVMBinaryTypeMachOUniversalBinary
@ LLVMBinaryTypeMachOUniversalBinary
Mach-O Universal Binary file.
Definition: Object.h:42
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:650
LLVMBinaryTypeMachO64B
@ LLVMBinaryTypeMachO64B
MachO 64-bit, big endian.
Definition: Object.h:54
llvm::safe_malloc
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
Definition: MemAlloc.h:25
LLVMBinaryTypeWasm
@ LLVMBinaryTypeWasm
Web Assembly.
Definition: Object.h:55
LLVMMoveToNextSymbol
void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:250