[PATCH] D117119: [clangd][clang-tidy] Remove uses of `std::vector<bool>`
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 18 08:59:53 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc6fb636667b8: [clangd][clang-tidy] Remove uses of `std::vector<bool>` (authored by jansvoboda11).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117119/new/
https://reviews.llvm.org/D117119
Files:
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clangd/Selection.cpp
Index: clang-tools-extra/clangd/Selection.cpp
===================================================================
--- clang-tools-extra/clangd/Selection.cpp
+++ clang-tools-extra/clangd/Selection.cpp
@@ -24,6 +24,7 @@
#include "clang/Basic/TokenKinds.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Syntax/Tokens.h"
+#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
@@ -260,7 +261,7 @@
});
auto Sel = llvm::makeArrayRef(SelFirst, SelLimit);
// Find which of these are preprocessed to nothing and should be ignored.
- std::vector<bool> PPIgnored(Sel.size(), false);
+ llvm::BitVector PPIgnored(Sel.size(), false);
for (const syntax::TokenBuffer::Expansion &X :
Buf.expansionsOverlapping(Sel)) {
if (X.Expanded.empty()) {
Index: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
===================================================================
--- clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -29,6 +29,7 @@
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Core/Diagnostic.h"
#include "clang/Tooling/Core/Replacement.h"
+#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
@@ -863,7 +864,7 @@
}
}
- std::vector<bool> Apply(ErrorFixes.size(), true);
+ llvm::BitVector Apply(ErrorFixes.size(), true);
for (auto &FileAndEvents : FileEvents) {
std::vector<Event> &Events = FileAndEvents.second;
// Sweep.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117119.400865.patch
Type: text/x-patch
Size: 1655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220118/d24b251e/attachment.bin>
More information about the cfe-commits
mailing list