Commit 65209760 authored by Fangrui Song's avatar Fangrui Song
Browse files

[dsymutil] Delete unneeded parameter Triple from DWARFLinker

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D74173
parent b4aff121
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+1 −2
Original line number Diff line number Diff line
@@ -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())
+2 −2
Original line number Diff line number Diff line
@@ -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);
}
+1 −1
Original line number Diff line number Diff line
@@ -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,