[llvm] r220228 - Constify input argument of RelocVisitor and DWARFContext constructors. NFC.

Alexey Samsonov vonosmas at gmail.com
Mon Oct 20 13:28:51 PDT 2014


Author: samsonov
Date: Mon Oct 20 15:28:51 2014
New Revision: 220228

URL: http://llvm.org/viewvc/llvm-project?rev=220228&view=rev
Log:
Constify input argument of RelocVisitor and DWARFContext constructors. NFC.

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

Modified: llvm/trunk/include/llvm/DebugInfo/DIContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DIContext.h?rev=220228&r1=220227&r2=220228&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DIContext.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DIContext.h Mon Oct 20 15:28:51 2014
@@ -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;
 

Modified: llvm/trunk/include/llvm/Object/RelocVisitor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/RelocVisitor.h?rev=220228&r1=220227&r2=220228&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/RelocVisitor.h (original)
+++ llvm/trunk/include/llvm/Object/RelocVisitor.h Mon Oct 20 15:28:51 2014
@@ -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) {

Modified: llvm/trunk/lib/DebugInfo/DIContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DIContext.cpp?rev=220228&r1=220227&r2=220228&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DIContext.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DIContext.cpp Mon Oct 20 15:28:51 2014
@@ -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);
 }

Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=220228&r1=220227&r2=220228&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFContext.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARFContext.cpp Mon Oct 20 15:28:51 2014
@@ -509,7 +509,7 @@ static bool consumeCompressedDebugSectio
   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()) {

Modified: llvm/trunk/lib/DebugInfo/DWARFContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=220228&r1=220227&r2=220228&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARFContext.h (original)
+++ llvm/trunk/lib/DebugInfo/DWARFContext.h Mon Oct 20 15:28:51 2014
@@ -240,7 +240,7 @@ class DWARFContextInMemory : public DWAR
   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; }





More information about the llvm-commits mailing list