<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 5:12 PM, Frédéric Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Oct 7, 2014, at 4:45 PM, Alexey Samsonov <<a href="mailto:vonosmas@gmail.com">vonosmas@gmail.com</a>> wrote:<br>
><br>
> Author: samsonov<br>
> Date: Tue Oct  7 18:45:11 2014<br>
> New Revision: 219252<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=219252&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=219252&view=rev</a><br>
> Log:<br>
> [DebugInfo] Turn DWARFContext::Section into DWARFSection (NFC).<br>
><br>
> It would be more convenient to pass DWARFSection into DWARFUnitSection<br>
> constructor, instead of passing its components (Data and RelocAddrMap)<br>
> as a separate arguments.<br>
<br>
</span>Thanks! I had something similar lying in my DWARFUnitSection branch waiting that I switch to it again. I suppose you'll also commit the followup that uses DWARFSection in DWARFUnitSectionBase::parse* ?<br></blockquote><div><br></div><div>Yep, these changes should be in now.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Fred<br>
<div class="HOEnZb"><div class="h5"><br>
> Added:<br>
>    llvm/trunk/lib/DebugInfo/DWARFSection.h<br>
> Modified:<br>
>    llvm/trunk/lib/DebugInfo/DWARFContext.h<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/DWARFContext.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=219252&r1=219251&r2=219252&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=219252&r1=219251&r2=219252&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/DWARFContext.h (original)<br>
> +++ llvm/trunk/lib/DebugInfo/DWARFContext.h Tue Oct  7 18:45:11 2014<br>
> @@ -16,6 +16,7 @@<br>
> #include "DWARFDebugLine.h"<br>
> #include "DWARFDebugLoc.h"<br>
> #include "DWARFDebugRangeList.h"<br>
> +#include "DWARFSection.h"<br>
> #include "DWARFTypeUnit.h"<br>
> #include "llvm/ADT/MapVector.h"<br>
> #include "llvm/ADT/SmallVector.h"<br>
> @@ -63,11 +64,6 @@ class DWARFContext : public DIContext {<br>
>   void parseDWOTypeUnits();<br>
><br>
> public:<br>
> -  struct Section {<br>
> -    StringRef Data;<br>
> -    RelocAddrMap Relocs;<br>
> -  };<br>
> -<br>
>   DWARFContext() : DIContext(CK_DWARF) {}<br>
><br>
>   static bool classof(const DIContext *DICtx) {<br>
> @@ -170,17 +166,15 @@ public:<br>
><br>
>   virtual bool isLittleEndian() const = 0;<br>
>   virtual uint8_t getAddressSize() const = 0;<br>
> -  virtual const Section &getInfoSection() = 0;<br>
> -  typedef MapVector<object::SectionRef, Section,<br>
> -                    std::map<object::SectionRef, unsigned> > TypeSectionMap;<br>
> +  virtual const DWARFSection &getInfoSection() = 0;<br>
> +  typedef MapVector<object::SectionRef, DWARFSection,<br>
> +                    std::map<object::SectionRef, unsigned>> TypeSectionMap;<br>
>   virtual const TypeSectionMap &getTypesSections() = 0;<br>
>   virtual StringRef getAbbrevSection() = 0;<br>
> -  virtual const Section &getLocSection() = 0;<br>
> -  virtual const Section &getLocDWOSection() = 0;<br>
> +  virtual const DWARFSection &getLocSection() = 0;<br>
>   virtual StringRef getARangeSection() = 0;<br>
>   virtual StringRef getDebugFrameSection() = 0;<br>
> -  virtual const Section &getLineSection() = 0;<br>
> -  virtual const Section &getLineDWOSection() = 0;<br>
> +  virtual const DWARFSection &getLineSection() = 0;<br>
>   virtual StringRef getStringSection() = 0;<br>
>   virtual StringRef getRangeSection() = 0;<br>
>   virtual StringRef getPubNamesSection() = 0;<br>
> @@ -189,9 +183,11 @@ public:<br>
>   virtual StringRef getGnuPubTypesSection() = 0;<br>
><br>
>   // Sections for DWARF5 split dwarf proposal.<br>
> -  virtual const Section &getInfoDWOSection() = 0;<br>
> +  virtual const DWARFSection &getInfoDWOSection() = 0;<br>
>   virtual const TypeSectionMap &getTypesDWOSections() = 0;<br>
>   virtual StringRef getAbbrevDWOSection() = 0;<br>
> +  virtual const DWARFSection &getLineDWOSection() = 0;<br>
> +  virtual const DWARFSection &getLocDWOSection() = 0;<br>
>   virtual StringRef getStringDWOSection() = 0;<br>
>   virtual StringRef getStringOffsetDWOSection() = 0;<br>
>   virtual StringRef getRangeDWOSection() = 0;<br>
> @@ -216,15 +212,13 @@ class DWARFContextInMemory : public DWAR<br>
>   virtual void anchor();<br>
>   bool IsLittleEndian;<br>
>   uint8_t AddressSize;<br>
> -  Section InfoSection;<br>
> +  DWARFSection InfoSection;<br>
>   TypeSectionMap TypesSections;<br>
>   StringRef AbbrevSection;<br>
> -  Section LocSection;<br>
> -  Section LocDWOSection;<br>
> +  DWARFSection LocSection;<br>
>   StringRef ARangeSection;<br>
>   StringRef DebugFrameSection;<br>
> -  Section LineSection;<br>
> -  Section LineDWOSection;<br>
> +  DWARFSection LineSection;<br>
>   StringRef StringSection;<br>
>   StringRef RangeSection;<br>
>   StringRef PubNamesSection;<br>
> @@ -233,9 +227,11 @@ class DWARFContextInMemory : public DWAR<br>
>   StringRef GnuPubTypesSection;<br>
><br>
>   // Sections for DWARF5 split dwarf proposal.<br>
> -  Section InfoDWOSection;<br>
> +  DWARFSection InfoDWOSection;<br>
>   TypeSectionMap TypesDWOSections;<br>
>   StringRef AbbrevDWOSection;<br>
> +  DWARFSection LineDWOSection;<br>
> +  DWARFSection LocDWOSection;<br>
>   StringRef StringDWOSection;<br>
>   StringRef StringOffsetDWOSection;<br>
>   StringRef RangeDWOSection;<br>
> @@ -247,15 +243,13 @@ public:<br>
>   DWARFContextInMemory(object::ObjectFile &);<br>
>   bool isLittleEndian() const override { return IsLittleEndian; }<br>
>   uint8_t getAddressSize() const override { return AddressSize; }<br>
> -  const Section &getInfoSection() override { return InfoSection; }<br>
> +  const DWARFSection &getInfoSection() override { return InfoSection; }<br>
>   const TypeSectionMap &getTypesSections() override { return TypesSections; }<br>
>   StringRef getAbbrevSection() override { return AbbrevSection; }<br>
> -  const Section &getLocSection() override { return LocSection; }<br>
> -  const Section &getLocDWOSection() override { return LocDWOSection; }<br>
> +  const DWARFSection &getLocSection() override { return LocSection; }<br>
>   StringRef getARangeSection() override { return ARangeSection; }<br>
>   StringRef getDebugFrameSection() override { return DebugFrameSection; }<br>
> -  const Section &getLineSection() override { return LineSection; }<br>
> -  const Section &getLineDWOSection() override { return LineDWOSection; }<br>
> +  const DWARFSection &getLineSection() override { return LineSection; }<br>
>   StringRef getStringSection() override { return StringSection; }<br>
>   StringRef getRangeSection() override { return RangeSection; }<br>
>   StringRef getPubNamesSection() override { return PubNamesSection; }<br>
> @@ -264,11 +258,13 @@ public:<br>
>   StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; }<br>
><br>
>   // Sections for DWARF5 split dwarf proposal.<br>
> -  const Section &getInfoDWOSection() override { return InfoDWOSection; }<br>
> +  const DWARFSection &getInfoDWOSection() override { return InfoDWOSection; }<br>
>   const TypeSectionMap &getTypesDWOSections() override {<br>
>     return TypesDWOSections;<br>
>   }<br>
>   StringRef getAbbrevDWOSection() override { return AbbrevDWOSection; }<br>
> +  const DWARFSection &getLineDWOSection() override { return LineDWOSection; }<br>
> +  const DWARFSection &getLocDWOSection() override { return LocDWOSection; }<br>
>   StringRef getStringDWOSection() override { return StringDWOSection; }<br>
>   StringRef getStringOffsetDWOSection() override {<br>
>     return StringOffsetDWOSection;<br>
><br>
> Added: llvm/trunk/lib/DebugInfo/DWARFSection.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFSection.h?rev=219252&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFSection.h?rev=219252&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/DWARFSection.h (added)<br>
> +++ llvm/trunk/lib/DebugInfo/DWARFSection.h Tue Oct  7 18:45:11 2014<br>
> @@ -0,0 +1,24 @@<br>
> +//===-- DWARFSection.h ------------------------------------------*- C++ -*-===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open Source<br>
> +// License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +#ifndef LLVM_LIB_DEBUGINFO_DWARFSECTION_H<br>
> +#define LLVM_LIB_DEBUGINFO_DWARFSECTION_H<br>
> +<br>
> +#include "DWARFRelocMap.h"<br>
> +<br>
> +namespace llvm {<br>
> +<br>
> +struct DWARFSection {<br>
> +  StringRef Data;<br>
> +  RelocAddrMap Relocs;<br>
> +};<br>
> +<br>
> +}<br>
> +<br>
> +#endif<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div></div>