aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-10-24 23:03:13 -0700
committerGitHub <noreply@github.com>2023-10-24 23:03:13 -0700
commitf9306f6de3bd19a2dcacd64566852a5f92c86e77 (patch)
tree7537b2fe35a98cd4f8ae1cf6dfeb7edae0a65b31 /llvm/tools/llvm-dwarfdump
parentf999e1d7440e9aa2b181af3c7daa04c27363eadb (diff)
downloadllvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.zip
llvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.tar.gz
llvm-f9306f6de3bd19a2dcacd64566852a5f92c86e77.tar.bz2
[ADT] Rename llvm::erase_value to llvm::erase (NFC) (#70156)
C++20 comes with std::erase to erase a value from std::vector. This patch renames llvm::erase_value to llvm::erase for consistency with C++20. We could make llvm::erase more similar to std::erase by having it return the number of elements removed, but I'm not doing that for now because nobody seems to care about that in our code base. Since there are only 50 occurrences of erase_value in our code base, this patch replaces all of them with llvm::erase and deprecates llvm::erase_value.
Diffstat (limited to 'llvm/tools/llvm-dwarfdump')
-rw-r--r--llvm/tools/llvm-dwarfdump/Statistics.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp
index a967abf..96841c3 100644
--- a/llvm/tools/llvm-dwarfdump/Statistics.cpp
+++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp
@@ -319,7 +319,7 @@ static void collectStatsForDie(DWARFDie Die, const std::string &FnPrefix,
auto Offset = Die.find(dwarf::DW_AT_abstract_origin);
// Do not track this variable any more, since it has location
// coverage.
- llvm::erase_value(*AbstractOriginVariables, (*Offset).getRawUValue());
+ llvm::erase(*AbstractOriginVariables, (*Offset).getRawUValue());
}
} else {
// The locstats will be handled at the end of
@@ -743,7 +743,7 @@ static void updateVarsWithAbstractOriginLocCovInfo(
Child.find(dwarf::DW_AT_const_value))) {
auto OffsetVar = Child.find(dwarf::DW_AT_abstract_origin);
if (OffsetVar)
- llvm::erase_value(AbstractOriginVars, (*OffsetVar).getRawUValue());
+ llvm::erase(AbstractOriginVars, (*OffsetVar).getRawUValue());
} else if (ChildTag == dwarf::DW_TAG_lexical_block)
updateVarsWithAbstractOriginLocCovInfo(Child, AbstractOriginVars);
Child = Child.getSibling();
@@ -792,7 +792,7 @@ static void collectZeroLocCovForVarsWithAbstractOrigin(
ProcessedFns.push_back(FnOffset);
}
for (auto ProcessedFn : ProcessedFns)
- llvm::erase_value(FnsWithAbstractOriginToBeProcessed, ProcessedFn);
+ llvm::erase(FnsWithAbstractOriginToBeProcessed, ProcessedFn);
}
/// Collect zero location coverage for inlined variables which refer to