<div dir="ltr">Probably worth mentioning in the commit message what the specific warning/error was, and how it's being fixed. Helps with code review/understanding what the goals are, etc.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 23, 2020 at 7:45 AM Michael Liao via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Michael Liao<br>
Date: 2020-01-23T10:45:02-05:00<br>
New Revision: 398175e5c718ab2a92eded571f669f3b6e036e75<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/398175e5c718ab2a92eded571f669f3b6e036e75" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/398175e5c718ab2a92eded571f669f3b6e036e75</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/398175e5c718ab2a92eded571f669f3b6e036e75.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/398175e5c718ab2a92eded571f669f3b6e036e75.diff</a><br>
<br>
LOG: Fix GCC warning/error '-fpermission'. NFC.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
  llvm/include/llvm/DWARFLinker/DWARFLinker.h<br>
  llvm/lib/DWARFLinker/DWARFLinker.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h<br>
index 84618d8fe6ac..f438ed5d6117 100644<br>
--- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h<br>
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h<br>
@@ -245,7 +245,8 @@ class DWARFLinker {<br>
 public:<br>
  DWARFLinker(const Triple &Triple, DwarfEmitter *Emitter,<br>
        DwarfLinkerClient ClientID = DwarfLinkerClient::General)<br>
-Â Â Â : Triple(Triple), DwarfEmitter(Emitter), DwarfLinkerClientID(ClientID) {}<br>
+Â Â Â : TheTriple(Triple), TheDwarfEmitter(Emitter),<br>
+Â Â Â Â DwarfLinkerClientID(ClientID) {}<br>
<br>
  /// Add object file to be linked.<br>
  void addObjectFile(DwarfLinkerObjFile &ObjFile);<br>
@@ -597,8 +598,6 @@ class DWARFLinker {<br>
    AttributesInfo() = default;<br>
   };<br>
<br>
-Â Â friend DIECloner;<br>
-<br>
   /// Helper for cloneDIE.<br>
   unsigned cloneAttribute(DIE &Die, const DWARFDie &InputDIE,<br>
               const DwarfLinkerObjFile &OF, CompileUnit &U,<br>
@@ -719,9 +718,9 @@ class DWARFLinker {<br>
  BumpPtrAllocator DIEAlloc;<br>
  /// @}<br>
<br>
-Â Triple Triple;<br>
+Â Triple TheTriple;<br>
<br>
-Â DwarfEmitter *DwarfEmitter;<br>
+Â DwarfEmitter *TheDwarfEmitter;<br>
  std::vector<LinkContext> ObjectContexts;<br>
<br>
  unsigned MaxDwarfVersion = 0;<br>
<br>
diff --git a/llvm/lib/DWARFLinker/DWARFLinker.cpp b/llvm/lib/DWARFLinker/DWARFLinker.cpp<br>
index 84f866293ce2..a9fe0564c68d 100644<br>
--- a/llvm/lib/DWARFLinker/DWARFLinker.cpp<br>
+++ b/llvm/lib/DWARFLinker/DWARFLinker.cpp<br>
@@ -1437,7 +1437,7 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,<br>
<br>
  for (const auto &RangeAttribute : Unit.getRangesAttributes()) {<br>
   uint64_t Offset = RangeAttribute.get();<br>
-Â Â RangeAttribute.set(DwarfEmitter->getRangesSectionSize());<br>
+Â Â RangeAttribute.set(TheDwarfEmitter->getRangesSectionSize());<br>
   if (Error E = RangeList.extract(RangeExtractor, &Offset)) {<br>
    llvm::consumeError(std::move(E));<br>
    reportWarning("invalid range list ignored.", OF);<br>
@@ -1459,8 +1459,8 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,<br>
    }<br>
   }<br>
<br>
-Â Â DwarfEmitter->emitRangesEntries(UnitPcOffset, OrigLowPc, CurrRange, Entries,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â AddressSize);<br>
+Â Â TheDwarfEmitter->emitRangesEntries(UnitPcOffset, OrigLowPc, CurrRange,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Entries, AddressSize);<br>
  }<br>
 }<br>
<br>
@@ -1473,8 +1473,8 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,<br>
 void DWARFLinker::generateUnitRanges(CompileUnit &Unit) const {<br>
  auto Attr = Unit.getUnitRangesAttribute();<br>
  if (Attr)<br>
-Â Â Attr->set(DwarfEmitter->getRangesSectionSize());<br>
-Â DwarfEmitter->emitUnitRangesEntries(Unit, static_cast<bool>(Attr));<br>
+Â Â Attr->set(TheDwarfEmitter->getRangesSectionSize());<br>
+Â TheDwarfEmitter->emitUnitRangesEntries(Unit, static_cast<bool>(Attr));<br>
 }<br>
<br>
 /// Insert the new line info sequence \p Seq into the current<br>
@@ -1532,7 +1532,8 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,<br>
<br>
  // Update the cloned DW_AT_stmt_list with the correct debug_line offset.<br>
  if (auto *OutputDIE = Unit.getOutputUnitDIE())<br>
-Â Â patchStmtList(*OutputDIE, DIEInteger(DwarfEmitter->getLineSectionSize()));<br>
+Â Â patchStmtList(*OutputDIE,<br>
+Â Â Â Â Â Â Â Â Â DIEInteger(TheDwarfEmitter->getLineSectionSize()));<br>
<br>
  RangesTy &Ranges = OF.Addresses->getValidAddressRanges();<br>
<br>
@@ -1543,7 +1544,7 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,<br>
    OrigDwarf.getDWARFObj(), OrigDwarf.getDWARFObj().getLineSection(),<br>
    OrigDwarf.isLittleEndian(), Unit.getOrigUnit().getAddressByteSize());<br>
  if (needToTranslateStrings())<br>
