mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
Fix GCC warning/error '-fpermission'. NFC.
This commit is contained in:
parent
0d83f9aecc
commit
2c5a63a728
@ -245,7 +245,8 @@ class DWARFLinker {
|
|||||||
public:
|
public:
|
||||||
DWARFLinker(const Triple &Triple, DwarfEmitter *Emitter,
|
DWARFLinker(const Triple &Triple, DwarfEmitter *Emitter,
|
||||||
DwarfLinkerClient ClientID = DwarfLinkerClient::General)
|
DwarfLinkerClient ClientID = DwarfLinkerClient::General)
|
||||||
: Triple(Triple), DwarfEmitter(Emitter), DwarfLinkerClientID(ClientID) {}
|
: TheTriple(Triple), TheDwarfEmitter(Emitter),
|
||||||
|
DwarfLinkerClientID(ClientID) {}
|
||||||
|
|
||||||
/// Add object file to be linked.
|
/// Add object file to be linked.
|
||||||
void addObjectFile(DwarfLinkerObjFile &ObjFile);
|
void addObjectFile(DwarfLinkerObjFile &ObjFile);
|
||||||
@ -597,8 +598,6 @@ private:
|
|||||||
AttributesInfo() = default;
|
AttributesInfo() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
friend DIECloner;
|
|
||||||
|
|
||||||
/// Helper for cloneDIE.
|
/// Helper for cloneDIE.
|
||||||
unsigned cloneAttribute(DIE &Die, const DWARFDie &InputDIE,
|
unsigned cloneAttribute(DIE &Die, const DWARFDie &InputDIE,
|
||||||
const DwarfLinkerObjFile &OF, CompileUnit &U,
|
const DwarfLinkerObjFile &OF, CompileUnit &U,
|
||||||
@ -719,9 +718,9 @@ private:
|
|||||||
BumpPtrAllocator DIEAlloc;
|
BumpPtrAllocator DIEAlloc;
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
Triple Triple;
|
Triple TheTriple;
|
||||||
|
|
||||||
DwarfEmitter *DwarfEmitter;
|
DwarfEmitter *TheDwarfEmitter;
|
||||||
std::vector<LinkContext> ObjectContexts;
|
std::vector<LinkContext> ObjectContexts;
|
||||||
|
|
||||||
unsigned MaxDwarfVersion = 0;
|
unsigned MaxDwarfVersion = 0;
|
||||||
|
@ -1437,7 +1437,7 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,
|
|||||||
|
|
||||||
for (const auto &RangeAttribute : Unit.getRangesAttributes()) {
|
for (const auto &RangeAttribute : Unit.getRangesAttributes()) {
|
||||||
uint64_t Offset = RangeAttribute.get();
|
uint64_t Offset = RangeAttribute.get();
|
||||||
RangeAttribute.set(DwarfEmitter->getRangesSectionSize());
|
RangeAttribute.set(TheDwarfEmitter->getRangesSectionSize());
|
||||||
if (Error E = RangeList.extract(RangeExtractor, &Offset)) {
|
if (Error E = RangeList.extract(RangeExtractor, &Offset)) {
|
||||||
llvm::consumeError(std::move(E));
|
llvm::consumeError(std::move(E));
|
||||||
reportWarning("invalid range list ignored.", OF);
|
reportWarning("invalid range list ignored.", OF);
|
||||||
@ -1459,8 +1459,8 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DwarfEmitter->emitRangesEntries(UnitPcOffset, OrigLowPc, CurrRange, Entries,
|
TheDwarfEmitter->emitRangesEntries(UnitPcOffset, OrigLowPc, CurrRange,
|
||||||
AddressSize);
|
Entries, AddressSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1473,8 +1473,8 @@ void DWARFLinker::patchRangesForUnit(const CompileUnit &Unit,
|
|||||||
void DWARFLinker::generateUnitRanges(CompileUnit &Unit) const {
|
void DWARFLinker::generateUnitRanges(CompileUnit &Unit) const {
|
||||||
auto Attr = Unit.getUnitRangesAttribute();
|
auto Attr = Unit.getUnitRangesAttribute();
|
||||||
if (Attr)
|
if (Attr)
|
||||||
Attr->set(DwarfEmitter->getRangesSectionSize());
|
Attr->set(TheDwarfEmitter->getRangesSectionSize());
|
||||||
DwarfEmitter->emitUnitRangesEntries(Unit, static_cast<bool>(Attr));
|
TheDwarfEmitter->emitUnitRangesEntries(Unit, static_cast<bool>(Attr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Insert the new line info sequence \p Seq into the current
|
/// Insert the new line info sequence \p Seq into the current
|
||||||
@ -1532,7 +1532,8 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,
|
|||||||
|
|
||||||
// Update the cloned DW_AT_stmt_list with the correct debug_line offset.
|
// Update the cloned DW_AT_stmt_list with the correct debug_line offset.
|
||||||
if (auto *OutputDIE = Unit.getOutputUnitDIE())
|
if (auto *OutputDIE = Unit.getOutputUnitDIE())
|
||||||
patchStmtList(*OutputDIE, DIEInteger(DwarfEmitter->getLineSectionSize()));
|
patchStmtList(*OutputDIE,
|
||||||
|
DIEInteger(TheDwarfEmitter->getLineSectionSize()));
|
||||||
|
|
||||||
RangesTy &Ranges = OF.Addresses->getValidAddressRanges();
|
RangesTy &Ranges = OF.Addresses->getValidAddressRanges();
|
||||||
|
|
||||||
@ -1543,7 +1544,7 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,
|
|||||||
OrigDwarf.getDWARFObj(), OrigDwarf.getDWARFObj().getLineSection(),
|
OrigDwarf.getDWARFObj(), OrigDwarf.getDWARFObj().getLineSection(),
|
||||||
OrigDwarf.isLittleEndian(), Unit.getOrigUnit().getAddressByteSize());
|
OrigDwarf.isLittleEndian(), Unit.getOrigUnit().getAddressByteSize());
|
||||||
if (needToTranslateStrings())
|
if (needToTranslateStrings())
|
||||||
return DwarfEmitter->translateLineTable(LineExtractor, StmtOffset);
|
return TheDwarfEmitter->translateLineTable(LineExtractor, StmtOffset);
|
||||||
|
|
||||||
Error Err = LineTable.parse(LineExtractor, &StmtOffset, OrigDwarf,
|
Error Err = LineTable.parse(LineExtractor, &StmtOffset, OrigDwarf,
|
||||||
&Unit.getOrigUnit(), DWARFContext::dumpWarning);
|
&Unit.getOrigUnit(), DWARFContext::dumpWarning);
|
||||||
@ -1656,7 +1657,7 @@ void DWARFLinker::patchLineTableForUnit(CompileUnit &Unit,
|
|||||||
Params.DWARF2LineOpcodeBase = LineTable.Prologue.OpcodeBase;
|
Params.DWARF2LineOpcodeBase = LineTable.Prologue.OpcodeBase;
|
||||||
Params.DWARF2LineBase = LineTable.Prologue.LineBase;
|
Params.DWARF2LineBase = LineTable.Prologue.LineBase;
|
||||||
Params.DWARF2LineRange = LineTable.Prologue.LineRange;
|
Params.DWARF2LineRange = LineTable.Prologue.LineRange;
|
||||||
DwarfEmitter->emitLineTableForUnit(
|
TheDwarfEmitter->emitLineTableForUnit(
|
||||||
Params, LineData.slice(*StmtList + 4, PrologueEnd),
|
Params, LineData.slice(*StmtList + 4, PrologueEnd),
|
||||||
LineTable.Prologue.MinInstLength, NewRows,
|
LineTable.Prologue.MinInstLength, NewRows,
|
||||||
Unit.getOrigUnit().getAddressByteSize());
|
Unit.getOrigUnit().getAddressByteSize());
|
||||||
@ -1684,13 +1685,13 @@ void DWARFLinker::emitAppleAcceleratorEntriesForUnit(CompileUnit &Unit) {
|
|||||||
Namespace.Die->getOffset() + Unit.getStartOffset());
|
Namespace.Die->getOffset() + Unit.getStartOffset());
|
||||||
|
|
||||||
/// Add names.
|
/// Add names.
|
||||||
DwarfEmitter->emitPubNamesForUnit(Unit);
|
TheDwarfEmitter->emitPubNamesForUnit(Unit);
|
||||||
for (const auto &Pubname : Unit.getPubnames())
|
for (const auto &Pubname : Unit.getPubnames())
|
||||||
AppleNames.addName(Pubname.Name,
|
AppleNames.addName(Pubname.Name,
|
||||||
Pubname.Die->getOffset() + Unit.getStartOffset());
|
Pubname.Die->getOffset() + Unit.getStartOffset());
|
||||||
|
|
||||||
/// Add types.
|
/// Add types.
|
||||||
DwarfEmitter->emitPubTypesForUnit(Unit);
|
TheDwarfEmitter->emitPubTypesForUnit(Unit);
|
||||||
for (const auto &Pubtype : Unit.getPubtypes())
|
for (const auto &Pubtype : Unit.getPubtypes())
|
||||||
AppleTypes.addName(
|
AppleTypes.addName(
|
||||||
Pubtype.Name, Pubtype.Die->getOffset() + Unit.getStartOffset(),
|
Pubtype.Name, Pubtype.Die->getOffset() + Unit.getStartOffset(),
|
||||||
@ -1778,7 +1779,7 @@ void DWARFLinker::patchFrameInfoForObject(const DwarfLinkerObjFile &OF,
|
|||||||
// Look if we already emitted a CIE that corresponds to the
|
// Look if we already emitted a CIE that corresponds to the
|
||||||
// referenced one (the CIE data is the key of that lookup).
|
// referenced one (the CIE data is the key of that lookup).
|
||||||
auto IteratorInserted = EmittedCIEs.insert(
|
auto IteratorInserted = EmittedCIEs.insert(
|
||||||
std::make_pair(CIEData, DwarfEmitter->getFrameSectionSize()));
|
std::make_pair(CIEData, TheDwarfEmitter->getFrameSectionSize()));
|
||||||
// If there is no CIE yet for this ID, emit it.
|
// If there is no CIE yet for this ID, emit it.
|
||||||
if (IteratorInserted.second ||
|
if (IteratorInserted.second ||
|
||||||
// FIXME: dsymutil-classic only caches the last used CIE for
|
// FIXME: dsymutil-classic only caches the last used CIE for
|
||||||
@ -1786,18 +1787,18 @@ void DWARFLinker::patchFrameInfoForObject(const DwarfLinkerObjFile &OF,
|
|||||||
// second half of the condition and the LastCIEOffset variable
|
// second half of the condition and the LastCIEOffset variable
|
||||||
// makes the code DTRT.
|
// makes the code DTRT.
|
||||||
LastCIEOffset != IteratorInserted.first->getValue()) {
|
LastCIEOffset != IteratorInserted.first->getValue()) {
|
||||||
LastCIEOffset = DwarfEmitter->getFrameSectionSize();
|
LastCIEOffset = TheDwarfEmitter->getFrameSectionSize();
|
||||||
IteratorInserted.first->getValue() = LastCIEOffset;
|
IteratorInserted.first->getValue() = LastCIEOffset;
|
||||||
DwarfEmitter->emitCIE(CIEData);
|
TheDwarfEmitter->emitCIE(CIEData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit the FDE with updated address and CIE pointer.
|
// Emit the FDE with updated address and CIE pointer.
|
||||||
// (4 + AddrSize) is the size of the CIEId + initial_location
|
// (4 + AddrSize) is the size of the CIEId + initial_location
|
||||||
// fields that will get reconstructed by emitFDE().
|
// fields that will get reconstructed by emitFDE().
|
||||||
unsigned FDERemainingBytes = InitialLength - (4 + AddrSize);
|
unsigned FDERemainingBytes = InitialLength - (4 + AddrSize);
|
||||||
DwarfEmitter->emitFDE(IteratorInserted.first->getValue(), AddrSize,
|
TheDwarfEmitter->emitFDE(IteratorInserted.first->getValue(), AddrSize,
|
||||||
Loc + Range->second.Offset,
|
Loc + Range->second.Offset,
|
||||||
FrameData.substr(InputOffset, FDERemainingBytes));
|
FrameData.substr(InputOffset, FDERemainingBytes));
|
||||||
InputOffset += FDERemainingBytes;
|
InputOffset += FDERemainingBytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2008,8 +2009,8 @@ Error DWARFLinker::loadClangModule(
|
|||||||
|
|
||||||
UnitListTy CompileUnits;
|
UnitListTy CompileUnits;
|
||||||
CompileUnits.push_back(std::move(Unit));
|
CompileUnits.push_back(std::move(Unit));
|
||||||
assert(DwarfEmitter);
|
assert(TheDwarfEmitter);
|
||||||
DIECloner(*this, DwarfEmitter, *ErrOrObj, DIEAlloc, CompileUnits,
|
DIECloner(*this, TheDwarfEmitter, *ErrOrObj, DIEAlloc, CompileUnits,
|
||||||
Options.Update)
|
Options.Update)
|
||||||
.cloneAllCompileUnits(*DwarfContext, OF, StringPool, IsLittleEndian);
|
.cloneAllCompileUnits(*DwarfContext, OF, StringPool, IsLittleEndian);
|
||||||
return Error::success();
|
return Error::success();
|
||||||
@ -2166,18 +2167,18 @@ bool DWARFLinker::emitPaperTrailWarnings(const DwarfLinkerObjFile &OF,
|
|||||||
Size += getULEB128Size(Abbrev.getNumber());
|
Size += getULEB128Size(Abbrev.getNumber());
|
||||||
}
|
}
|
||||||
CUDie->setSize(Size);
|
CUDie->setSize(Size);
|
||||||
DwarfEmitter->emitPaperTrailWarningsDie(Triple, *CUDie);
|
TheDwarfEmitter->emitPaperTrailWarningsDie(TheTriple, *CUDie);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DWARFLinker::copyInvariantDebugSection(const object::ObjectFile &Obj) {
|
void DWARFLinker::copyInvariantDebugSection(const object::ObjectFile &Obj) {
|
||||||
if (!needToTranslateStrings())
|
if (!needToTranslateStrings())
|
||||||
DwarfEmitter->emitSectionContents(Obj, "debug_line");
|
TheDwarfEmitter->emitSectionContents(Obj, "debug_line");
|
||||||
DwarfEmitter->emitSectionContents(Obj, "debug_loc");
|
TheDwarfEmitter->emitSectionContents(Obj, "debug_loc");
|
||||||
DwarfEmitter->emitSectionContents(Obj, "debug_ranges");
|
TheDwarfEmitter->emitSectionContents(Obj, "debug_ranges");
|
||||||
DwarfEmitter->emitSectionContents(Obj, "debug_frame");
|
TheDwarfEmitter->emitSectionContents(Obj, "debug_frame");
|
||||||
DwarfEmitter->emitSectionContents(Obj, "debug_aranges");
|
TheDwarfEmitter->emitSectionContents(Obj, "debug_aranges");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DWARFLinker::addObjectFile(DwarfLinkerObjFile &ObjFile) {
|
void DWARFLinker::addObjectFile(DwarfLinkerObjFile &ObjFile) {
|
||||||
@ -2188,7 +2189,7 @@ void DWARFLinker::addObjectFile(DwarfLinkerObjFile &ObjFile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DWARFLinker::link() {
|
bool DWARFLinker::link() {
|
||||||
assert(Options.NoOutput || DwarfEmitter);
|
assert(Options.NoOutput || TheDwarfEmitter);
|
||||||
|
|
||||||
// A unique ID that identifies each compile unit.
|
// A unique ID that identifies each compile unit.
|
||||||
unsigned UnitID = 0;
|
unsigned UnitID = 0;
|
||||||
@ -2287,7 +2288,7 @@ bool DWARFLinker::link() {
|
|||||||
// later. This prevents undeterminism when analyze and clone execute
|
// later. This prevents undeterminism when analyze and clone execute
|
||||||
// concurrently, as clone set the canonical DIE offset and analyze reads it.
|
// concurrently, as clone set the canonical DIE offset and analyze reads it.
|
||||||
const uint64_t ModulesEndOffset =
|
const uint64_t ModulesEndOffset =
|
||||||
Options.NoOutput ? 0 : DwarfEmitter->getDebugInfoSectionSize();
|
Options.NoOutput ? 0 : TheDwarfEmitter->getDebugInfoSectionSize();
|
||||||
|
|
||||||
// These variables manage the list of processed object files.
|
// These variables manage the list of processed object files.
|
||||||
// The mutex and condition variable are to ensure that this is thread safe.
|
// The mutex and condition variable are to ensure that this is thread safe.
|
||||||
@ -2369,7 +2370,7 @@ bool DWARFLinker::link() {
|
|||||||
// need to reset the NextValidReloc index to the beginning.
|
// need to reset the NextValidReloc index to the beginning.
|
||||||
if (OptContext.ObjectFile.Addresses->hasValidRelocs() ||
|
if (OptContext.ObjectFile.Addresses->hasValidRelocs() ||
|
||||||
LLVM_UNLIKELY(Options.Update)) {
|
LLVM_UNLIKELY(Options.Update)) {
|
||||||
DIECloner(*this, DwarfEmitter, OptContext.ObjectFile, DIEAlloc,
|
DIECloner(*this, TheDwarfEmitter, OptContext.ObjectFile, DIEAlloc,
|
||||||
OptContext.CompileUnits, Options.Update)
|
OptContext.CompileUnits, Options.Update)
|
||||||
.cloneAllCompileUnits(*OptContext.DwarfContext, OptContext.ObjectFile,
|
.cloneAllCompileUnits(*OptContext.DwarfContext, OptContext.ObjectFile,
|
||||||
OffsetsStringPool,
|
OffsetsStringPool,
|
||||||
@ -2390,17 +2391,17 @@ bool DWARFLinker::link() {
|
|||||||
auto EmitLambda = [&]() {
|
auto EmitLambda = [&]() {
|
||||||
// Emit everything that's global.
|
// Emit everything that's global.
|
||||||
if (!Options.NoOutput) {
|
if (!Options.NoOutput) {
|
||||||
DwarfEmitter->emitAbbrevs(Abbreviations, MaxDwarfVersion);
|
TheDwarfEmitter->emitAbbrevs(Abbreviations, MaxDwarfVersion);
|
||||||
DwarfEmitter->emitStrings(OffsetsStringPool);
|
TheDwarfEmitter->emitStrings(OffsetsStringPool);
|
||||||
switch (Options.TheAccelTableKind) {
|
switch (Options.TheAccelTableKind) {
|
||||||
case AccelTableKind::Apple:
|
case AccelTableKind::Apple:
|
||||||
DwarfEmitter->emitAppleNames(AppleNames);
|
TheDwarfEmitter->emitAppleNames(AppleNames);
|
||||||
DwarfEmitter->emitAppleNamespaces(AppleNamespaces);
|
TheDwarfEmitter->emitAppleNamespaces(AppleNamespaces);
|
||||||
DwarfEmitter->emitAppleTypes(AppleTypes);
|
TheDwarfEmitter->emitAppleTypes(AppleTypes);
|
||||||
DwarfEmitter->emitAppleObjc(AppleObjc);
|
TheDwarfEmitter->emitAppleObjc(AppleObjc);
|
||||||
break;
|
break;
|
||||||
case AccelTableKind::Dwarf:
|
case AccelTableKind::Dwarf:
|
||||||
DwarfEmitter->emitDebugNames(DebugNames);
|
TheDwarfEmitter->emitDebugNames(DebugNames);
|
||||||
break;
|
break;
|
||||||
case AccelTableKind::Default:
|
case AccelTableKind::Default:
|
||||||
llvm_unreachable("Default should have already been resolved.");
|
llvm_unreachable("Default should have already been resolved.");
|
||||||
|
Loading…
Reference in New Issue
Block a user