LLVM: lib/DebugInfo/LogicalView/Readers/LVBinaryReader.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
17
18using namespace llvm;
20
21#define DEBUG_TYPE "BinaryReader"
22
23
26 std::string SymbolName(Name);
28 SymbolNames.try_emplace(SymbolName, Function, 0, SectionIndex, false);
30
32 if (SectionIndex)
33 It->second.SectionIndex = SectionIndex;
34 }
35
36 if (Function && It->second.IsComdat)
38
40}
41
44 std::string SymbolName(Name);
45 auto [It, Inserted] = SymbolNames.try_emplace(SymbolName, nullptr, Address,
46 SectionIndex, IsComdat);
48
49 It->second.Address = Address;
50
55}
56
60 if (Name.empty())
62 std::string SymbolName(Name);
63
64 if (SymbolName.empty())
65 return SectionIndex;
66
67 auto It = SymbolNames.find(SymbolName);
68 if (It == SymbolNames.end())
69 return SectionIndex;
70
71
72
73
74 if (Function->getHasRanges()) {
76 SectionIndex = It->second.SectionIndex;
77 } else {
79 }
80
81 if (It->second.IsComdat)
83
85 return SectionIndex;
86}
87
90 LVSymbolNames::iterator Iter = SymbolNames.find(Name);
91 return Iter != SymbolNames.end() ? Iter->second : Empty;
92}
94 LVSymbolNames::iterator Iter = SymbolNames.find(Name);
95 return Iter != SymbolNames.end() ? Iter->second.Address : 0;
96}
98 LVSymbolNames::iterator Iter = SymbolNames.find(Name);
99 return Iter != SymbolNames.end() ? Iter->second.SectionIndex
101}
103 LVSymbolNames::iterator Iter = SymbolNames.find(Name);
104 return Iter != SymbolNames.end() ? Iter->second.IsComdat : false;
105}
106
108 OS << "Symbol Table\n";
109 for (LVSymbolNames::reference Entry : SymbolNames) {
111 LVScope *Scope = SymbolName.Scope;
113 OS << "Index: " << hexValue(SymbolName.SectionIndex, 5)
114 << " Comdat: " << (SymbolName.IsComdat ? "Y" : "N")
116 << " Address: " << hexValue(SymbolName.Address)
117 << " Name: " << Entry.first << "\n";
118 }
119}
120
127 bool IsComdat) {
128 SymbolTable.add(Name, Address, SectionIndex, IsComdat);
129}
131 return SymbolTable.update(Function);
132}
133
135 return SymbolTable.getEntry(Name);
136}
138 return SymbolTable.getAddress(Name);
139}
141 return SymbolTable.getIndex(Name);
142}
144 return SymbolTable.getIsComdat(Name);
145}
146
152 if (!SectionNameOrErr)
154 else
155 Name = *SectionNameOrErr;
157 << "Address: " << hexValue(Section.getAddress()) << ", "
158 << "Size: " << hexValue(Section.getSize()) << ", "
159 << "Name: " << Name << "\n";
160 dbgs() << "isCompressed: " << Section.isCompressed() << ", "
161 << "isText: " << Section.isText() << ", "
162 << "isData: " << Section.isData() << ", "
163 << "isBSS: " << Section.isBSS() << ", "
164 << "isVirtual: " << Section.isVirtual() << "\n";
165 dbgs() << "isBitcode: " << Section.isBitcode() << ", "
166 << "isStripped: " << Section.isStripped() << ", "
167 << "isBerkeleyText: " << Section.isBerkeleyText() << ", "
168 << "isBerkeleyData: " << Section.isBerkeleyData() << ", "
169 << "isDebugSection: " << Section.isDebugSection() << "\n";
170 dbgs() << "\n";
171 });
172
173 if (!Section.isText() || Section.isVirtual() || !Section.getSize())
174 continue;
175
176
177
178 Sections.emplace(Section.getIndex(), Section);
179 addSectionAddress(Section);
180
181
183 if (!SectionNameOrErr) {
185 continue;
186 }
187 if (*SectionNameOrErr == ".text" || *SectionNameOrErr == "CODE" ||
188 *SectionNameOrErr == ".code") {
190
191
192 if (Obj.isWasm())
194 }
195 }
196
197
199
201 dbgs() << "\nSections Information:\n";
202 for (LVSections::reference Entry : Sections) {
206 if (!SectionNameOrErr)
209 << " Name: " << *SectionNameOrErr << "\n"
210 << "Size: " << hexValue(Section.getSize()) << "\n"
211 << "VirtualAddress: " << hexValue(VirtualAddress) << "\n"
212 << "SectionAddress: " << hexValue(Section.getAddress()) << "\n";
213 }
214 dbgs() << "\nObject Section Information:\n";
215 for (LVSectionAddresses::const_reference Entry : SectionAddresses)
216 dbgs() << "[" << hexValue(Entry.first) << ":"
217 << hexValue(Entry.first + Entry.second.getSize())
218 << "] Size: " << hexValue(Entry.second.getSize()) << "\n";
219 });
220}
221
224 if (ImageBase)
225 ImageBaseAddress = ImageBase.get();
226
228 dbgs() << "ImageBaseAddress: " << hexValue(ImageBaseAddress) << "\n";
229 });
230
232
234 if (!Section.isText() || Section.isVirtual() || !Section.getSize())
235 continue;
236
239 bool IsComdat = (COFFSection->Characteristics & Flags) == Flags;
240
241
242
243 Sections.emplace(Section.getIndex() + 1, Section);
244 addSectionAddress(Section);
245
246
248 }
249
251 dbgs() << "\nSections Information:\n";
252 for (LVSections::reference Entry : Sections) {
257 if (!SectionNameOrErr)
260 << " Name: " << *SectionNameOrErr << "\n"
261 << "Size: " << hexValue(Section.getSize()) << "\n"
262 << "VirtualAddress: " << hexValue(VirtualAddress) << "\n"
263 << "SectionAddress: " << hexValue(Section.getAddress()) << "\n"
264 << "PointerToRawData: " << hexValue(COFFSection->PointerToRawData)
265 << "\n"
266 << "SizeOfRawData: " << hexValue(COFFSection->SizeOfRawData)
267 << "\n";
268 }
269 dbgs() << "\nObject Section Information:\n";
270 for (LVSectionAddresses::const_reference Entry : SectionAddresses)
271 dbgs() << "[" << hexValue(Entry.first) << ":"
272 << hexValue(Entry.first + Entry.second.getSize())
273 << "] Size: " << hexValue(Entry.second.getSize()) << "\n";
274 });
275}
276
280 Triple TheTriple(TripleName);
281 std::string TargetLookupError;
282 const Target *TheTarget =
284 if (!TheTarget)
286
287
289 if (!RegisterInfo)
291 "no register info for target " + TripleName);
292 MRI.reset(RegisterInfo);
293
294
297 if (!AsmInfo)
299 "no assembly info for target " + TripleName);
300 MAI.reset(AsmInfo);
301
302
305 if (!SubtargetInfo)
307 "no subtarget info for target " + TripleName);
308 STI.reset(SubtargetInfo);
309
310
312 if (!InstructionInfo)
314 "no instruction info for target " + TripleName);
315 MII.reset(InstructionInfo);
316
317 MC = std::make_unique(Triple(TheTriple), MAI.get(), MRI.get(),
318 STI.get());
319
320
322 if (!DisAsm)
324 "no disassembler for target " + TripleName);
325 MD.reset(DisAsm);
326
329 if (!InstructionPrinter)
331 "no target assembly language printer for target " +
332 TripleName);
333 MIP.reset(InstructionPrinter);
335
337}
338
342
343
344
345 if (SectionIndex) {
346 LVSections::iterator Iter = Sections.find(SectionIndex);
347 if (Iter == Sections.end()) {
349 "invalid section index for: '%s'",
350 Scope->getName().str().c_str());
351 }
353 return std::make_pair(Section.getAddress(), Section);
354 }
355
356
357 LVSectionAddresses::const_iterator Iter =
358 SectionAddresses.upper_bound(Address);
359 if (Iter == SectionAddresses.begin())
361 "invalid section address for: '%s'",
362 Scope->getName().str().c_str());
363
364
365 Iter = SectionAddresses.lower_bound(Address);
366 if (Iter != SectionAddresses.begin())
367 --Iter;
368 return std::make_pair(Iter->first, Iter->second);
369}
370
374 assert(Scope && "Scope is null.");
375
376
377 if (Scope->getIsDiscarded())
379
380
383
385 dbgs() << "\nPublic Name instructions: '" << Scope->getName() << "' / '"
386 << Scope->getLinkageName() << "'\n"
387 << "DIE Offset: " << hexValue(Scope->getOffset()) << " Range: ["
389 });
390
393 if (!SectionOrErr)
394 return SectionOrErr.takeError();
396 uint64_t SectionAddress = (*SectionOrErr).first;
397
399 if (!SectionContentsOrErr)
400 return SectionOrErr.takeError();
401
402
403
404
407 << ", Section Size: " << hexValue(Section.getSize()) << "\n";
408 });
409 Size = std::min(Size + 1, Section.getSize());
410
415 dbgs() << "offset (" << hexValue(Offset) << ") is beyond section size ("
416 << hexValue(Bytes.size()) << "); malformed input?\n";
417 });
420 "Failed to parse instructions; offset beyond section size");
421 }
424
427 if (!SectionNameOrErr)
429 else
430 dbgs() << "Section Index: " << hexValue(Section.getIndex()) << " ["
432 << hexValue((uint64_t)Section.getAddress() + Section.getSize(), 10)
433 << "] Name: '" << *SectionNameOrErr << "'\n"
436 });
437
438
440 auto InstructionsSP = std::make_unique();
442 DiscoveredLines.emplace_back(std::move(InstructionsSP));
443
444 while (Begin < End) {
452 switch (S) {
455 if (BytesConsumed == 0)
456
457 BytesConsumed = 1;
458 break;
460 LLVM_DEBUG({ dbgs() << "Potentially undefined instruction:"; });
461 [[fallthrough]];
463 std::string Buffer;
468 std::string BufferCodes;
471 ArrayRef<uint8_t>(Begin, Begin + BytesConsumed), std::nullopt, 16,
472 16);
474 << "Size: " << format_decimal(BytesConsumed, 2) << " ("
478 << "\n";
479 });
480
481
482
483
488 break;
489 }
490 }
491 Address += BytesConsumed;
492 Begin += BytesConsumed;
493 }
494
496 size_t Index = 0;
498 << " Scope DIE: " << hexValue(Scope->getOffset()) << "\n"
499 << "Address: " << hexValue(FirstAddress)
500 << format(" - Collected instructions lines: %d\n",
505 << ")\n";
506 });
507
508
509 ScopeInstructions.add(SectionIndex, Scope, &Instructions);
510 AssemblerMappings.add(SectionIndex, FirstAddress, Scope);
511
513}
514
517 if (().getPrintInstructions())
519
523
525}
526
528 if (().getPrintInstructions())
530
532 size_t Index = 1;
533 dbgs() << "\nPublic Names (Scope):\n";
534 for (LVPublicNames::const_reference Name : CompileUnit->getPublicNames()) {
540 << "DIE Offset: " << hexValue(Scope->getOffset()) << " Range: ["
542 << "Name: '" << Scope->getName() << "' / '"
543 << Scope->getLinkageName() << "'\n";
544 }
545 });
546
547
548
549 for (LVPublicNames::const_reference Name : CompileUnit->getPublicNames()) {
551
552
553
554
555 if (!Scope->getLinkageNameIndex())
556 Scope->setLinkageName(Scope->getName());
559 return Err;
560 }
561
563}
564
565
566
567
568
569
573 assert(DebugLines && "DebugLines is null.");
574
575
576
577 if (DebugLines->empty() && ().getPrintInstructions())
578 return;
579
580
581
582
583
584
586 size_t Index = 1;
587 size_t PerLine = 4;
588 dbgs() << format("\nProcess debug lines: %d\n", DebugLines->size());
589 for (const LVLine *Line : *DebugLines) {
591 << ", (" << Line->getLineNumber() << ")"
592 << ((Index % PerLine) ? " " : "\n");
593 ++Index;
594 }
595 dbgs() << ((Index % PerLine) ? "\n" : "");
596 });
597
598 bool TraverseLines = true;
600 while (TraverseLines && Iter != DebugLines->end()) {
601 uint64_t DebugAddress = (*Iter)->getAddress();
602
603
604
605
608 Scope = AssemblerMappings.find(SectionIndex, DebugAddress);
609 if (!Scope) {
610 ++Iter;
611 continue;
612 }
613 }
614
615
616 LVLines InstructionLines;
617 LVLines *Lines = ScopeInstructions.find(SectionIndex, Scope);
618 if (Lines)
619 InstructionLines = std::move(*Lines);
620
622 size_t Index = 0;
624 << " Scope DIE: " << hexValue(Scope->getOffset()) << "\n"
625 << format("Process instruction lines: %d\n",
626 InstructionLines.size());
627 for (const LVLine *Line : InstructionLines)
630 << ")\n";
631 });
632
633
634 if (InstructionLines.empty()) {
635 ++Iter;
636 continue;
637 }
638
639 for (LVLine *InstructionLine : InstructionLines) {
640 uint64_t InstructionAddress = InstructionLine->getAddress();
642 dbgs() << "Instruction address: " << hexValue(InstructionAddress)
643 << "\n";
644 });
645 if (TraverseLines) {
646 while (Iter != DebugLines->end()) {
647 DebugAddress = (*Iter)->getAddress();
649 bool IsDebug = (*Iter)->getIsLineDebug();
650 dbgs() << "Line " << (IsDebug ? "dbg:" : "ins:") << " ["
651 << hexValue(DebugAddress) << "]";
652 if (IsDebug)
653 dbgs() << format(" %d", (*Iter)->getLineNumber());
654 dbgs() << "\n";
655 });
656
657 if (InstructionAddress < DebugAddress) {
659 dbgs() << "Inserted instruction address: "
660 << hexValue(InstructionAddress) << " before line: "
661 << format("%d", (*Iter)->getLineNumber()) << " ["
662 << hexValue(DebugAddress) << "]\n";
663 });
664 Iter = DebugLines->insert(Iter, InstructionLine);
665
666
667 ++Iter;
668 break;
669 }
670 ++Iter;
671 }
672 if (Iter == DebugLines->end()) {
673
674
675 TraverseLines = false;
676 DebugLines->push_back(InstructionLine);
677 }
678 } else {
679 DebugLines->push_back(InstructionLine);
680 }
681 }
682 }
683
685 dbgs() << format("Lines after merge: %d\n", DebugLines->size());
686 size_t Index = 0;
687 for (const LVLine *Line : *DebugLines) {
690 << ((Line->getIsLineDebug())
691 ? Line->lineNumberAsStringStripped(true)
692 : Line->getName())
693 << ")\n";
694 }
695 });
696
697
698
699
700 if (DebugLines->empty()) {
702 for (LVScope *Scope : *Scopes) {
703 LVLines *Lines = ScopeInstructions.find(Scope);
704 if (Lines) {
705
707 size_t Index = 0;
709 << " Scope DIE: " << hexValue(Scope->getOffset()) << "\n"
710 << format("Instruction lines: %d\n", Lines->size());
714 << ")\n";
715 });
716
717 if (Scope->getIsArtificial()) {
718
720 Scope->addElement(Line);
721 } else {
722 DebugLines->append(*Lines);
723 }
724 Lines->clear();
725 }
726 }
727 }
728
731
732
735
736
737 Scope = ScopesWithRanges->getEntry(Line->getAddress());
738 if (!Scope) {
739
742 dbgs() << "Adding line to CU: " << hexValue(Line->getOffset()) << ", ("
743 << ((Line->getIsLineDebug())
744 ? Line->lineNumberAsStringStripped(true)
745 : Line->getName())
746 << ")\n";
747 });
748 }
749
750
752
753
754 if (options().getWarningLines() && Line->getIsLineDebug() &&
755 ->getLineNumber())
757
758
759
760
761
762
763
764
765 if (Line->getIsLineDebug())
767
768
770 }
771
773}
774
777 assert(DebugLines && "DebugLines is null.");
778 if (DebugLines->empty() && !ScopeInstructions.findMap(SectionIndex))
779 return;
780
781
782
783 if (->getHasComdatScopes()) {
784 processLines(DebugLines, SectionIndex, nullptr);
785 return;
786 }
787
788
789 std::vector<size_t> AddressZero;
791 *DebugLines, [](LVLine *Line) { return ->getAddress(); });
792 while (It != std::end(*DebugLines)) {
793 AddressZero.emplace_back(std::distance(std::begin(*DebugLines), It));
794 It = std::find_if(std::next(It), std::end(*DebugLines),
796 }
797
798
799
800
801 if (AddressZero.empty()) {
802 processLines(DebugLines, SectionIndex, nullptr);
803 return;
804 }
805
806
807
808
809
810 using LVBucket = std::tuple<size_t, size_t, LVAddress, bool>;
811 std::vector Buckets;
812
814 size_t Begin = 0;
815 size_t End = 0;
816 size_t Index = 0;
817 for (Index = 0; Index < AddressZero.size() - 1; ++Index) {
818 Begin = AddressZero[Index];
819 End = AddressZero[Index + 1] - 1;
820 Address = (*DebugLines)[End]->getAddress();
821 Buckets.emplace_back(Begin, End, Address, false);
822 }
823
824
825 if (Index) {
826 Begin = AddressZero[Index];
827 End = DebugLines->size() - 1;
828 Address = (*DebugLines)[End]->getAddress();
829 Buckets.emplace_back(Begin, End, Address, false);
830 }
831
833 dbgs() << "\nDebug Lines buckets: " << Buckets.size() << "\n";
834 for (LVBucket &Bucket : Buckets) {
835 dbgs() << "Begin: " << format_decimal(std::get<0>(Bucket), 5) << ", "
836 << "End: " << format_decimal(std::get<1>(Bucket), 5) << ", "
837 << "Address: " << hexValue(std::get<2>(Bucket)) << "\n";
838 }
839 });
840
841
842
843
845 for (LVSections::reference Entry : Sections) {
851 << " , Section Size: " << hexValue(Section.getSize())
852 << " , Section Address: " << hexValue(Section.getAddress())
853 << "\n";
854 });
855
856 for (LVBucket &Bucket : Buckets) {
857 if (std::get<3>(Bucket))
858
859 continue;
860 if (Size == std::get<2>(Bucket)) {
861
862 Group.clear();
865 DebugLines->begin() + std::get<1>(Bucket) + 1;
867 Group.push_back(*Iter);
868 processLines(&Group, SectionIndex, nullptr);
869 std::get<3>(Bucket) = true;
870 break;
871 }
872 }
873 }
874}
875
876
877
881 std::function<void(LVScope * Parent)> FindInlinedScopes =
884 for (LVScope *Scope : *Scopes) {
885 LVInlineeLine::iterator Iter = CUInlineeLines.find(Scope);
886 if (Iter != CUInlineeLines.end())
888 FindInlinedScopes(Scope);
889 }
890 };
891
892
894 for (LVInlineeLine::iterator InlineeIter : InlineeIters) {
895 LVScope *Scope = InlineeIter->first;
896 addToSymbolTable(Scope->getLinkageName(), Scope, SectionIndex);
897
898
901 dbgs() << "Inlined lines for: " << Scope->getName() << "\n";
904 << Line->getLineNumber() << "\n";
907 dbgs() << "Line address: " << hexValue(Line->getOffset()) << ", ("
908 << Line->getLineNumber() << ")\n";
909 ;
910 });
911
912
913
914
916
920 return Item->getAddress() == InlineeStart;
921 });
922 if (Iter != CULines.end()) {
923
924
925 Scope->setCallLineNumber((*Iter)->getLineNumber());
926
927
928
929 (*Iter)->setLineNumber((*InlineeLines->begin())->getLineNumber());
930 ++Iter;
932 }
933 }
934
935
936
937 CUInlineeLines.erase(InlineeIter);
939 }
941 dbgs() << "Merged Inlined lines for: " << Function->getName() << "\n";
944 dbgs() << "Line address: " << hexValue(Line->getOffset()) << ", ("
945 << Line->getLineNumber() << ")\n";
946 ;
947 });
948}
949
951 OS << "LVBinaryReader\n";
953}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
LocallyHashedType DenseMapInfo< LocallyHashedType >::Empty
Annotations lets you mark points and ranges inside source code, for tests:
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Represents either an error or a value T.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
This class is intended to be used as a base class for asm properties and features specific to the tar...
unsigned getAssemblerDialect() const
Superclass for all disassemblers.
DecodeStatus
Ternary decode status.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
void setPrintImmHex(bool Value)
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
iterator insert(iterator I, T &&Elt)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
StringRef trim(char Char) const
Return string with consecutive Char characters starting from the left and right removed.
Target - Wrapper for Target specific information.
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
MCRegisterInfo * createMCRegInfo(StringRef TT) const
MCDisassembler * createMCDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx) const
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple, const MCTargetOptions &Options) const
MCInstPrinter * createMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI) const
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
Triple - Helper class for working with autoconf configuration names.
const LVSymbolTableEntry & getSymbolTableEntry(StringRef Name)
Definition LVBinaryReader.cpp:134
LVSectionIndex updateSymbolTable(LVScope *Function)
Definition LVBinaryReader.cpp:130
Expected< std::pair< LVSectionIndex, object::SectionRef > > getSection(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex)
Definition LVBinaryReader.cpp:340
std::unique_ptr< MCContext > MC
void includeInlineeLines(LVSectionIndex SectionIndex, LVScope *Function)
Definition LVBinaryReader.cpp:878
std::unique_ptr< const MCInstrInfo > MII
Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures, StringRef TheCPU)
Definition LVBinaryReader.cpp:277
LVAddress getSymbolTableAddress(StringRef Name)
Definition LVBinaryReader.cpp:137
void print(raw_ostream &OS) const
Definition LVBinaryReader.cpp:950
std::unique_ptr< const MCSubtargetInfo > STI
void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
Definition LVBinaryReader.cpp:121
virtual void mapRangeAddress(const object::ObjectFile &Obj)
void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
Definition LVBinaryReader.cpp:775
void mapVirtualAddress(const object::ObjectFile &Obj)
Definition LVBinaryReader.cpp:147
std::unique_ptr< const MCAsmInfo > MAI
LVSectionIndex getSymbolTableIndex(StringRef Name)
Definition LVBinaryReader.cpp:140
bool getSymbolTableIsComdat(StringRef Name)
Definition LVBinaryReader.cpp:143
std::unique_ptr< const MCRegisterInfo > MRI
std::unique_ptr< const MCDisassembler > MD
Error createInstructions()
Definition LVBinaryReader.cpp:527
std::unique_ptr< MCInstPrinter > MIP
LVAddress WasmCodeSectionOffset
uint64_t getAddress() const
void resolvePatternMatch(LVLine *Line)
LVScope * getEntry(LVAddress Address) const
LVRange * getSectionRanges(LVSectionIndex SectionIndex)
LVSectionIndex getDotTextSectionIndex() const
LVScopeCompileUnit * CompileUnit
LVSectionIndex DotTextSectionIndex
void addElement(LVElement *Element)
const LVScopes * getScopes() const
LVSectionIndex getIndex(StringRef Name)
Definition LVBinaryReader.cpp:97
bool getIsComdat(StringRef Name)
Definition LVBinaryReader.cpp:102
void print(raw_ostream &OS)
Definition LVBinaryReader.cpp:107
LVAddress getAddress(StringRef Name)
Definition LVBinaryReader.cpp:93
void add(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
Definition LVBinaryReader.cpp:24
LVSectionIndex update(LVScope *Function)
Definition LVBinaryReader.cpp:57
const LVSymbolTableEntry & getEntry(StringRef Name)
Definition LVBinaryReader.cpp:88
uint64_t getImageBase() const
const coff_section * getCOFFSection(const SectionRef &Section) const
This class is the base class for all object file types.
section_iterator_range sections() const
This is a value type class that represents a single section in the list of sections in the object fil...
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
A raw_ostream that writes to an SmallVector or SmallString.
FormattedNumber hexValue(uint64_t N, unsigned Width=HEX_WIDTH, bool Upper=false)
std::pair< LVAddress, uint64_t > LVNameInfo
constexpr LVSectionIndex UndefinedSectionIndex
SmallVector< LVScope *, 8 > LVScopes
SmallVector< LVLine *, 8 > LVLines
This is an optimization pass for GlobalISel generic memory operations.
FormattedNumber format_decimal(int64_t N, unsigned Width)
format_decimal - Output N as a right justified, fixed-width decimal.
ArrayRef< CharT > arrayRefFromStringRef(StringRef Input)
Construct a string ref from an array ref of unsigned chars.
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
support::detail::AlignAdapter< T > fmt_align(T &&Item, AlignStyle Where, size_t Amount, char Fill=' ')
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
void consumeError(Error Err)
Consume a Error without doing anything.
FormattedBytes format_bytes(ArrayRef< uint8_t > Bytes, std::optional< uint64_t > FirstByteOffset=std::nullopt, uint32_t NumPerLine=16, uint8_t ByteGroupSize=4, uint32_t IndentLevel=0, bool Upper=false)
static const Target * lookupTarget(StringRef TripleStr, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
support::ulittle32_t VirtualAddress