llvm.org GIT mirror llvm / 10051f0
Constify input argument of RelocVisitor and DWARFContext constructors. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220228 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Samsonov 5 years ago
5 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
127127 virtual ~DIContext();
128128
129129 /// getDWARFContext - get a context for binary DWARF data.
130 static DIContext *getDWARFContext(object::ObjectFile &);
130 static DIContext *getDWARFContext(const object::ObjectFile &Obj);
131131
132132 virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) = 0;
133133
4040 /// @brief Base class for object file relocation visitors.
4141 class RelocVisitor {
4242 public:
43 explicit RelocVisitor(ObjectFile &Obj)
43 explicit RelocVisitor(const ObjectFile &Obj)
4444 : ObjToVisit(Obj), HasError(false) {}
4545
4646 // TODO: Should handle multiple applied relocations via either passing in the
5959 bool error() { return HasError; }
6060
6161 private:
62 ObjectFile &ObjToVisit;
62 const ObjectFile &ObjToVisit;
6363 bool HasError;
6464
6565 RelocToApply visitELF(uint32_t RelocType, RelocationRef R, uint64_t Value) {
1212
1313 DIContext::~DIContext() {}
1414
15 DIContext *DIContext::getDWARFContext(object::ObjectFile &Obj) {
15 DIContext *DIContext::getDWARFContext(const object::ObjectFile &Obj) {
1616 return new DWARFContextInMemory(Obj);
1717 }
508508 return true;
509509 }
510510
511 DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj)
511 DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj)
512512 : IsLittleEndian(Obj.isLittleEndian()),
513513 AddressSize(Obj.getBytesInAddress()) {
514514 for (const SectionRef &Section : Obj.sections()) {
239239 SmallVector, 4> UncompressedSections;
240240
241241 public:
242 DWARFContextInMemory(object::ObjectFile &);
242 DWARFContextInMemory(const object::ObjectFile &Obj);
243243 bool isLittleEndian() const override { return IsLittleEndian; }
244244 uint8_t getAddressSize() const override { return AddressSize; }
245245 const DWARFSection &getInfoSection() override { return InfoSection; }