From: Alexey Samsonov Date: Mon, 20 Oct 2014 20:28:51 +0000 (+0000) Subject: Constify input argument of RelocVisitor and DWARFContext constructors. NFC. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a7eb380cc22869f06815034326f9dda19662e95;p=platform%2Fupstream%2Fllvm.git Constify input argument of RelocVisitor and DWARFContext constructors. NFC. llvm-svn: 220228 --- diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h index 160d450..3ef541a 100644 --- a/llvm/include/llvm/DebugInfo/DIContext.h +++ b/llvm/include/llvm/DebugInfo/DIContext.h @@ -128,7 +128,7 @@ public: virtual ~DIContext(); /// getDWARFContext - get a context for binary DWARF data. - static DIContext *getDWARFContext(object::ObjectFile &); + static DIContext *getDWARFContext(const object::ObjectFile &Obj); virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) = 0; diff --git a/llvm/include/llvm/Object/RelocVisitor.h b/llvm/include/llvm/Object/RelocVisitor.h index 4fffd7e..91eafd5 100644 --- a/llvm/include/llvm/Object/RelocVisitor.h +++ b/llvm/include/llvm/Object/RelocVisitor.h @@ -41,7 +41,7 @@ struct RelocToApply { /// @brief Base class for object file relocation visitors. class RelocVisitor { public: - explicit RelocVisitor(ObjectFile &Obj) + explicit RelocVisitor(const ObjectFile &Obj) : ObjToVisit(Obj), HasError(false) {} // TODO: Should handle multiple applied relocations via either passing in the @@ -60,7 +60,7 @@ public: bool error() { return HasError; } private: - ObjectFile &ObjToVisit; + const ObjectFile &ObjToVisit; bool HasError; RelocToApply visitELF(uint32_t RelocType, RelocationRef R, uint64_t Value) { diff --git a/llvm/lib/DebugInfo/DIContext.cpp b/llvm/lib/DebugInfo/DIContext.cpp index 29ef8f2..01aecf82 100644 --- a/llvm/lib/DebugInfo/DIContext.cpp +++ b/llvm/lib/DebugInfo/DIContext.cpp @@ -13,6 +13,6 @@ using namespace llvm; DIContext::~DIContext() {} -DIContext *DIContext::getDWARFContext(object::ObjectFile &Obj) { +DIContext *DIContext::getDWARFContext(const object::ObjectFile &Obj) { return new DWARFContextInMemory(Obj); } diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index 830db66..aa86f6a 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -509,7 +509,7 @@ static bool consumeCompressedDebugSectionHeader(StringRef &data, return true; } -DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj) +DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj) : IsLittleEndian(Obj.isLittleEndian()), AddressSize(Obj.getBytesInAddress()) { for (const SectionRef &Section : Obj.sections()) { diff --git a/llvm/lib/DebugInfo/DWARFContext.h b/llvm/lib/DebugInfo/DWARFContext.h index 05c6acc..c4586b0 100644 --- a/llvm/lib/DebugInfo/DWARFContext.h +++ b/llvm/lib/DebugInfo/DWARFContext.h @@ -240,7 +240,7 @@ class DWARFContextInMemory : public DWARFContext { SmallVector, 4> UncompressedSections; public: - DWARFContextInMemory(object::ObjectFile &); + DWARFContextInMemory(const object::ObjectFile &Obj); bool isLittleEndian() const override { return IsLittleEndian; } uint8_t getAddressSize() const override { return AddressSize; } const DWARFSection &getInfoSection() override { return InfoSection; }