summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-05-21 18:23:50 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-05-21 18:23:50 +0000
commit438390fae1f0f6125b914e5f1bd4ef2e7deb8c05 (patch)
tree75c6368bbd66ae73103e12c73b87459488056a7c /llvm/lib/MC/MachObjectWriter.cpp
parent9badad2051c41049354e2650c1b321e7e0d0d3e1 (diff)
downloadbcm5719-llvm-438390fae1f0f6125b914e5f1bd4ef2e7deb8c05.tar.gz
bcm5719-llvm-438390fae1f0f6125b914e5f1bd4ef2e7deb8c05.zip
MC: Have the object writers return the number of bytes written. NFCI.
This removes the last external use of the stream. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47042 llvm-svn: 332863
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/MachObjectWriter.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index ba8922c8997..a464af1d42a 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -735,8 +735,10 @@ static MachO::LoadCommandType getLCFromMCVM(MCVersionMinType Type) {
llvm_unreachable("Invalid mc version min type");
}
-void MachObjectWriter::writeObject(MCAssembler &Asm,
- const MCAsmLayout &Layout) {
+uint64_t MachObjectWriter::writeObject(MCAssembler &Asm,
+ const MCAsmLayout &Layout) {
+ uint64_t StartOffset = W.OS.tell();
+
// Compute symbol table information and bind symbol indices.
computeSymbolTable(Asm, LocalSymbolData, ExternalSymbolData,
UndefinedSymbolData);
@@ -1011,6 +1013,8 @@ void MachObjectWriter::writeObject(MCAssembler &Asm,
// Write the string table.
StringTable.write(W.OS);
}
+
+ return W.OS.tell() - StartOffset;
}
std::unique_ptr<MCObjectWriter>
OpenPOWER on IntegriCloud