[llvm] r358066 - MCDwarf: use write_zeroes for MCDwarfLineAddr::FixedEncode
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 10 02:41:48 PDT 2019
Author: maskray
Date: Wed Apr 10 02:41:48 2019
New Revision: 358066
URL: http://llvm.org/viewvc/llvm-project?rev=358066&view=rev
Log:
MCDwarf: use write_zeroes for MCDwarfLineAddr::FixedEncode
This is more efficient than allocating a std::vector<uint8_t>.
Modified:
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=358066&r1=358065&r2=358066&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Wed Apr 10 02:41:48 2019
@@ -758,9 +758,7 @@ bool MCDwarfLineAddr::FixedEncode(MCCont
*Offset = OS.tell();
*Size = AddrSize;
SetDelta = false;
- std::vector<uint8_t> FillData;
- FillData.insert(FillData.begin(), AddrSize, 0);
- OS.write(reinterpret_cast<char *>(FillData.data()), AddrSize);
+ OS.write_zeros(AddrSize);
} else {
OS << char(dwarf::DW_LNS_fixed_advance_pc);
// Generate fixup for 2-bytes address delta.
More information about the llvm-commits
mailing list