This is an archive of the discontinued LLVM Phabricator instance.

[dsymutil] Delete unneeded parameter Triple from DWARFLinker
ClosedPublic

Authored by MaskRay on Feb 6 2020, 2:55 PM.

Diff Detail

Event Timeline

MaskRay created this revision.Feb 6 2020, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2020, 2:55 PM
avl added a comment.Feb 7 2020, 3:09 AM

Hi Fangrui, you are absolutely correct. This llvm::Triple looks redundant. I have to do this and other similar cleanups. I was thinking about following change:

diff --git a/llvm/tools/dsymutil/DwarfStreamer.cpp b/llvm/tools/dsymutil/DwarfStreamer.cpp
index de20d9a3478..a219a7542d2 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);
 }
MaskRay updated this revision to Diff 243206.Feb 7 2020, 9:54 AM

Adopt avl's suggestion

MaskRay retitled this revision from [dsymutil] Change a parameter from Triple to IsArch64Bit to [dsymutil] Delete unneeded parameter Triple from DWARFLinker.Feb 7 2020, 10:18 AM
MaskRay edited the summary of this revision. (Show Details)
JDevlieghere accepted this revision.Feb 7 2020, 10:40 AM

Great, thank you!

This revision is now accepted and ready to land.Feb 7 2020, 10:40 AM
This revision was automatically updated to reflect the committed changes.