[llvm] 0e6d7f6 - [Debuginfo][NFC] findRecursively: Replace std::vector by SmallVector
Alexey Lapshin via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 30 01:03:41 PDT 2020
Author: Alexey Lapshin
Date: 2020-04-30T11:01:41+03:00
New Revision: 0e6d7f602428f70215908409ab9691cdf299c6a1
URL: https://github.com/llvm/llvm-project/commit/0e6d7f602428f70215908409ab9691cdf299c6a1
DIFF: https://github.com/llvm/llvm-project/commit/0e6d7f602428f70215908409ab9691cdf299c6a1.diff
LOG: [Debuginfo][NFC] findRecursively: Replace std::vector by SmallVector
Summary:
Change std::vector to SmallVector to prevent re-allocations and to
have small pre-allocated storage.
Reviewers: clayborg, dblaikie
Differential Revision: https://reviews.llvm.org/D79123
Added:
Modified:
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index 134436c1ddbb..624a79e30464 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -356,7 +356,7 @@ DWARFDie::find(ArrayRef<dwarf::Attribute> Attrs) const {
Optional<DWARFFormValue>
DWARFDie::findRecursively(ArrayRef<dwarf::Attribute> Attrs) const {
- std::vector<DWARFDie> Worklist;
+ SmallVector<DWARFDie, 3> Worklist;
Worklist.push_back(*this);
// Keep track if DIEs already seen to prevent infinite recursion.
More information about the llvm-commits
mailing list