Constify input argument of RelocVisitor and DWARFContext constructors. NFC.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 20 Oct 2014 20:28:51 +0000 (20:28 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 20 Oct 2014 20:28:51 +0000 (20:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220228 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/DIContext.h
include/llvm/Object/RelocVisitor.h
lib/DebugInfo/DIContext.cpp
lib/DebugInfo/DWARFContext.cpp
lib/DebugInfo/DWARFContext.h

index 160d450c08eb4fb074afaed94cd884312bf5e6d3..3ef541aa3035a2f2e8fe0b9e72034f2e80e4eb94 100644 (file)
@@ -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;
 
index 4fffd7eec28c4516d9ab239b1dc2c69ae6ed60ba..91eafd55ad766a49099e28ebfbdff6feca183fe4 100644 (file)
@@ -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) {
index 29ef8f29f14713ef41fdee07e3eb1e17d78d4d97..01aecf8226e19d0b20921e40b1caa38f9a82ea14 100644 (file)
@@ -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);
 }
index 830db66098c008ae0a2667e310eb0ac70d950e41..aa86f6aac0312b47bad723460d8d1dde69c177f5 100644 (file)
@@ -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()) {
index 05c6accd2e4305d5a631827b936f0bb03ee74f01..c4586b0d4c1f7a703b31f9bf41b95799aa2f2263 100644 (file)
@@ -240,7 +240,7 @@ class DWARFContextInMemory : public DWARFContext {
   SmallVector<SmallString<32>, 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; }