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_Wasm:
124  return LLVMBinaryTypeWasm;
125  case ID_StartObjects:
126  case ID_EndObjects:
127  llvm_unreachable("Marker types are not valid binary kinds!");
128  default:
129  llvm_unreachable("Unknown binary kind!");
130  }
131  }
132  };
133  return BinaryTypeMapper::mapBinaryTypeToLLVMBinaryType(unwrap(BR)->getType());
134 }
135 
137  const char *Arch,
138  size_t ArchLen,
139  char **ErrorMessage) {
140  auto universal = cast<MachOUniversalBinary>(unwrap(BR));
142  universal->getMachOObjectForArch({Arch, ArchLen}));
143  if (!ObjOrErr) {
144  *ErrorMessage = strdup(toString(ObjOrErr.takeError()).c_str());
145  return nullptr;
146  }
147  return wrap(ObjOrErr.get().release());
148 }
149 
151  auto OF = cast<ObjectFile>(unwrap(BR));
152  auto sections = OF->sections();
153  if (sections.begin() == sections.end())
154  return nullptr;
155  return wrap(new section_iterator(sections.begin()));
156 }
157 
160  auto OF = cast<ObjectFile>(unwrap(BR));
161  return (*unwrap(SI) == OF->section_end()) ? 1 : 0;
162 }
163 
165  auto OF = cast<ObjectFile>(unwrap(BR));
166  auto symbols = OF->symbols();
167  if (symbols.begin() == symbols.end())
168  return nullptr;
169  return wrap(new symbol_iterator(symbols.begin()));
170 }
171 
174  auto OF = cast<ObjectFile>(unwrap(BR));
175  return (*unwrap(SI) == OF->symbol_end()) ? 1 : 0;
176 }
177 
178 // ObjectFile creation
180  std::unique_ptr<MemoryBuffer> Buf(unwrap(MemBuf));
182  ObjectFile::createObjectFile(Buf->getMemBufferRef()));
183  std::unique_ptr<ObjectFile> Obj;
184  if (!ObjOrErr) {
185  // TODO: Actually report errors helpfully.
186  consumeError(ObjOrErr.takeError());
187  return nullptr;
188  }
189 
190  auto *Ret = new OwningBinary<ObjectFile>(std::move(ObjOrErr.get()), std::move(Buf));
191  return wrap(Ret);
192 }
193 
195  delete unwrap(ObjectFile);
196 }
197 
198 // ObjectFile Section iterators
200  OwningBinary<ObjectFile> *OB = unwrap(OF);
201  section_iterator SI = OB->getBinary()->section_begin();
202  return wrap(new section_iterator(SI));
203 }
204 
206  delete unwrap(SI);
207 }
208 
211  OwningBinary<ObjectFile> *OB = unwrap(OF);
212  return (*unwrap(SI) == OB->getBinary()->section_end()) ? 1 : 0;
213 }
214 
216  ++(*unwrap(SI));
217 }
218 
220  LLVMSymbolIteratorRef Sym) {
221  Expected<section_iterator> SecOrErr = (*unwrap(Sym))->getSection();
222  if (!SecOrErr) {
223  std::string Buf;
224  raw_string_ostream OS(Buf);
225  logAllUnhandledErrors(SecOrErr.takeError(), OS);
227  }
228  *unwrap(Sect) = *SecOrErr;
229 }
230 
231 // ObjectFile Symbol iterators
233  OwningBinary<ObjectFile> *OB = unwrap(OF);
234  symbol_iterator SI = OB->getBinary()->symbol_begin();
235  return wrap(new symbol_iterator(SI));
236 }
237 
239  delete unwrap(SI);
240 }
241 
244  OwningBinary<ObjectFile> *OB = unwrap(OF);
245  return (*unwrap(SI) == OB->getBinary()->symbol_end()) ? 1 : 0;
246 }
247 
249  ++(*unwrap(SI));
250 }
251 
252 // SectionRef accessors
254  auto NameOrErr = (*unwrap(SI))->getName();
255  if (!NameOrErr)
256  report_fatal_error(NameOrErr.takeError());
257  return NameOrErr->data();
258 }
259 
261  return (*unwrap(SI))->getSize();
262 }
263 
265  if (Expected<StringRef> E = (*unwrap(SI))->getContents())
266  return E->data();
267  else
268  report_fatal_error(E.takeError());
269 }
270 
272  return (*unwrap(SI))->getAddress();
273 }
274 
276  LLVMSymbolIteratorRef Sym) {
277  return (*unwrap(SI))->containsSymbol(**unwrap(Sym));
278 }
279 
280 // Section Relocation iterators
282  relocation_iterator SI = (*unwrap(Section))->relocation_begin();
283  return wrap(new relocation_iterator(SI));
284 }
285 
287  delete unwrap(SI);
288 }
289 
292  return (*unwrap(SI) == (*unwrap(Section))->relocation_end()) ? 1 : 0;
293 }
294 
296  ++(*unwrap(SI));
297 }
298 
299 
300 // SymbolRef accessors
303  if (!Ret) {
304  std::string Buf;
305  raw_string_ostream OS(Buf);
306  logAllUnhandledErrors(Ret.takeError(), OS);
308  }
309  return Ret->data();
310 }
311 
313  Expected<uint64_t> Ret = (*unwrap(SI))->getAddress();
314  if (!Ret) {
315  std::string Buf;
316  raw_string_ostream OS(Buf);
317  logAllUnhandledErrors(Ret.takeError(), OS);
319  }
320  return *Ret;
321 }
322 
324  return (*unwrap(SI))->getCommonSize();
325 }
326 
327 // RelocationRef accessors
329  return (*unwrap(RI))->getOffset();
330 }
331 
333  symbol_iterator ret = (*unwrap(RI))->getSymbol();
334  return wrap(new symbol_iterator(ret));
335 }
336 
338  return (*unwrap(RI))->getType();
339 }
340 
341 // NOTE: Caller takes ownership of returned string.
344  (*unwrap(RI))->getTypeName(ret);
345  char *str = static_cast<char*>(safe_malloc(ret.size()));
346  llvm::copy(ret, str);
347  return str;
348 }
349 
350 // NOTE: Caller takes ownership of returned string.
352  return strdup("");
353 }
354 
LLVMGetSectionContainsSymbol
LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym)
Definition: Object.cpp:275
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:328
LLVMCreateObjectFile
LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf)
Deprecated: Use LLVMCreateBinary instead.
Definition: Object.cpp:179
LLVMMoveToNextSection
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI)
Definition: Object.cpp:215
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
llvm::SmallVector< char, 0 >
LLVMIsSymbolIteratorAtEnd
LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef OF, LLVMSymbolIteratorRef SI)
Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead.
Definition: Object.cpp:242
LLVMGetSymbolSize
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:323
LLVMDisposeSectionIterator
void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI)
Definition: Object.cpp:205
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:1658
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:290
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:136
LLVMGetSectionAddress
uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI)
Definition: Object.cpp:271
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:1366
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:203
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:295
MachOUniversal.h
LLVMBinaryTypeELF32L
@ LLVMBinaryTypeELF32L
ELF 32-bit, little endian.
Definition: Object.h:47
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:264
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:219
LLVMGetSectionContents
const char * LLVMGetSectionContents(LLVMSectionIteratorRef SI)
Definition: Object.cpp:264
LLVMSectionIteratorRef
struct LLVMOpaqueSectionIterator * LLVMSectionIteratorRef
Definition: Object.h:36
MemAlloc.h
LLVMDisposeRelocationIterator
void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI)
Definition: Object.cpp:286
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:164
LLVMDisposeSymbolIterator
void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:238
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:301
LLVMGetSymbols
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef OF)
Deprecated: Use LLVMObjectFileCopySymbolIterator instead.
Definition: Object.cpp:232
LLVMIsSectionIteratorAtEnd
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef OF, LLVMSectionIteratorRef SI)
Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead.
Definition: Object.cpp:209
llvm::object::ObjectFile::createObjectFile
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Definition: ObjectFile.cpp:187
LLVMGetSectionSize
uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI)
Definition: Object.cpp:260
ObjectFile.h
LLVMGetSections
LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef OF)
Deprecated: Use LLVMObjectFileCopySectionIterator instead.
Definition: Object.cpp:199
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:172
Object.h
LLVMGetRelocations
LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section)
Definition: Object.cpp:281
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:259
LLVMGetRelocationSymbol
LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:332
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:975
llvm::X86II::OB
@ OB
Definition: X86BaseInfo.h:801
LLVMDisposeObjectFile
void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile)
Deprecated: Use LLVMDisposeBinary instead.
Definition: Object.cpp:194
LLVMGetRelocationValueString
const char * LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI)
Definition: Object.cpp:351
LLVMObjectFileCopySectionIterator
LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR)
Retrieve a copy of the section iterator for this object file.
Definition: Object.cpp:150
LLVMBinaryTypeArchive
@ LLVMBinaryTypeArchive
Archive file.
Definition: Object.h:41
LLVMGetSectionName
const char * LLVMGetSectionName(LLVMSectionIteratorRef SI)
Definition: Object.cpp:253
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:337
LLVMBinaryTypeELF64L
@ LLVMBinaryTypeELF64L
ELF 64-bit, little endian.
Definition: Object.h:49
SmallVector.h
LLVMGetSymbolAddress
uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI)
Definition: Object.cpp:312
LLVMObjectFileIsSectionIteratorAtEnd
LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR, LLVMSectionIteratorRef SI)
Returns whether the given section iterator is at the end.
Definition: Object.cpp:158
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:44
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:342
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:248