From ac590673637ebac0a6ac530e5130f282f82d03cf Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 10 Apr 2019 09:41:48 +0000 Subject: MCDwarf: use write_zeroes for MCDwarfLineAddr::FixedEncode This is more efficient than allocating a std::vector. llvm-svn: 358066 --- llvm/lib/MC/MCDwarf.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/MC/MCDwarf.cpp') diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index ea2cb577661..f59d91d5c62 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -758,9 +758,7 @@ bool MCDwarfLineAddr::FixedEncode(MCContext &Context, *Offset = OS.tell(); *Size = AddrSize; SetDelta = false; - std::vector FillData; - FillData.insert(FillData.begin(), AddrSize, 0); - OS.write(reinterpret_cast(FillData.data()), AddrSize); + OS.write_zeros(AddrSize); } else { OS << char(dwarf::DW_LNS_fixed_advance_pc); // Generate fixup for 2-bytes address delta. -- cgit v1.2.3