[dsymutil] Delete unneeded parameter Triple from DWARFLinker

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D74173
This commit is contained in:
Fangrui Song 2020-02-06 14:48:28 -08:00
parent b4aff1210c
commit 6520976064
5 changed files with 8 additions and 12 deletions

View File

@ -96,7 +96,7 @@ public:
virtual ~DwarfEmitter();
/// Emit DIE containing warnings.
virtual void emitPaperTrailWarningsDie(const Triple &Triple, DIE &Die) = 0;
virtual void emitPaperTrailWarningsDie(DIE &Die) = 0;
/// Emit section named SecName with content equals to
/// corresponding section in Obj.
@ -243,10 +243,9 @@ typedef std::map<std::string, std::string> swiftInterfacesMap;
/// processing a object file.
class DWARFLinker {
public:
DWARFLinker(const Triple &Triple, DwarfEmitter *Emitter,
DWARFLinker(DwarfEmitter *Emitter,
DwarfLinkerClient ClientID = DwarfLinkerClient::General)
: TheTriple(Triple), TheDwarfEmitter(Emitter),
DwarfLinkerClientID(ClientID) {}
: TheDwarfEmitter(Emitter), DwarfLinkerClientID(ClientID) {}
/// Add object file to be linked.
void addObjectFile(DwarfLinkerObjFile &ObjFile);
@ -718,8 +717,6 @@ private:
BumpPtrAllocator DIEAlloc;
/// @}
Triple TheTriple;
DwarfEmitter *TheDwarfEmitter;
std::vector<LinkContext> ObjectContexts;

View File

@ -2165,7 +2165,7 @@ bool DWARFLinker::emitPaperTrailWarnings(const DwarfLinkerObjFile &OF,
Size += getULEB128Size(Abbrev.getNumber());
}
CUDie->setSize(Size);
TheDwarfEmitter->emitPaperTrailWarningsDie(TheTriple, *CUDie);
TheDwarfEmitter->emitPaperTrailWarningsDie(*CUDie);
return true;
}

View File

@ -287,8 +287,7 @@ bool DwarfLinkerForBinary::link(const DebugMap &Map) {
DebugMap DebugMap(Map.getTriple(), Map.getBinaryPath());
DWARFLinker GeneralLinker(Map.getTriple(), Streamer.get(),
DwarfLinkerClient::Dsymutil);
DWARFLinker GeneralLinker(Streamer.get(), DwarfLinkerClient::Dsymutil);
remarks::RemarkLinker RL;
if (!Options.RemarksPrependPath.empty())

View File

@ -220,13 +220,13 @@ void DwarfStreamer::emitSectionContents(const object::ObjectFile &Obj,
}
/// Emit DIE containing warnings.
void DwarfStreamer::emitPaperTrailWarningsDie(const Triple &Triple, DIE &Die) {
void DwarfStreamer::emitPaperTrailWarningsDie(DIE &Die) {
switchToDebugInfoSection(/* Version */ 2);
auto &Asm = getAsmPrinter();
Asm.emitInt32(11 + Die.getSize() - 4);
Asm.emitInt16(2);
Asm.emitInt32(0);
Asm.emitInt8(Triple.isArch64Bit() ? 8 : 4);
Asm.emitInt8(MOFI->getTargetTriple().isArch64Bit() ? 8 : 4);
DebugInfoSectionSize += 11;
emitDIE(Die);
}

View File

@ -73,7 +73,7 @@ public:
unsigned DwarfVersion) override;
/// Emit DIE containing warnings.
void emitPaperTrailWarningsDie(const Triple &Triple, DIE &Die) override;
void emitPaperTrailWarningsDie(DIE &Die) override;
/// Emit contents of section SecName From Obj.
void emitSectionContents(const object::ObjectFile &Obj,