<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>