forked from OSchip/llvm-project
[llvm-cov, llvm-symbolizer] Use llvm::erase_if (NFC)
This commit is contained in:
parent
63a2bde281
commit
b676f2fee1
|
@ -436,16 +436,11 @@ void CodeCoverageTool::remapPathNames(const CoverageMapping &Coverage) {
|
|||
void CodeCoverageTool::removeUnmappedInputs(const CoverageMapping &Coverage) {
|
||||
std::vector<StringRef> CoveredFiles = Coverage.getUniqueSourceFiles();
|
||||
|
||||
auto UncoveredFilesIt = SourceFiles.end();
|
||||
// The user may have specified source files which aren't in the coverage
|
||||
// mapping. Filter these files away.
|
||||
UncoveredFilesIt = std::remove_if(
|
||||
SourceFiles.begin(), SourceFiles.end(), [&](const std::string &SF) {
|
||||
return !std::binary_search(CoveredFiles.begin(), CoveredFiles.end(),
|
||||
SF);
|
||||
llvm::erase_if(SourceFiles, [&](const std::string &SF) {
|
||||
return !std::binary_search(CoveredFiles.begin(), CoveredFiles.end(), SF);
|
||||
});
|
||||
|
||||
SourceFiles.erase(UncoveredFilesIt, SourceFiles.end());
|
||||
}
|
||||
|
||||
void CodeCoverageTool::demangleSymbols(const CoverageMapping &Coverage) {
|
||||
|
|
|
@ -329,10 +329,8 @@ int main(int argc, char **argv) {
|
|||
while (fgets(InputString, sizeof(InputString), stdin)) {
|
||||
// Strip newline characters.
|
||||
std::string StrippedInputString(InputString);
|
||||
StrippedInputString.erase(
|
||||
std::remove_if(StrippedInputString.begin(), StrippedInputString.end(),
|
||||
[](char c) { return c == '\r' || c == '\n'; }),
|
||||
StrippedInputString.end());
|
||||
llvm::erase_if(StrippedInputString,
|
||||
[](char c) { return c == '\r' || c == '\n'; });
|
||||
symbolizeInput(Args, AdjustVMA, IsAddr2Line, OutputStyle,
|
||||
StrippedInputString, Symbolizer, Printer);
|
||||
outs().flush();
|
||||
|
|
Loading…
Reference in New Issue