Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
ObjectFile.h
Go to the documentation of this file.
1//===- ObjectFile.h - File format independent object file -------*- 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 declares a file format independent ObjectFile class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_OBJECT_OBJECTFILE_H
14#define LLVM_OBJECT_OBJECTFILE_H
15
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/Hashing.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/ADT/iterator_range.h"
20#include "llvm/BinaryFormat/Magic.h"
21#include "llvm/BinaryFormat/Swift.h"
22#include "llvm/Object/Binary.h"
23#include "llvm/Object/Error.h"
24#include "llvm/Object/SymbolicFile.h"
25#include "llvm/Support/Casting.h"
26#include "llvm/Support/Error.h"
27#include "llvm/Support/MemoryBufferRef.h"
28#include "llvm/TargetParser/Triple.h"
29#include <cassert>
30#include <cstdint>
31#include <memory>
32
33namespacellvm {
34
35classSubtargetFeatures;
36
37namespaceobject {
38
39classCOFFObjectFile;
40classMachOObjectFile;
41classObjectFile;
42classSectionRef;
43classSymbolRef;
44classsymbol_iterator;
45classWasmObjectFile;
46
47usingsection_iterator =content_iterator<SectionRef>;
48
49typedef std::function<bool(constSectionRef &)>SectionFilterPredicate;
50/// This is a value type class that represents a single relocation in the list
51/// of relocations in the object file.
52classRelocationRef {
53DataRefImpl RelocationPimpl;
54constObjectFile *OwningObject =nullptr;
55
56public:
57RelocationRef() =default;
58RelocationRef(DataRefImpl RelocationP,constObjectFile *Owner);
59
60booloperator==(constRelocationRef &Other)const;
61
62voidmoveNext();
63
64uint64_tgetOffset()const;
65symbol_iteratorgetSymbol()const;
66uint64_tgetType()const;
67
68 /// Get a string that represents the type of this relocation.
69 ///
70 /// This is for display purposes only.
71voidgetTypeName(SmallVectorImpl<char> &Result)const;
72
73DataRefImplgetRawDataRefImpl()const;
74constObjectFile *getObject()const;
75};
76
77usingrelocation_iterator =content_iterator<RelocationRef>;
78
79/// This is a value type class that represents a single section in the list of
80/// sections in the object file.
81classSectionRef {
82friendclassSymbolRef;
83
84DataRefImpl SectionPimpl;
85constObjectFile *OwningObject =nullptr;
86
87public:
88SectionRef() =default;
89SectionRef(DataRefImpl SectionP,constObjectFile *Owner);
90
91booloperator==(constSectionRef &Other)const;
92booloperator!=(constSectionRef &Other)const;
93booloperator<(constSectionRef &Other)const;
94
95voidmoveNext();
96
97Expected<StringRef>getName()const;
98uint64_tgetAddress()const;
99uint64_tgetIndex()const;
100uint64_tgetSize()const;
101Expected<StringRef>getContents()const;
102
103 /// Get the alignment of this section.
104AligngetAlignment()const;
105
106boolisCompressed()const;
107 /// Whether this section contains instructions.
108boolisText()const;
109 /// Whether this section contains data, not instructions.
110boolisData()const;
111 /// Whether this section contains BSS uninitialized data.
112boolisBSS()const;
113boolisVirtual()const;
114boolisBitcode()const;
115boolisStripped()const;
116
117 /// Whether this section will be placed in the text segment, according to the
118 /// Berkeley size format. This is true if the section is allocatable, and
119 /// contains either code or readonly data.
120boolisBerkeleyText()const;
121 /// Whether this section will be placed in the data segment, according to the
122 /// Berkeley size format. This is true if the section is allocatable and
123 /// contains data (e.g. PROGBITS), but is not text.
124boolisBerkeleyData()const;
125
126 /// Whether this section is a debug section.
127boolisDebugSection()const;
128
129boolcontainsSymbol(SymbolRef S)const;
130
131relocation_iteratorrelocation_begin()const;
132relocation_iteratorrelocation_end()const;
133iterator_range<relocation_iterator>relocations() const{
134returnmake_range(relocation_begin(),relocation_end());
135 }
136
137 /// Returns the related section if this section contains relocations. The
138 /// returned section may or may not have applied its relocations.
139Expected<section_iterator>getRelocatedSection()const;
140
141DataRefImplgetRawDataRefImpl()const;
142constObjectFile *getObject()const;
143};
144
145structSectionedAddress {
146conststaticuint64_tUndefSection =UINT64_MAX;
147
148uint64_tAddress = 0;
149uint64_tSectionIndex =UndefSection;
150};
151
152inlinebooloperator<(constSectionedAddress &LHS,
153constSectionedAddress &RHS) {
154return std::tie(LHS.SectionIndex,LHS.Address) <
155 std::tie(RHS.SectionIndex,RHS.Address);
156}
157
158inlinebooloperator==(constSectionedAddress &LHS,
159constSectionedAddress &RHS) {
160return std::tie(LHS.SectionIndex,LHS.Address) ==
161 std::tie(RHS.SectionIndex,RHS.Address);
162}
163
164raw_ostream &operator<<(raw_ostream &OS,constSectionedAddress &Addr);
165
166/// This is a value type class that represents a single symbol in the list of
167/// symbols in the object file.
168classSymbolRef :publicBasicSymbolRef {
169friendclassSectionRef;
170
171public:
172enumType {
173ST_Unknown,// Type not specified
174ST_Other,
175ST_Data,
176ST_Debug,
177ST_File,
178ST_Function,
179 };
180
181SymbolRef() =default;
182SymbolRef(DataRefImpl SymbolP,constObjectFile *Owner);
183SymbolRef(constBasicSymbolRef &B) :BasicSymbolRef(B) {
184assert(isa<ObjectFile>(BasicSymbolRef::getObject()));
185 }
186
187Expected<StringRef>getName()const;
188 /// Returns the symbol virtual address (i.e. address at which it will be
189 /// mapped).
190Expected<uint64_t>getAddress()const;
191
192 /// Return the value of the symbol depending on the object this can be an
193 /// offset or a virtual address.
194Expected<uint64_t>getValue()const;
195
196 /// Get the alignment of this symbol as the actual value (not log 2).
197uint32_tgetAlignment()const;
198uint64_tgetCommonSize()const;
199Expected<SymbolRef::Type>getType()const;
200
201 /// Get section this symbol is defined in reference to. Result is
202 /// section_end() if it is undefined or is an absolute symbol.
203Expected<section_iterator>getSection()const;
204
205constObjectFile *getObject()const;
206};
207
208classsymbol_iterator :publicbasic_symbol_iterator {
209public:
210symbol_iterator(SymbolRefSym) :basic_symbol_iterator(Sym) {}
211symbol_iterator(constbasic_symbol_iterator &B)
212 :basic_symbol_iterator(SymbolRef(B->getRawDataRefImpl(),
213cast<ObjectFile>(B->getObject()))) {}
214
215constSymbolRef *operator->() const{
216constBasicSymbolRef &P =basic_symbol_iterator::operator *();
217returnstatic_cast<constSymbolRef*>(&P);
218 }
219
220constSymbolRef &operator*() const{
221constBasicSymbolRef &P =basic_symbol_iterator::operator *();
222returnstatic_cast<constSymbolRef&>(P);
223 }
224};
225
226/// This class is the base class for all object file types. Concrete instances
227/// of this object are created by createObjectFile, which figures out which type
228/// to create.
229classObjectFile :publicSymbolicFile {
230virtualvoid anchor();
231
232protected:
233ObjectFile(unsignedintType,MemoryBufferRef Source);
234
235constuint8_t *base() const{
236returnreinterpret_cast<constuint8_t *>(Data.getBufferStart());
237 }
238
239// These functions are for SymbolRef to call internally. The main goal of
240// this is to allow SymbolRef::SymbolPimpl to point directly to the symbol
241// entry in the memory mapped object file. SymbolPimpl cannot contain any
242// virtual functions because then it could not point into the memory mapped
243// file.
244//
245// Implementations assume that the DataRefImpl is valid and has not been
246// modified externally. It's UB otherwise.
247friendclassSymbolRef;
248
249virtualExpected<StringRef>getSymbolName(DataRefImpl Symb)const = 0;
250ErrorprintSymbolName(raw_ostream &OS,
251DataRefImpl Symb)const override;
252virtualExpected<uint64_t>getSymbolAddress(DataRefImpl Symb)const = 0;
253virtualuint64_tgetSymbolValueImpl(DataRefImpl Symb)const = 0;
254virtualuint32_tgetSymbolAlignment(DataRefImpl Symb)const;
255virtualuint64_tgetCommonSymbolSizeImpl(DataRefImpl Symb)const = 0;
256virtualExpected<SymbolRef::Type>getSymbolType(DataRefImpl Symb)const = 0;
257virtualExpected<section_iterator>
258getSymbolSection(DataRefImpl Symb)const = 0;
259
260// Same as above for SectionRef.
261friendclassSectionRef;
262
263virtualvoidmoveSectionNext(DataRefImpl &Sec)const = 0;
264virtualExpected<StringRef>getSectionName(DataRefImpl Sec)const = 0;
265virtualuint64_tgetSectionAddress(DataRefImpl Sec)const = 0;
266virtualuint64_tgetSectionIndex(DataRefImpl Sec)const = 0;
267virtualuint64_tgetSectionSize(DataRefImpl Sec)const = 0;
268virtualExpected<ArrayRef<uint8_t>>
269getSectionContents(DataRefImpl Sec)const = 0;
270virtualuint64_tgetSectionAlignment(DataRefImpl Sec)const = 0;
271virtualboolisSectionCompressed(DataRefImpl Sec)const = 0;
272virtualboolisSectionText(DataRefImpl Sec)const = 0;
273virtualboolisSectionData(DataRefImpl Sec)const = 0;
274virtualboolisSectionBSS(DataRefImpl Sec)const = 0;
275// A section is 'virtual' if its contents aren't present in the object image.
276virtualboolisSectionVirtual(DataRefImpl Sec)const = 0;
277virtualboolisSectionBitcode(DataRefImpl Sec)const;
278virtualboolisSectionStripped(DataRefImpl Sec)const;
279virtualboolisBerkeleyText(DataRefImpl Sec)const;
280virtualboolisBerkeleyData(DataRefImpl Sec)const;
281virtualboolisDebugSection(DataRefImpl Sec)const;
282virtualrelocation_iteratorsection_rel_begin(DataRefImpl Sec)const = 0;
283virtualrelocation_iteratorsection_rel_end(DataRefImpl Sec)const = 0;
284virtualExpected<section_iterator>getRelocatedSection(DataRefImpl Sec)const;
285
286// Same as above for RelocationRef.
287friendclassRelocationRef;
288virtualvoidmoveRelocationNext(DataRefImpl &Rel)const = 0;
289virtualuint64_tgetRelocationOffset(DataRefImpl Rel)const = 0;
290virtualsymbol_iteratorgetRelocationSymbol(DataRefImpl Rel)const = 0;
291virtualuint64_tgetRelocationType(DataRefImpl Rel)const = 0;
292virtualvoidgetRelocationTypeName(DataRefImpl Rel,
293SmallVectorImpl<char> &Result)const = 0;
294
295virtualllvm::binaryformat::Swift5ReflectionSectionKind
296mapReflectionSectionNameToEnumValue(StringRefSectionName) const{
297returnllvm::binaryformat::Swift5ReflectionSectionKind::unknown;
298 };
299
300Expected<uint64_t>getSymbolValue(DataRefImpl Symb)const;
301
302public:
303ObjectFile() =delete;
304ObjectFile(constObjectFile &other) =delete;
305ObjectFile &operator=(constObjectFile &other) =delete;
306
307uint64_tgetCommonSymbolSize(DataRefImpl Symb) const{
308Expected<uint32_t> SymbolFlagsOrErr =getSymbolFlags(Symb);
309if (!SymbolFlagsOrErr)
310// TODO: Actually report errors helpfully.
311report_fatal_error(SymbolFlagsOrErr.takeError());
312assert(*SymbolFlagsOrErr &SymbolRef::SF_Common);
313returngetCommonSymbolSizeImpl(Symb);
314 }
315
316virtual std::vector<SectionRef>dynamic_relocation_sections() const{
317return std::vector<SectionRef>();
318 }
319
320usingsymbol_iterator_range =iterator_range<symbol_iterator>;
321symbol_iterator_rangesymbols() const{
322returnsymbol_iterator_range(symbol_begin(),symbol_end());
323 }
324
325virtualsection_iteratorsection_begin()const = 0;
326virtualsection_iteratorsection_end()const = 0;
327
328usingsection_iterator_range =iterator_range<section_iterator>;
329section_iterator_rangesections() const{
330returnsection_iterator_range(section_begin(),section_end());
331 }
332
333virtualboolhasDebugInfo()const;
334
335 /// The number of bytes used to represent an address in this object
336 /// file format.
337virtualuint8_tgetBytesInAddress()const = 0;
338
339virtualStringRefgetFileFormatName()const = 0;
340virtualTriple::ArchTypegetArch()const = 0;
341virtualTriple::OSTypegetOS() const{returnTriple::UnknownOS; }
342virtualExpected<SubtargetFeatures>getFeatures()const = 0;
343virtual std::optional<StringRef>tryGetCPUName() const{
344return std::nullopt;
345 };
346virtualvoidsetARMSubArch(Triple &TheTriple) const{ }
347virtualExpected<uint64_t>getStartAddress() const{
348returnerrorCodeToError(object_error::parse_failed);
349 };
350
351 /// Create a triple from the data in this object file.
352TriplemakeTriple()const;
353
354 /// Maps a debug section name to a standard DWARF section name.
355virtualStringRefmapDebugSectionName(StringRefName) const{returnName; }
356
357 /// True if this is a relocatable object (.o/.obj).
358virtualboolisRelocatableObject()const = 0;
359
360 /// True if the reflection section can be stripped by the linker.
361boolisReflectionSectionStrippable(
362llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind)
363const;
364
365 /// @returns Pointer to ObjectFile subclass to handle this type of object.
366 /// @param ObjectPath The path to the object file. ObjectPath.isObject must
367 /// return true.
368 /// Create ObjectFile from path.
369staticExpected<OwningBinary<ObjectFile>>
370createObjectFile(StringRef ObjectPath);
371
372staticExpected<std::unique_ptr<ObjectFile>>
373createObjectFile(MemoryBufferRef Object,llvm::file_magicType,
374bool InitContent =true);
375staticExpected<std::unique_ptr<ObjectFile>>
376createObjectFile(MemoryBufferRef Object) {
377returncreateObjectFile(Object,llvm::file_magic::unknown);
378 }
379
380staticboolclassof(constBinary *v) {
381return v->isObject();
382 }
383
384staticExpected<std::unique_ptr<COFFObjectFile>>
385createCOFFObjectFile(MemoryBufferRef Object);
386
387staticExpected<std::unique_ptr<ObjectFile>>
388createXCOFFObjectFile(MemoryBufferRef Object,unsigned FileType);
389
390staticExpected<std::unique_ptr<ObjectFile>>
391createELFObjectFile(MemoryBufferRef Object,bool InitContent =true);
392
393staticExpected<std::unique_ptr<MachOObjectFile>>
394createMachOObjectFile(MemoryBufferRef Object,uint32_t UniversalCputype = 0,
395uint32_t UniversalIndex = 0,
396size_t MachOFilesetEntryOffset = 0);
397
398staticExpected<std::unique_ptr<ObjectFile>>
399createGOFFObjectFile(MemoryBufferRef Object);
400
401staticExpected<std::unique_ptr<WasmObjectFile>>
402createWasmObjectFile(MemoryBufferRef Object);
403};
404
405/// A filtered iterator for SectionRefs that skips sections based on some given
406/// predicate.
407classSectionFilterIterator {
408public:
409SectionFilterIterator(SectionFilterPredicate Pred,
410constsection_iterator &Begin,
411constsection_iterator &End)
412 :Predicate(std::move(Pred)), Iterator(Begin),End(End) {
413 scanPredicate();
414 }
415constSectionRef &operator*() const{return *Iterator; }
416SectionFilterIterator &operator++() {
417 ++Iterator;
418 scanPredicate();
419return *this;
420 }
421booloperator!=(constSectionFilterIterator &Other) const{
422return Iterator !=Other.Iterator;
423 }
424
425private:
426void scanPredicate() {
427while (Iterator != End && !Predicate(*Iterator)) {
428 ++Iterator;
429 }
430 }
431SectionFilterPredicatePredicate;
432section_iterator Iterator;
433section_iterator End;
434};
435
436/// Creates an iterator range of SectionFilterIterators for a given Object and
437/// predicate.
438classSectionFilter {
439public:
440SectionFilter(SectionFilterPredicate Pred,constObjectFile &Obj)
441 :Predicate(std::move(Pred)), Object(Obj) {}
442SectionFilterIteratorbegin() {
443returnSectionFilterIterator(Predicate, Object.section_begin(),
444 Object.section_end());
445 }
446SectionFilterIteratorend() {
447returnSectionFilterIterator(Predicate, Object.section_end(),
448 Object.section_end());
449 }
450
451private:
452SectionFilterPredicatePredicate;
453constObjectFile &Object;
454};
455
456// Inline function definitions.
457inlineSymbolRef::SymbolRef(DataRefImpl SymbolP,constObjectFile *Owner)
458 :BasicSymbolRef(SymbolP, Owner) {}
459
460inlineExpected<StringRef>SymbolRef::getName() const{
461returngetObject()->getSymbolName(getRawDataRefImpl());
462}
463
464inlineExpected<uint64_t>SymbolRef::getAddress() const{
465returngetObject()->getSymbolAddress(getRawDataRefImpl());
466}
467
468inlineExpected<uint64_t>SymbolRef::getValue() const{
469returngetObject()->getSymbolValue(getRawDataRefImpl());
470}
471
472inlineuint32_tSymbolRef::getAlignment() const{
473returngetObject()->getSymbolAlignment(getRawDataRefImpl());
474}
475
476inlineuint64_tSymbolRef::getCommonSize() const{
477returngetObject()->getCommonSymbolSize(getRawDataRefImpl());
478}
479
480inlineExpected<section_iterator>SymbolRef::getSection() const{
481returngetObject()->getSymbolSection(getRawDataRefImpl());
482}
483
484inlineExpected<SymbolRef::Type>SymbolRef::getType() const{
485returngetObject()->getSymbolType(getRawDataRefImpl());
486}
487
488inlineconstObjectFile *SymbolRef::getObject() const{
489constSymbolicFile *O =BasicSymbolRef::getObject();
490return cast<ObjectFile>(O);
491}
492
493/// SectionRef
494inlineSectionRef::SectionRef(DataRefImpl SectionP,
495constObjectFile *Owner)
496 : SectionPimpl(SectionP)
497 , OwningObject(Owner) {}
498
499inlineboolSectionRef::operator==(constSectionRef &Other) const{
500return OwningObject ==Other.OwningObject &&
501 SectionPimpl ==Other.SectionPimpl;
502}
503
504inlineboolSectionRef::operator!=(constSectionRef &Other) const{
505return !(*this ==Other);
506}
507
508inlineboolSectionRef::operator<(constSectionRef &Other) const{
509assert(OwningObject ==Other.OwningObject);
510return SectionPimpl <Other.SectionPimpl;
511}
512
513inlinevoidSectionRef::moveNext() {
514return OwningObject->moveSectionNext(SectionPimpl);
515}
516
517inlineExpected<StringRef>SectionRef::getName() const{
518return OwningObject->getSectionName(SectionPimpl);
519}
520
521inlineuint64_tSectionRef::getAddress() const{
522return OwningObject->getSectionAddress(SectionPimpl);
523}
524
525inlineuint64_tSectionRef::getIndex() const{
526return OwningObject->getSectionIndex(SectionPimpl);
527}
528
529inlineuint64_tSectionRef::getSize() const{
530return OwningObject->getSectionSize(SectionPimpl);
531}
532
533inlineExpected<StringRef>SectionRef::getContents() const{
534Expected<ArrayRef<uint8_t>> Res =
535 OwningObject->getSectionContents(SectionPimpl);
536if (!Res)
537return Res.takeError();
538returnStringRef(reinterpret_cast<constchar *>(Res->data()), Res->size());
539}
540
541inlineAlignSectionRef::getAlignment() const{
542returnMaybeAlign(OwningObject->getSectionAlignment(SectionPimpl))
543 .valueOrOne();
544}
545
546inlineboolSectionRef::isCompressed() const{
547return OwningObject->isSectionCompressed(SectionPimpl);
548}
549
550inlineboolSectionRef::isText() const{
551return OwningObject->isSectionText(SectionPimpl);
552}
553
554inlineboolSectionRef::isData() const{
555return OwningObject->isSectionData(SectionPimpl);
556}
557
558inlineboolSectionRef::isBSS() const{
559return OwningObject->isSectionBSS(SectionPimpl);
560}
561
562inlineboolSectionRef::isVirtual() const{
563return OwningObject->isSectionVirtual(SectionPimpl);
564}
565
566inlineboolSectionRef::isBitcode() const{
567return OwningObject->isSectionBitcode(SectionPimpl);
568}
569
570inlineboolSectionRef::isStripped() const{
571return OwningObject->isSectionStripped(SectionPimpl);
572}
573
574inlineboolSectionRef::isBerkeleyText() const{
575return OwningObject->isBerkeleyText(SectionPimpl);
576}
577
578inlineboolSectionRef::isBerkeleyData() const{
579return OwningObject->isBerkeleyData(SectionPimpl);
580}
581
582inlineboolSectionRef::isDebugSection() const{
583return OwningObject->isDebugSection(SectionPimpl);
584}
585
586inlinerelocation_iteratorSectionRef::relocation_begin() const{
587return OwningObject->section_rel_begin(SectionPimpl);
588}
589
590inlinerelocation_iteratorSectionRef::relocation_end() const{
591return OwningObject->section_rel_end(SectionPimpl);
592}
593
594inlineExpected<section_iterator>SectionRef::getRelocatedSection() const{
595return OwningObject->getRelocatedSection(SectionPimpl);
596}
597
598inlineDataRefImplSectionRef::getRawDataRefImpl() const{
599return SectionPimpl;
600}
601
602inlineconstObjectFile *SectionRef::getObject() const{
603return OwningObject;
604}
605
606/// RelocationRef
607inlineRelocationRef::RelocationRef(DataRefImpl RelocationP,
608constObjectFile *Owner)
609 : RelocationPimpl(RelocationP)
610 , OwningObject(Owner) {}
611
612inlineboolRelocationRef::operator==(constRelocationRef &Other) const{
613return RelocationPimpl ==Other.RelocationPimpl;
614}
615
616inlinevoidRelocationRef::moveNext() {
617return OwningObject->moveRelocationNext(RelocationPimpl);
618}
619
620inlineuint64_tRelocationRef::getOffset() const{
621return OwningObject->getRelocationOffset(RelocationPimpl);
622}
623
624inlinesymbol_iteratorRelocationRef::getSymbol() const{
625return OwningObject->getRelocationSymbol(RelocationPimpl);
626}
627
628inlineuint64_tRelocationRef::getType() const{
629return OwningObject->getRelocationType(RelocationPimpl);
630}
631
632inlinevoidRelocationRef::getTypeName(SmallVectorImpl<char> &Result) const{
633return OwningObject->getRelocationTypeName(RelocationPimpl, Result);
634}
635
636inlineDataRefImplRelocationRef::getRawDataRefImpl() const{
637return RelocationPimpl;
638}
639
640inlineconstObjectFile *RelocationRef::getObject() const{
641return OwningObject;
642}
643
644}// end namespace object
645
646template <>structDenseMapInfo<object::SectionRef> {
647staticboolisEqual(constobject::SectionRef &A,
648constobject::SectionRef &B) {
649returnA ==B;
650 }
651staticobject::SectionRefgetEmptyKey() {
652returnobject::SectionRef({},nullptr);
653 }
654staticobject::SectionRefgetTombstoneKey() {
655object::DataRefImpl TS;
656 TS.p = (uintptr_t)-1;
657returnobject::SectionRef(TS,nullptr);
658 }
659staticunsignedgetHashValue(constobject::SectionRef &Sec) {
660object::DataRefImpl Raw = Sec.getRawDataRefImpl();
661returnhash_combine(Raw.p, Raw.d.a, Raw.d.b);
662 }
663};
664
665}// end namespace llvm
666
667#endif// LLVM_OBJECT_OBJECTFILE_H
ArrayRef.h
Binary.h
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
A
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Casting.h
Addr
uint64_t Addr
Definition:ELFObjHandler.cpp:79
Name
std::string Name
Definition:ELFObjHandler.cpp:77
End
bool End
Definition:ELF_riscv.cpp:480
Sym
Symbol * Sym
Definition:ELF_riscv.cpp:479
Hashing.h
Magic.h
MemoryBufferRef.h
P
#define P(N)
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
StringRef.h
Swift.h
SymbolicFile.h
Triple.h
RHS
Value * RHS
Definition:X86PartialReduction.cpp:74
LHS
Value * LHS
Definition:X86PartialReduction.cpp:73
Predicate
Definition:AMDGPURegBankLegalizeRules.cpp:332
bool
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::MemoryBufferRef
Definition:MemoryBufferRef.h:22
llvm::MemoryBufferRef::getBufferStart
const char * getBufferStart() const
Definition:MemoryBufferRef.h:35
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition:SmallVector.h:573
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition:StringRef.h:51
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition:Triple.h:44
llvm::Triple::OSType
OSType
Definition:Triple.h:199
llvm::Triple::UnknownOS
@ UnknownOS
Definition:Triple.h:200
llvm::Triple::ArchType
ArchType
Definition:Triple.h:46
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition:iterator_range.h:42
llvm::object::BasicSymbolRef
This is a value type class that represents a single symbol in the list of symbols in the object file.
Definition:SymbolicFile.h:103
llvm::object::BasicSymbolRef::getObject
const SymbolicFile * getObject() const
Definition:SymbolicFile.h:214
llvm::object::BasicSymbolRef::getRawDataRefImpl
DataRefImpl getRawDataRefImpl() const
Definition:SymbolicFile.h:210
llvm::object::BasicSymbolRef::SF_Common
@ SF_Common
Definition:SymbolicFile.h:114
llvm::object::Binary
Definition:Binary.h:32
llvm::object::Binary::Data
MemoryBufferRef Data
Definition:Binary.h:37
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition:ObjectFile.h:229
llvm::object::ObjectFile::isBerkeleyText
virtual bool isBerkeleyText(DataRefImpl Sec) const
Definition:ObjectFile.cpp:89
llvm::object::ObjectFile::getRelocatedSection
virtual Expected< section_iterator > getRelocatedSection(DataRefImpl Sec) const
Definition:ObjectFile.cpp:105
llvm::object::ObjectFile::getCommonSymbolSize
uint64_t getCommonSymbolSize(DataRefImpl Symb) const
Definition:ObjectFile.h:307
llvm::object::ObjectFile::getSectionIndex
virtual uint64_t getSectionIndex(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getSectionName
virtual Expected< StringRef > getSectionName(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getSectionAlignment
virtual uint64_t getSectionAlignment(DataRefImpl Sec) const =0
llvm::object::ObjectFile::isBerkeleyData
virtual bool isBerkeleyData(DataRefImpl Sec) const
Definition:ObjectFile.cpp:93
llvm::object::ObjectFile::ObjectFile
ObjectFile()=delete
llvm::object::ObjectFile::isSectionBSS
virtual bool isSectionBSS(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getSymbolName
virtual Expected< StringRef > getSymbolName(DataRefImpl Symb) const =0
llvm::object::ObjectFile::getRelocationTypeName
virtual void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl< char > &Result) const =0
llvm::object::ObjectFile::dynamic_relocation_sections
virtual std::vector< SectionRef > dynamic_relocation_sections() const
Definition:ObjectFile.h:316
llvm::object::ObjectFile::createMachOObjectFile
static Expected< std::unique_ptr< MachOObjectFile > > createMachOObjectFile(MemoryBufferRef Object, uint32_t UniversalCputype=0, uint32_t UniversalIndex=0, size_t MachOFilesetEntryOffset=0)
Create a MachOObjectFile instance from a given buffer.
Definition:MachOObjectFile.cpp:5319
llvm::object::ObjectFile::createCOFFObjectFile
static Expected< std::unique_ptr< COFFObjectFile > > createCOFFObjectFile(MemoryBufferRef Object)
Definition:COFFObjectFile.cpp:1896
llvm::object::ObjectFile::section_end
virtual section_iterator section_end() const =0
llvm::object::ObjectFile::mapReflectionSectionNameToEnumValue
virtual llvm::binaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue(StringRef SectionName) const
Definition:ObjectFile.h:296
llvm::object::ObjectFile::getBytesInAddress
virtual uint8_t getBytesInAddress() const =0
The number of bytes used to represent an address in this object file format.
llvm::object::ObjectFile::printSymbolName
Error printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override
Definition:ObjectFile.cpp:69
llvm::object::ObjectFile::getSymbolAddress
virtual Expected< uint64_t > getSymbolAddress(DataRefImpl Symb) const =0
llvm::object::ObjectFile::getSectionContents
virtual Expected< ArrayRef< uint8_t > > getSectionContents(DataRefImpl Sec) const =0
llvm::object::ObjectFile::isSectionVirtual
virtual bool isSectionVirtual(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getRelocationType
virtual uint64_t getRelocationType(DataRefImpl Rel) const =0
llvm::object::ObjectFile::createELFObjectFile
static Expected< std::unique_ptr< ObjectFile > > createELFObjectFile(MemoryBufferRef Object, bool InitContent=true)
Definition:ELFObjectFile.cpp:72
llvm::object::ObjectFile::getCommonSymbolSizeImpl
virtual uint64_t getCommonSymbolSizeImpl(DataRefImpl Symb) const =0
llvm::object::ObjectFile::getFeatures
virtual Expected< SubtargetFeatures > getFeatures() const =0
llvm::object::ObjectFile::isSectionCompressed
virtual bool isSectionCompressed(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getSectionSize
virtual uint64_t getSectionSize(DataRefImpl Sec) const =0
llvm::object::ObjectFile::makeTriple
Triple makeTriple() const
Create a triple from the data in this object file.
Definition:ObjectFile.cpp:109
llvm::object::ObjectFile::isSectionText
virtual bool isSectionText(DataRefImpl Sec) const =0
llvm::object::ObjectFile::section_rel_begin
virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const =0
llvm::object::ObjectFile::sections
section_iterator_range sections() const
Definition:ObjectFile.h:329
llvm::object::ObjectFile::getFileFormatName
virtual StringRef getFileFormatName() const =0
llvm::object::ObjectFile::getSymbolValueImpl
virtual uint64_t getSymbolValueImpl(DataRefImpl Symb) const =0
llvm::object::ObjectFile::moveSectionNext
virtual void moveSectionNext(DataRefImpl &Sec) const =0
llvm::object::ObjectFile::isDebugSection
virtual bool isDebugSection(DataRefImpl Sec) const
Definition:ObjectFile.cpp:97
llvm::object::ObjectFile::setARMSubArch
virtual void setARMSubArch(Triple &TheTriple) const
Definition:ObjectFile.h:346
llvm::object::ObjectFile::getRelocationSymbol
virtual symbol_iterator getRelocationSymbol(DataRefImpl Rel) const =0
llvm::object::ObjectFile::getSectionAddress
virtual uint64_t getSectionAddress(DataRefImpl Sec) const =0
llvm::object::ObjectFile::createWasmObjectFile
static Expected< std::unique_ptr< WasmObjectFile > > createWasmObjectFile(MemoryBufferRef Object)
Definition:WasmObjectFile.cpp:66
llvm::object::ObjectFile::createObjectFile
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Definition:ObjectFile.cpp:209
llvm::object::ObjectFile::getSymbolAlignment
virtual uint32_t getSymbolAlignment(DataRefImpl Symb) const
Definition:ObjectFile.cpp:77
llvm::object::ObjectFile::ObjectFile
ObjectFile(const ObjectFile &other)=delete
llvm::object::ObjectFile::mapDebugSectionName
virtual StringRef mapDebugSectionName(StringRef Name) const
Maps a debug section name to a standard DWARF section name.
Definition:ObjectFile.h:355
llvm::object::ObjectFile::symbols
symbol_iterator_range symbols() const
Definition:ObjectFile.h:321
llvm::object::ObjectFile::isSectionData
virtual bool isSectionData(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getSymbolValue
Expected< uint64_t > getSymbolValue(DataRefImpl Symb) const
Definition:ObjectFile.cpp:56
llvm::object::ObjectFile::section_iterator_range
iterator_range< section_iterator > section_iterator_range
Definition:ObjectFile.h:328
llvm::object::ObjectFile::moveRelocationNext
virtual void moveRelocationNext(DataRefImpl &Rel) const =0
llvm::object::ObjectFile::base
const uint8_t * base() const
Definition:ObjectFile.h:235
llvm::object::ObjectFile::getSymbolSection
virtual Expected< section_iterator > getSymbolSection(DataRefImpl Symb) const =0
llvm::object::ObjectFile::isRelocatableObject
virtual bool isRelocatableObject() const =0
True if this is a relocatable object (.o/.obj).
llvm::object::ObjectFile::getOS
virtual Triple::OSType getOS() const
Definition:ObjectFile.h:341
llvm::object::ObjectFile::isReflectionSectionStrippable
bool isReflectionSectionStrippable(llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind) const
True if the reflection section can be stripped by the linker.
Definition:ObjectFile.cpp:225
llvm::object::ObjectFile::hasDebugInfo
virtual bool hasDebugInfo() const
Definition:ObjectFile.cpp:99
llvm::object::ObjectFile::createGOFFObjectFile
static Expected< std::unique_ptr< ObjectFile > > createGOFFObjectFile(MemoryBufferRef Object)
Definition:GOFFObjectFile.cpp:28
llvm::object::ObjectFile::classof
static bool classof(const Binary *v)
Definition:ObjectFile.h:380
llvm::object::ObjectFile::createXCOFFObjectFile
static Expected< std::unique_ptr< ObjectFile > > createXCOFFObjectFile(MemoryBufferRef Object, unsigned FileType)
Definition:XCOFFObjectFile.cpp:1232
llvm::object::ObjectFile::getStartAddress
virtual Expected< uint64_t > getStartAddress() const
Definition:ObjectFile.h:347
llvm::object::ObjectFile::section_rel_end
virtual relocation_iterator section_rel_end(DataRefImpl Sec) const =0
llvm::object::ObjectFile::getArch
virtual Triple::ArchType getArch() const =0
llvm::object::ObjectFile::operator=
ObjectFile & operator=(const ObjectFile &other)=delete
llvm::object::ObjectFile::isSectionStripped
virtual bool isSectionStripped(DataRefImpl Sec) const
Definition:ObjectFile.cpp:87
llvm::object::ObjectFile::tryGetCPUName
virtual std::optional< StringRef > tryGetCPUName() const
Definition:ObjectFile.h:343
llvm::object::ObjectFile::isSectionBitcode
virtual bool isSectionBitcode(DataRefImpl Sec) const
Definition:ObjectFile.cpp:79
llvm::object::ObjectFile::symbol_iterator_range
iterator_range< symbol_iterator > symbol_iterator_range
Definition:ObjectFile.h:320
llvm::object::ObjectFile::getRelocationOffset
virtual uint64_t getRelocationOffset(DataRefImpl Rel) const =0
llvm::object::ObjectFile::createObjectFile
static Expected< std::unique_ptr< ObjectFile > > createObjectFile(MemoryBufferRef Object)
Definition:ObjectFile.h:376
llvm::object::ObjectFile::getSymbolType
virtual Expected< SymbolRef::Type > getSymbolType(DataRefImpl Symb) const =0
llvm::object::ObjectFile::section_begin
virtual section_iterator section_begin() const =0
llvm::object::RelocationRef
This is a value type class that represents a single relocation in the list of relocations in the obje...
Definition:ObjectFile.h:52
llvm::object::RelocationRef::getType
uint64_t getType() const
Definition:ObjectFile.h:628
llvm::object::RelocationRef::operator==
bool operator==(const RelocationRef &Other) const
Definition:ObjectFile.h:612
llvm::object::RelocationRef::moveNext
void moveNext()
Definition:ObjectFile.h:616
llvm::object::RelocationRef::getOffset
uint64_t getOffset() const
Definition:ObjectFile.h:620
llvm::object::RelocationRef::getSymbol
symbol_iterator getSymbol() const
Definition:ObjectFile.h:624
llvm::object::RelocationRef::RelocationRef
RelocationRef()=default
llvm::object::RelocationRef::getObject
const ObjectFile * getObject() const
Definition:ObjectFile.h:640
llvm::object::RelocationRef::getTypeName
void getTypeName(SmallVectorImpl< char > &Result) const
Get a string that represents the type of this relocation.
Definition:ObjectFile.h:632
llvm::object::RelocationRef::getRawDataRefImpl
DataRefImpl getRawDataRefImpl() const
Definition:ObjectFile.h:636
llvm::object::SectionFilterIterator
A filtered iterator for SectionRefs that skips sections based on some given predicate.
Definition:ObjectFile.h:407
llvm::object::SectionFilterIterator::operator++
SectionFilterIterator & operator++()
Definition:ObjectFile.h:416
llvm::object::SectionFilterIterator::operator*
const SectionRef & operator*() const
Definition:ObjectFile.h:415
llvm::object::SectionFilterIterator::operator!=
bool operator!=(const SectionFilterIterator &Other) const
Definition:ObjectFile.h:421
llvm::object::SectionFilterIterator::SectionFilterIterator
SectionFilterIterator(SectionFilterPredicate Pred, const section_iterator &Begin, const section_iterator &End)
Definition:ObjectFile.h:409
llvm::object::SectionFilter
Creates an iterator range of SectionFilterIterators for a given Object and predicate.
Definition:ObjectFile.h:438
llvm::object::SectionFilter::begin
SectionFilterIterator begin()
Definition:ObjectFile.h:442
llvm::object::SectionFilter::SectionFilter
SectionFilter(SectionFilterPredicate Pred, const ObjectFile &Obj)
Definition:ObjectFile.h:440
llvm::object::SectionFilter::end
SectionFilterIterator end()
Definition:ObjectFile.h:446
llvm::object::SectionRef
This is a value type class that represents a single section in the list of sections in the object fil...
Definition:ObjectFile.h:81
llvm::object::SectionRef::moveNext
void moveNext()
Definition:ObjectFile.h:513
llvm::object::SectionRef::getIndex
uint64_t getIndex() const
Definition:ObjectFile.h:525
llvm::object::SectionRef::operator<
bool operator<(const SectionRef &Other) const
Definition:ObjectFile.h:508
llvm::object::SectionRef::getRawDataRefImpl
DataRefImpl getRawDataRefImpl() const
Definition:ObjectFile.h:598
llvm::object::SectionRef::operator!=
bool operator!=(const SectionRef &Other) const
Definition:ObjectFile.h:504
llvm::object::SectionRef::isDebugSection
bool isDebugSection() const
Whether this section is a debug section.
Definition:ObjectFile.h:582
llvm::object::SectionRef::relocations
iterator_range< relocation_iterator > relocations() const
Definition:ObjectFile.h:133
llvm::object::SectionRef::isData
bool isData() const
Whether this section contains data, not instructions.
Definition:ObjectFile.h:554
llvm::object::SectionRef::getContents
Expected< StringRef > getContents() const
Definition:ObjectFile.h:533
llvm::object::SectionRef::relocation_end
relocation_iterator relocation_end() const
Definition:ObjectFile.h:590
llvm::object::SectionRef::isCompressed
bool isCompressed() const
Definition:ObjectFile.h:546
llvm::object::SectionRef::isStripped
bool isStripped() const
Definition:ObjectFile.h:570
llvm::object::SectionRef::isBSS
bool isBSS() const
Whether this section contains BSS uninitialized data.
Definition:ObjectFile.h:558
llvm::object::SectionRef::getSize
uint64_t getSize() const
Definition:ObjectFile.h:529
llvm::object::SectionRef::containsSymbol
bool containsSymbol(SymbolRef S) const
Definition:ObjectFile.cpp:46
llvm::object::SectionRef::SectionRef
SectionRef()=default
llvm::object::SectionRef::operator==
bool operator==(const SectionRef &Other) const
Definition:ObjectFile.h:499
llvm::object::SectionRef::getAddress
uint64_t getAddress() const
Definition:ObjectFile.h:521
llvm::object::SectionRef::isBerkeleyText
bool isBerkeleyText() const
Whether this section will be placed in the text segment, according to the Berkeley size format.
Definition:ObjectFile.h:574
llvm::object::SectionRef::isVirtual
bool isVirtual() const
Definition:ObjectFile.h:562
llvm::object::SectionRef::isText
bool isText() const
Whether this section contains instructions.
Definition:ObjectFile.h:550
llvm::object::SectionRef::relocation_begin
relocation_iterator relocation_begin() const
Definition:ObjectFile.h:586
llvm::object::SectionRef::getAlignment
Align getAlignment() const
Get the alignment of this section.
Definition:ObjectFile.h:541
llvm::object::SectionRef::isBerkeleyData
bool isBerkeleyData() const
Whether this section will be placed in the data segment, according to the Berkeley size format.
Definition:ObjectFile.h:578
llvm::object::SectionRef::getObject
const ObjectFile * getObject() const
Definition:ObjectFile.h:602
llvm::object::SectionRef::isBitcode
bool isBitcode() const
Definition:ObjectFile.h:566
llvm::object::SectionRef::getName
Expected< StringRef > getName() const
Definition:ObjectFile.h:517
llvm::object::SectionRef::getRelocatedSection
Expected< section_iterator > getRelocatedSection() const
Returns the related section if this section contains relocations.
Definition:ObjectFile.h:594
llvm::object::SymbolRef
This is a value type class that represents a single symbol in the list of symbols in the object file.
Definition:ObjectFile.h:168
llvm::object::SymbolRef::getType
Expected< SymbolRef::Type > getType() const
Definition:ObjectFile.h:484
llvm::object::SymbolRef::Type
Type
Definition:ObjectFile.h:172
llvm::object::SymbolRef::ST_Other
@ ST_Other
Definition:ObjectFile.h:174
llvm::object::SymbolRef::ST_Unknown
@ ST_Unknown
Definition:ObjectFile.h:173
llvm::object::SymbolRef::ST_Function
@ ST_Function
Definition:ObjectFile.h:178
llvm::object::SymbolRef::ST_File
@ ST_File
Definition:ObjectFile.h:177
llvm::object::SymbolRef::ST_Data
@ ST_Data
Definition:ObjectFile.h:175
llvm::object::SymbolRef::ST_Debug
@ ST_Debug
Definition:ObjectFile.h:176
llvm::object::SymbolRef::SymbolRef
SymbolRef(const BasicSymbolRef &B)
Definition:ObjectFile.h:183
llvm::object::SymbolRef::SymbolRef
SymbolRef()=default
llvm::object::SymbolRef::getName
Expected< StringRef > getName() const
Definition:ObjectFile.h:460
llvm::object::SymbolRef::getAlignment
uint32_t getAlignment() const
Get the alignment of this symbol as the actual value (not log 2).
Definition:ObjectFile.h:472
llvm::object::SymbolRef::getObject
const ObjectFile * getObject() const
Definition:ObjectFile.h:488
llvm::object::SymbolRef::getAddress
Expected< uint64_t > getAddress() const
Returns the symbol virtual address (i.e.
Definition:ObjectFile.h:464
llvm::object::SymbolRef::getValue
Expected< uint64_t > getValue() const
Return the value of the symbol depending on the object this can be an offset or a virtual address.
Definition:ObjectFile.h:468
llvm::object::SymbolRef::getSection
Expected< section_iterator > getSection() const
Get section this symbol is defined in reference to.
Definition:ObjectFile.h:480
llvm::object::SymbolRef::getCommonSize
uint64_t getCommonSize() const
Definition:ObjectFile.h:476
llvm::object::SymbolicFile
Definition:SymbolicFile.h:145
llvm::object::SymbolicFile::symbol_begin
virtual basic_symbol_iterator symbol_begin() const =0
llvm::object::SymbolicFile::symbol_end
virtual basic_symbol_iterator symbol_end() const =0
llvm::object::SymbolicFile::getSymbolFlags
virtual Expected< uint32_t > getSymbolFlags(DataRefImpl Symb) const =0
llvm::object::content_iterator< SectionRef >
llvm::object::content_iterator::operator*
const content_type & operator*() const
Definition:SymbolicFile.h:83
llvm::object::symbol_iterator
Definition:ObjectFile.h:208
llvm::object::symbol_iterator::operator->
const SymbolRef * operator->() const
Definition:ObjectFile.h:215
llvm::object::symbol_iterator::symbol_iterator
symbol_iterator(const basic_symbol_iterator &B)
Definition:ObjectFile.h:211
llvm::object::symbol_iterator::operator*
const SymbolRef & operator*() const
Definition:ObjectFile.h:220
llvm::object::symbol_iterator::symbol_iterator
symbol_iterator(SymbolRef Sym)
Definition:ObjectFile.h:210
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
uint32_t
uint64_t
uint8_t
iterator_range.h
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
UINT64_MAX
#define UINT64_MAX
Definition:DataTypes.h:77
Error.h
Error.h
llvm::binaryformat::Swift5ReflectionSectionKind
Swift5ReflectionSectionKind
Definition:Swift.h:14
llvm::binaryformat::unknown
@ unknown
Definition:Swift.h:18
llvm::codeview::CodeViewContainer::ObjectFile
@ ObjectFile
llvm::object::getObject
static Expected< const T * > getObject(MemoryBufferRef M, const void *Ptr, const uint64_t Size=sizeof(T))
Definition:XCOFFObjectFile.cpp:34
llvm::object::operator<
bool operator<(const ELFSymbolRef &A, const ELFSymbolRef &B)
Definition:ELFObjectFile.h:205
llvm::object::object_error::parse_failed
@ parse_failed
llvm::object::section_iterator
content_iterator< SectionRef > section_iterator
Definition:ObjectFile.h:47
llvm::object::SectionFilterPredicate
std::function< bool(const SectionRef &)> SectionFilterPredicate
Definition:ObjectFile.h:49
llvm::object::operator<<
raw_ostream & operator<<(raw_ostream &OS, const SectionedAddress &Addr)
Definition:ObjectFile.cpp:34
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition:iterator_range.h:77
llvm::operator==
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
Definition:AddressRanges.h:153
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:167
llvm::getTypeName
StringRef getTypeName()
We provide a function which tries to compute the (demangled) name of a type statically.
Definition:TypeName.h:63
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition:STLExtras.h:1873
llvm::cast
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition:Casting.h:565
llvm::errorCodeToError
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
Definition:Error.cpp:111
llvm::hash_combine
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Definition:Hashing.h:590
std
Implement std::hash so that hash_code can be used in STL containers.
Definition:BitVector.h:858
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition:Alignment.h:39
llvm::DenseMapInfo< object::SectionRef >::getHashValue
static unsigned getHashValue(const object::SectionRef &Sec)
Definition:ObjectFile.h:659
llvm::DenseMapInfo< object::SectionRef >::getEmptyKey
static object::SectionRef getEmptyKey()
Definition:ObjectFile.h:651
llvm::DenseMapInfo< object::SectionRef >::getTombstoneKey
static object::SectionRef getTombstoneKey()
Definition:ObjectFile.h:654
llvm::DenseMapInfo< object::SectionRef >::isEqual
static bool isEqual(const object::SectionRef &A, const object::SectionRef &B)
Definition:ObjectFile.h:647
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition:DenseMapInfo.h:52
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition:Alignment.h:117
llvm::MaybeAlign::valueOrOne
Align valueOrOne() const
For convenience, returns a valid alignment or 1 if undefined.
Definition:Alignment.h:141
llvm::SectionName
Definition:DWARFSection.h:21
llvm::file_magic
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
Definition:Magic.h:20
llvm::file_magic::unknown
@ unknown
Unrecognized file.
Definition:Magic.h:22
llvm::object::SectionedAddress
Definition:ObjectFile.h:145
llvm::object::SectionedAddress::Address
uint64_t Address
Definition:ObjectFile.h:148
llvm::object::SectionedAddress::UndefSection
static const uint64_t UndefSection
Definition:ObjectFile.h:146
llvm::object::SectionedAddress::SectionIndex
uint64_t SectionIndex
Definition:ObjectFile.h:149
llvm::object::DataRefImpl
Definition:SymbolicFile.h:35
llvm::object::DataRefImpl::b
uint32_t b
Definition:SymbolicFile.h:39
llvm::object::DataRefImpl::p
uintptr_t p
Definition:SymbolicFile.h:41
llvm::object::DataRefImpl::d
struct llvm::object::DataRefImpl::@370 d
llvm::object::DataRefImpl::a
uint32_t a
Definition:SymbolicFile.h:39

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

©2009-2025 Movatter.jp