-Â Â return DwarfEmitter->translateLineTable(LineExtractor, StmtOffset);<br>
+Â Â return TheDwarfEmitter->translateLineTable(LineExtractor, StmtOffset);<br>
<br>
  Error Err = LineTable.parse(LineExtractor, &StmtOffset, OrigDwarf,<br>
                &Unit.getOrigUnit(), DWARFContext::dumpWarning);<br>
@@ -1656,7 +1657,7 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,<br>
   Params.DWARF2LineOpcodeBase = LineTable.Prologue.OpcodeBase;<br>
   Params.DWARF2LineBase = LineTable.Prologue.LineBase;<br>
   Params.DWARF2LineRange = LineTable.Prologue.LineRange;<br>
-Â Â DwarfEmitter->emitLineTableForUnit(<br>
+Â Â TheDwarfEmitter->emitLineTableForUnit(<br>
     Params, LineData.slice(*StmtList + 4, PrologueEnd),<br>
     LineTable.Prologue.MinInstLength, NewRows,<br>
     Unit.getOrigUnit().getAddressByteSize());<br>
@@ -1684,13 +1685,13 @@ void DWARFLinker::emitAppleAcceleratorEntriesForUnit(CompileUnit &Unit) {<br>
               Namespace.Die->getOffset() + Unit.getStartOffset());<br>
<br>
  /// Add names.<br>
-Â DwarfEmitter->emitPubNamesForUnit(Unit);<br>
+Â TheDwarfEmitter->emitPubNamesForUnit(Unit);<br>
  for (const auto &Pubname : Unit.getPubnames())<br>
   AppleNames.addName(Pubname.Name,<br>
            Pubname.Die->getOffset() + Unit.getStartOffset());<br>
<br>
  /// Add types.<br>
-Â DwarfEmitter->emitPubTypesForUnit(Unit);<br>
+Â TheDwarfEmitter->emitPubTypesForUnit(Unit);<br>
  for (const auto &Pubtype : Unit.getPubtypes())<br>
   AppleTypes.addName(<br>
     Pubtype.Name, Pubtype.Die->getOffset() + Unit.getStartOffset(),<br>
@@ -1778,7 +1779,7 @@ void DWARFLinker::patchFrameInfoForObject(const DwarfLinkerObjFile &OF,<br>
   // Look if we already emitted a CIE that corresponds to the<br>
   // referenced one (the CIE data is the key of that lookup).<br>
   auto IteratorInserted = EmittedCIEs.insert(<br>
-Â Â Â Â std::make_pair(CIEData, DwarfEmitter->getFrameSectionSize()));<br>
+Â Â Â Â std::make_pair(CIEData, TheDwarfEmitter->getFrameSectionSize()));<br>
   // If there is no CIE yet for this ID, emit it.<br>
   if (IteratorInserted.second ||<br>
     // FIXME: dsymutil-classic only caches the last used CIE for<br>
@@ -1786,18 +1787,18 @@ void DWARFLinker::patchFrameInfoForObject(const DwarfLinkerObjFile &OF,<br>
     // second half of the condition and the LastCIEOffset variable<br>
     // makes the code DTRT.<br>
     LastCIEOffset != IteratorInserted.first->getValue()) {<br>
-Â Â Â LastCIEOffset = DwarfEmitter->getFrameSectionSize();<br>
+Â Â Â LastCIEOffset = TheDwarfEmitter->getFrameSectionSize();<br>
    IteratorInserted.first->getValue() = LastCIEOffset;<br>
-Â Â Â DwarfEmitter->emitCIE(CIEData);<br>
+Â Â Â TheDwarfEmitter->emitCIE(CIEData);<br>
   }<br>
<br>
   // Emit the FDE with updated address and CIE pointer.<br>
   // (4 + AddrSize) is the size of the CIEId + initial_location<br>
   // fields that will get reconstructed by emitFDE().<br>
   unsigned FDERemainingBytes = InitialLength - (4 + AddrSize);<br>
-Â Â DwarfEmitter->emitFDE(IteratorInserted.first->getValue(), AddrSize,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Loc + Range->second.Offset,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â FrameData.substr(InputOffset, FDERemainingBytes));<br>
+Â Â TheDwarfEmitter->emitFDE(IteratorInserted.first->getValue(), AddrSize,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Loc + Range->second.Offset,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â FrameData.substr(InputOffset, FDERemainingBytes));<br>
   InputOffset += FDERemainingBytes;<br>
  }<br>
 }<br>
@@ -2008,8 +2009,8 @@ Error DWARFLinker::loadClangModule(<br>
<br>
  UnitListTy CompileUnits;<br>
  CompileUnits.push_back(std::move(Unit));<br>
-Â assert(DwarfEmitter);<br>
-Â DIECloner(*this, DwarfEmitter, *ErrOrObj, DIEAlloc, CompileUnits,<br>
+Â assert(TheDwarfEmitter);<br>
+Â DIECloner(*this, TheDwarfEmitter, *ErrOrObj, DIEAlloc, CompileUnits,<br>
       Options.Update)<br>
    .cloneAllCompileUnits(*DwarfContext, OF, StringPool, IsLittleEndian);<br>
  return Error::success();<br>
@@ -2166,18 +2167,18 @@ bool DWARFLinker::emitPaperTrailWarnings(const DwarfLinkerObjFile &OF,<br>
   Size += getULEB128Size(Abbrev.getNumber());<br>
  }<br>
  CUDie->setSize(Size);<br>
-Â DwarfEmitter->emitPaperTrailWarningsDie(Triple, *CUDie);<br>
+Â TheDwarfEmitter->emitPaperTrailWarningsDie(TheTriple, *CUDie);<br>
<br>
  return true;<br>
 }<br>
<br>
 void DWARFLinker::copyInvariantDebugSection(const object::ObjectFile &Obj) {<br>
  if (!needToTranslateStrings())<br>
-Â Â DwarfEmitter->emitSectionContents(Obj, "debug_line");<br>
-Â DwarfEmitter->emitSectionContents(Obj, "debug_loc");<br>
-Â DwarfEmitter->emitSectionContents(Obj, "debug_ranges");<br>
-Â DwarfEmitter->emitSectionContents(Obj, "debug_frame");<br>
-Â DwarfEmitter->emitSectionContents(Obj, "debug_aranges");<br>
+Â Â TheDwarfEmitter->emitSectionContents(Obj, "debug_line");<br>
+Â TheDwarfEmitter->emitSectionContents(Obj, "debug_loc");<br>
+Â TheDwarfEmitter->emitSectionContents(Obj, "debug_ranges");<br>
+Â TheDwarfEmitter->emitSectionContents(Obj, "debug_frame");<br>
+Â TheDwarfEmitter->emitSectionContents(Obj, "debug_aranges");<br>
 }<br>
<br>
 void DWARFLinker::addObjectFile(DwarfLinkerObjFile &ObjFile) {<br>
@@ -2188,7 +2189,7 @@ void DWARFLinker::addObjectFile(DwarfLinkerObjFile &ObjFile) {<br>
 }<br>
<br>
 bool DWARFLinker::link() {<br>
-Â assert(Options.NoOutput || DwarfEmitter);<br>
+Â assert(Options.NoOutput || TheDwarfEmitter);<br>
<br>
  // A unique ID that identifies each compile unit.<br>
  unsigned UnitID = 0;<br>
@@ -2287,7 +2288,7 @@ bool DWARFLinker::link() {<br>
  // later. This prevents undeterminism when analyze and clone execute<br>
  // concurrently, as clone set the canonical DIE offset and analyze reads it.<br>
  const uint64_t ModulesEndOffset =<br>
-Â Â Â Options.NoOutput ? 0 : DwarfEmitter->getDebugInfoSectionSize();<br>
+Â Â Â Options.NoOutput ? 0 : TheDwarfEmitter->getDebugInfoSectionSize();<br>
<br>
  // These variables manage the list of processed object files.<br>
  // The mutex and condition variable are to ensure that this is thread safe.<br>
@@ -2369,7 +2370,7 @@ bool DWARFLinker::link() {<br>
   // need to reset the NextValidReloc index to the beginning.<br>
   if (OptContext.ObjectFile.Addresses->hasValidRelocs() ||<br>
     LLVM_UNLIKELY(Options.Update)) {<br>
-Â Â Â DIECloner(*this, DwarfEmitter, OptContext.ObjectFile, DIEAlloc,<br>
+Â Â Â DIECloner(*this, TheDwarfEmitter, OptContext.ObjectFile, DIEAlloc,<br>
         OptContext.CompileUnits, Options.Update)<br>
      .cloneAllCompileUnits(*OptContext.DwarfContext, OptContext.ObjectFile,<br>
                 OffsetsStringPool,<br>
@@ -2390,17 +2391,17 @@ bool DWARFLinker::link() {<br>
  auto EmitLambda = [&]() {<br>
   // Emit everything that's global.<br>
   if (!Options.NoOutput) {<br>
-Â Â Â DwarfEmitter->emitAbbrevs(Abbreviations, MaxDwarfVersion);<br>
-Â Â Â DwarfEmitter->emitStrings(OffsetsStringPool);<br>
+Â Â Â TheDwarfEmitter->emitAbbrevs(Abbreviations, MaxDwarfVersion);<br>
+Â Â Â TheDwarfEmitter->emitStrings(OffsetsStringPool);<br>
    switch (Options.TheAccelTableKind) {<br>
    case AccelTableKind::Apple:<br>
-Â Â Â Â DwarfEmitter->emitAppleNames(AppleNames);<br>
-Â Â Â Â DwarfEmitter->emitAppleNamespaces(AppleNamespaces);<br>
-Â Â Â Â DwarfEmitter->emitAppleTypes(AppleTypes);<br>
-Â Â Â Â DwarfEmitter->emitAppleObjc(AppleObjc);<br>
+Â Â Â Â TheDwarfEmitter->emitAppleNames(AppleNames);<br>
+Â Â Â Â TheDwarfEmitter->emitAppleNamespaces(AppleNamespaces);<br>
+Â Â Â Â TheDwarfEmitter->emitAppleTypes(AppleTypes);<br>
+Â Â Â Â TheDwarfEmitter->emitAppleObjc(AppleObjc);<br>
     break;<br>
    case AccelTableKind::Dwarf:<br>
-Â Â Â Â DwarfEmitter->emitDebugNames(DebugNames);<br>
+Â Â Â Â TheDwarfEmitter->emitDebugNames(DebugNames);<br>
     break;<br>
    case AccelTableKind::Default:<br>
     llvm_unreachable("Default should have already been resolved.");<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>