29 if (
auto *M = dyn_cast<MachOObjectFile>(&O))
30 return M->getSectionID(Sec);
35 if (
auto *M = dyn_cast<MachOObjectFile>(&O))
36 return M->getSymbolSectionID(Sym);
40 std::vector<std::pair<SymbolRef, uint64_t>>
42 std::vector<std::pair<SymbolRef, uint64_t>>
Ret;
44 if (
const auto *
E = dyn_cast<ELFObjectFileBase>(&O)) {
45 auto Syms =
E->symbols();
46 if (Syms.begin() == Syms.end())
47 Syms =
E->getDynamicSymbolIterators();
49 Ret.push_back({Sym, Sym.getSize()});
55 std::vector<SymEntry> Addresses;
64 uint64_t
Address = Sec.getAddress();
65 uint64_t
Size = Sec.getSize();
70 if (Addresses.empty())
76 for (
unsigned I = 0,
N = Addresses.size() - 1;
I <
N; ++
I) {
77 auto &
P = Addresses[
I];
82 unsigned NextI =
I + 1;
83 while (NextI < N && Addresses[NextI].
Address ==
P.Address)
86 uint64_t
Size = Addresses[NextI].Address -
P.Address;
95 Ret[
P.Number] = {*
P.I,
P.Address};
This class represents lattice values for constants.
uint64_t getValue() const
Return the value of the symbol depending on the object this can be an offset or a virtual address...
This class is the base class for all object file types.
int compareAddress(const SymEntry *A, const SymEntry *B)
static unsigned getSymbolSectionID(const ObjectFile &O, SymbolRef Sym)
virtual basic_symbol_iterator symbol_begin() const =0
section_iterator_range sections() const
void array_pod_sort(IteratorTy Start, IteratorTy End)
array_pod_sort - This sorts an array with the specified start and end extent.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
virtual basic_symbol_iterator symbol_end() const =0
static unsigned getSectionID(const ObjectFile &O, SectionRef Sec)
std::vector< std::pair< SymbolRef, uint64_t > > computeSymbolSizes(const ObjectFile &O)
This is a value type class that represents a single symbol in the list of symbols in the object file...
LLVM Value Representation.
This is a value type class that represents a single section in the list of sections in the object fil...