[llvm] 9b85d7e - MC: Use SmallVector::clear() instead of set_size(0)
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 13 10:35:24 PST 2022
Author: Duncan P. N. Exon Smith
Date: 2022-01-13T10:34:14-08:00
New Revision: 9b85d7e166ac51a1cea66129edbfbc83fc5332b3
URL: https://github.com/llvm/llvm-project/commit/9b85d7e166ac51a1cea66129edbfbc83fc5332b3
DIFF: https://github.com/llvm/llvm-project/commit/9b85d7e166ac51a1cea66129edbfbc83fc5332b3.diff
LOG: MC: Use SmallVector::clear() instead of set_size(0)
Added:
Modified:
llvm/lib/MC/MachObjectWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 5105c5d8164d9..56bb03ad8d420 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -765,7 +765,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm,
MCDataFragment *Frag = dyn_cast_or_null<MCDataFragment>(
&*CGProfileSection->getFragmentList().begin());
assert(Frag && "call graph profile section not reserved");
- Frag->getContents().set_size(0);
+ Frag->getContents().clear();
raw_svector_ostream OS(Frag->getContents());
for (const MCAssembler::CGProfileEntry &CGPE : Asm.CGProfile) {
uint32_t FromIndex = CGPE.From->getSymbol().getIndex();
More information about the llvm-commits
mailing list