[PATCH] D74173: [dsymutil] Change a parameter from Triple to IsArch64Bit
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 7 09:58:52 PST 2020
MaskRay updated this revision to Diff 243206.
MaskRay added a comment.
Adopt avl's suggestion
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74173/new/
https://reviews.llvm.org/D74173
Files:
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
Index: llvm/tools/dsymutil/DwarfStreamer.h
===================================================================
--- llvm/tools/dsymutil/DwarfStreamer.h
+++ llvm/tools/dsymutil/DwarfStreamer.h
@@ -73,7 +73,7 @@
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,
Index: llvm/tools/dsymutil/DwarfStreamer.cpp
===================================================================
--- llvm/tools/dsymutil/DwarfStreamer.cpp
+++ llvm/tools/dsymutil/DwarfStreamer.cpp
@@ -220,13 +220,13 @@
}
/// 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);
}
Index: llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
===================================================================
--- llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -287,8 +287,7 @@
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())
Index: llvm/lib/DWARFLinker/DWARFLinker.cpp
===================================================================
--- llvm/lib/DWARFLinker/DWARFLinker.cpp
+++ llvm/lib/DWARFLinker/DWARFLinker.cpp
@@ -2165,7 +2165,7 @@
Size += getULEB128Size(Abbrev.getNumber());
}
CUDie->setSize(Size);
- TheDwarfEmitter->emitPaperTrailWarningsDie(TheTriple, *CUDie);
+ TheDwarfEmitter->emitPaperTrailWarningsDie(*CUDie);
return true;
}
Index: llvm/include/llvm/DWARFLinker/DWARFLinker.h
===================================================================
--- llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -96,7 +96,7 @@
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 @@
/// 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 @@
BumpPtrAllocator DIEAlloc;
/// @}
- Triple TheTriple;
-
DwarfEmitter *TheDwarfEmitter;
std::vector<LinkContext> ObjectContexts;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74173.243206.patch
Type: text/x-patch
Size: 3479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/d2d6ff7b/attachment.bin>
More information about the llvm-commits
mailing list