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