[llvm] 6520976 - [dsymutil] Delete unneeded parameter Triple from DWARFLinker
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 7 11:33:35 PST 2020
Author: Fangrui Song
Date: 2020-02-07T11:33:27-08:00
New Revision: 6520976064c4c59397dd02e72d42e9cff3a2a8dc
URL: https://github.com/llvm/llvm-project/commit/6520976064c4c59397dd02e72d42e9cff3a2a8dc
DIFF: https://github.com/llvm/llvm-project/commit/6520976064c4c59397dd02e72d42e9cff3a2a8dc.diff
LOG: [dsymutil] Delete unneeded parameter Triple from DWARFLinker
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D74173
Added:
Modified:
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/DwarfStreamer.cpp
llvm/tools/dsymutil/DwarfStreamer.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
index f438ed5d6117..5a8d08148091 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -96,7 +96,7 @@ class DwarfEmitter {
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 @@ class DWARFLinker {
BumpPtrAllocator DIEAlloc;
/// @}
- Triple TheTriple;
-
DwarfEmitter *TheDwarfEmitter;
std::vector<LinkContext> ObjectContexts;
diff --git a/llvm/lib/DWARFLinker/DWARFLinker.cpp b/llvm/lib/DWARFLinker/DWARFLinker.cpp
index 0fa83b32bd62..adcbebfc7c77 100644
--- a/llvm/lib/DWARFLinker/DWARFLinker.cpp
+++ b/llvm/lib/DWARFLinker/DWARFLinker.cpp
@@ -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;
}
diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index 309dbf05e7e3..330a95d0daf6 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -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())
diff --git a/llvm/tools/dsymutil/DwarfStreamer.cpp b/llvm/tools/dsymutil/DwarfStreamer.cpp
index de20d9a34788..a219a7542d29 100644
--- a/llvm/tools/dsymutil/DwarfStreamer.cpp
+++ b/llvm/tools/dsymutil/DwarfStreamer.cpp
@@ -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);
}
diff --git a/llvm/tools/dsymutil/DwarfStreamer.h b/llvm/tools/dsymutil/DwarfStreamer.h
index de599989fee3..285732aa3e96 100644
--- a/llvm/tools/dsymutil/DwarfStreamer.h
+++ b/llvm/tools/dsymutil/DwarfStreamer.h
@@ -73,7 +73,7 @@ class DwarfStreamer : public DwarfEmitter {
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,
More information about the llvm-commits
mailing list