diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -258,7 +258,7 @@ // TemplateArgumentTypeLocs, they only have TemplateArgumentTypes. So we // create a new argument location list from TypeSourceInfo. auto STL = TSI->getTypeLoc().getAs(); - llvm::SmallVector ArgLocs; + llvm::SmallVector ArgLocs; ArgLocs.reserve(STL.getNumArgs()); for (unsigned I = 0; I < STL.getNumArgs(); ++I) ArgLocs.push_back(STL.getArgLoc(I)); diff --git a/clang-tools-extra/clangd/CompileCommands.h b/clang-tools-extra/clangd/CompileCommands.h --- a/clang-tools-extra/clangd/CompileCommands.h +++ b/clang-tools-extra/clangd/CompileCommands.h @@ -92,7 +92,7 @@ static llvm::ArrayRef rulesFor(llvm::StringRef Arg); const Rule *matchingRule(llvm::StringRef Arg, unsigned Mode, unsigned &ArgCount) const; - llvm::SmallVector Rules; + llvm::SmallVector Rules; std::deque Storage; // Store strings not found in option table. }; diff --git a/clang-tools-extra/clangd/CompileCommands.cpp b/clang-tools-extra/clangd/CompileCommands.cpp --- a/clang-tools-extra/clangd/CompileCommands.cpp +++ b/clang-tools-extra/clangd/CompileCommands.cpp @@ -367,7 +367,7 @@ for (unsigned ID = 1 /*Skip INVALID */; ID < DriverID::LastOption; ++ID) { if (PrevAlias[ID] || ID == DriverID::OPT_Xclang) continue; // Not canonical, or specially handled. - llvm::SmallVector Rules; + llvm::SmallVector Rules; // Iterate over each alias, to add rules for parsing it. for (unsigned A = ID; A != DriverID::OPT_INVALID; A = NextAlias[A]) { if (Prefixes[A] == nullptr) // option groups. diff --git a/clang-tools-extra/clangd/ConfigCompile.cpp b/clang-tools-extra/clangd/ConfigCompile.cpp --- a/clang-tools-extra/clangd/ConfigCompile.cpp +++ b/clang-tools-extra/clangd/ConfigCompile.cpp @@ -137,7 +137,7 @@ llvm::StringRef EnumName; const Located &Input; llvm::Optional Result; - llvm::SmallVector ValidValues; + llvm::SmallVector ValidValues; public: EnumSwitch(llvm::StringRef EnumName, const Located &In, diff --git a/clang-tools-extra/clangd/FileDistance.cpp b/clang-tools-extra/clangd/FileDistance.cpp --- a/clang-tools-extra/clangd/FileDistance.cpp +++ b/clang-tools-extra/clangd/FileDistance.cpp @@ -58,8 +58,7 @@ FileDistance::FileDistance(llvm::StringMap Sources, const FileDistanceOptions &Opts) : Opts(Opts) { - llvm::DenseMap> - DownEdges; + llvm::DenseMap> DownEdges; // Compute the best distance following only up edges. // Keep track of down edges, in case we can use them to improve on this. for (const auto &S : Sources) { @@ -118,7 +117,7 @@ unsigned FileDistance::distance(llvm::StringRef Path) { auto Canonical = canonicalize(Path); unsigned Cost = Unreachable; - llvm::SmallVector Ancestors; + llvm::SmallVector Ancestors; // Walk up ancestors until we find a path we know the distance for. for (llvm::StringRef Rest = Canonical; !Rest.empty(); Rest = parent_path(Rest, llvm::sys::path::Style::posix)) { @@ -177,7 +176,7 @@ } static std::pair scopeToPath(llvm::StringRef Scope) { - llvm::SmallVector Split; + llvm::SmallVector Split; Scope.split(Split, "::", /*MaxSplit=*/-1, /*KeepEmpty=*/false); return {"/" + llvm::join(Split, "/"), Split.size()}; } diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -750,9 +750,9 @@ } namespace { -llvm::SmallVector refInDecl(const Decl *D) { +llvm::SmallVector refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { - llvm::SmallVector Refs; + llvm::SmallVector Refs; void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { // We want to keep it as non-declaration references, as the @@ -819,10 +819,10 @@ return V.Refs; } -llvm::SmallVector refInStmt(const Stmt *S) { +llvm::SmallVector refInStmt(const Stmt *S) { struct Visitor : ConstStmtVisitor { // FIXME: handle more complicated cases: more ObjC, designated initializers. - llvm::SmallVector Refs; + llvm::SmallVector Refs; void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *E) { Refs.push_back(ReferenceLoc{E->getNestedNameSpecifierLoc(), @@ -920,7 +920,7 @@ return V.Refs; } -llvm::SmallVector refInTypeLoc(TypeLoc L) { +llvm::SmallVector refInTypeLoc(TypeLoc L) { struct Visitor : TypeLocVisitor { llvm::Optional Ref; @@ -1114,7 +1114,7 @@ /// be references. However, declarations can have references inside them, /// e.g. 'namespace foo = std' references namespace 'std' and this /// function will return the corresponding reference. - llvm::SmallVector explicitReference(DynTypedNode N) { + llvm::SmallVector explicitReference(DynTypedNode N) { if (auto *D = N.get()) return refInDecl(D); if (auto *S = N.get()) diff --git a/clang-tools-extra/clangd/Headers.h b/clang-tools-extra/clangd/Headers.h --- a/clang-tools-extra/clangd/Headers.h +++ b/clang-tools-extra/clangd/Headers.h @@ -136,7 +136,7 @@ unsigned fileIndex(llvm::StringRef Name); llvm::StringMap NameToIndex; // Values are file indexes. // Maps a file's index to that of the files it includes. - llvm::DenseMap> IncludeChildren; + llvm::DenseMap> IncludeChildren; }; /// Returns a PPCallback that visits all inclusions in the main file. diff --git a/clang-tools-extra/clangd/QueryDriverDatabase.cpp b/clang-tools-extra/clangd/QueryDriverDatabase.cpp --- a/clang-tools-extra/clangd/QueryDriverDatabase.cpp +++ b/clang-tools-extra/clangd/QueryDriverDatabase.cpp @@ -79,7 +79,7 @@ const char SIS[] = "#include <...> search starts here:"; const char SIE[] = "End of search list."; const char TS[] = "Target: "; - llvm::SmallVector Lines; + llvm::SmallVector Lines; Output.split(Lines, '\n', /*MaxSplit=*/-1, /*KeepEmpty=*/false); enum { @@ -171,8 +171,8 @@ llvm::Optional Redirects[] = { {""}, {""}, llvm::StringRef(StdErrPath)}; - llvm::SmallVector Args = {Driver, "-E", "-x", - Lang, "-", "-v"}; + llvm::SmallVector Args = {Driver, "-E", "-x", + Lang, "-", "-v"}; // These flags will be preserved const llvm::StringRef FlagsToPreserve[] = { diff --git a/clang-tools-extra/clangd/Selection.h b/clang-tools-extra/clangd/Selection.h --- a/clang-tools-extra/clangd/Selection.h +++ b/clang-tools-extra/clangd/Selection.h @@ -123,7 +123,7 @@ // The parent within the selection tree. nullptr for TranslationUnitDecl. Node *Parent; // Direct children within the selection tree. - llvm::SmallVector Children; + llvm::SmallVector Children; // The corresponding node from the full AST. ast_type_traits::DynTypedNode ASTNode; // The extent to which this node is covered by the selection. diff --git a/clang-tools-extra/clangd/Selection.cpp b/clang-tools-extra/clangd/Selection.cpp --- a/clang-tools-extra/clangd/Selection.cpp +++ b/clang-tools-extra/clangd/Selection.cpp @@ -83,8 +83,8 @@ // Removes the elements of Claim from the set, modifying or removing ranges // that overlap it. // Returns the continuous subranges of Claim that were actually removed. - llvm::SmallVector, 4> erase(llvm::ArrayRef Claim) { - llvm::SmallVector, 4> Out; + llvm::SmallVector> erase(llvm::ArrayRef Claim) { + llvm::SmallVector> Out; if (Claim.empty()) return Out; diff --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp --- a/clang-tools-extra/clangd/SemanticHighlighting.cpp +++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp @@ -605,7 +605,7 @@ std::vector Lines; Lines.reserve(Tokens.size()); for (const auto &Line : Tokens) { - llvm::SmallVector LineByteTokens; + llvm::SmallVector LineByteTokens; llvm::raw_svector_ostream OS(LineByteTokens); for (const auto &Token : Line.Tokens) { // Writes the token to LineByteTokens in the byte format specified by the diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp --- a/clang-tools-extra/clangd/SourceCode.cpp +++ b/clang-tools-extra/clangd/SourceCode.cpp @@ -779,8 +779,8 @@ } // Returns the prefix namespaces of NS: {"" ... NS}. -llvm::SmallVector ancestorNamespaces(llvm::StringRef NS) { - llvm::SmallVector Results; +llvm::SmallVector ancestorNamespaces(llvm::StringRef NS) { + llvm::SmallVector Results; Results.push_back(NS.take_front(0)); NS.split(Results, "::", /*MaxSplit=*/-1, /*KeepEmpty=*/false); for (llvm::StringRef &R : Results) diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp --- a/clang-tools-extra/clangd/TUScheduler.cpp +++ b/clang-tools-extra/clangd/TUScheduler.cpp @@ -477,7 +477,7 @@ /// thread are not locked, as it's the only writer. ParseInputs FileInputs; /* GUARDED_BY(Mutex) */ /// Times of recent AST rebuilds, used for UpdateDebounce computation. - llvm::SmallVector + llvm::SmallVector RebuildTimes; /* GUARDED_BY(Mutex) */ /// Set to true to signal run() to finish processing. bool Done; /* GUARDED_BY(Mutex) */ diff --git a/clang-tools-extra/clangd/TidyProvider.cpp b/clang-tools-extra/clangd/TidyProvider.cpp --- a/clang-tools-extra/clangd/TidyProvider.cpp +++ b/clang-tools-extra/clangd/TidyProvider.cpp @@ -81,7 +81,7 @@ // Compute absolute paths to all ancestors (substrings of P.Path). // Ensure cache entries for each ancestor exist in the map. llvm::StringRef Parent = path::parent_path(AbsPath); - llvm::SmallVector Caches; + llvm::SmallVector Caches; { std::lock_guard Lock(Mu); for (auto I = path::begin(Parent, path::Style::posix), @@ -105,7 +105,7 @@ // This will take a (per-file) lock for each file that actually exists. std::chrono::steady_clock::time_point FreshTime = std::chrono::steady_clock::now() - MaxStaleness; - llvm::SmallVector, 4> + llvm::SmallVector> OptionStack; for (const DotClangTidyCache *Cache : Caches) if (auto Config = Cache->get(FS, FreshTime)) { diff --git a/clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp b/clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp --- a/clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp +++ b/clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp @@ -153,7 +153,7 @@ Request.Limit = Limit; Request.Query = Query; if (Scopes.getNumOccurrences() > 0) { - llvm::SmallVector Scopes; + llvm::SmallVector Scopes; llvm::StringRef(this->Scopes).split(Scopes, ','); Request.Scopes = {Scopes.begin(), Scopes.end()}; } @@ -339,7 +339,7 @@ bool runCommand(std::string Request, const SymbolIndex &Index) { // Split on spaces and add required null-termination. std::replace(Request.begin(), Request.end(), ' ', '\0'); - llvm::SmallVector Args; + llvm::SmallVector Args; llvm::StringRef(Request).split(Args, '\0', /*MaxSplit=*/-1, /*KeepEmpty=*/false); if (Args.empty()) @@ -351,7 +351,7 @@ llvm::outs() << "Get detailed command help with e.g. `find -help`.\n"; return true; } - llvm::SmallVector FakeArgv; + llvm::SmallVector FakeArgv; for (llvm::StringRef S : Args) FakeArgv.push_back(S.data()); // Terminated by separator or end of string. diff --git a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp --- a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp @@ -480,7 +480,7 @@ const tooling::Replacement DeleteFuncBody(SM, DefRange->getBegin(), SourceLen, ""); - llvm::SmallVector, 2> Edits; + llvm::SmallVector> Edits; // Edit for Target. auto FE = Effect::fileEdit(SM, SM.getFileID(*Semicolon), std::move(TargetFileReplacements)); diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp --- a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp @@ -202,7 +202,7 @@ struct ParsedBinaryOperator { BinaryOperatorKind Kind; SourceLocation ExprLoc; - llvm::SmallVector SelectedOperands; + llvm::SmallVector SelectedOperands; // If N is a binary operator, populate this and return true. bool parse(const SelectionTree::Node &N) { diff --git a/clang-tools-extra/clangd/support/Markup.cpp b/clang-tools-extra/clangd/support/Markup.cpp --- a/clang-tools-extra/clangd/support/Markup.cpp +++ b/clang-tools-extra/clangd/support/Markup.cpp @@ -215,7 +215,7 @@ // Trims the input and concatenates whitespace blocks into a single ` `. std::string canonicalizeSpaces(llvm::StringRef Input) { - llvm::SmallVector Words; + llvm::SmallVector Words; llvm::SplitString(Input, Words); return llvm::join(Words, " "); } diff --git a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp --- a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp +++ b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp @@ -208,7 +208,7 @@ } static std::string strip(llvm::StringRef Arg, llvm::StringRef Argv) { - llvm::SmallVector Parts; + llvm::SmallVector Parts; llvm::SplitString(Argv, Parts); std::vector Args = {Parts.begin(), Parts.end()}; ArgStripper S; diff --git a/clang-tools-extra/clangd/unittests/TestIndex.cpp b/clang-tools-extra/clangd/unittests/TestIndex.cpp --- a/clang-tools-extra/clangd/unittests/TestIndex.cpp +++ b/clang-tools-extra/clangd/unittests/TestIndex.cpp @@ -29,7 +29,7 @@ static std::string replace(llvm::StringRef Haystack, llvm::StringRef Needle, llvm::StringRef Repl) { - llvm::SmallVector Parts; + llvm::SmallVector Parts; Haystack.split(Parts, Needle); return llvm::join(Parts, Repl); } diff --git a/clang-tools-extra/clangd/unittests/TestTU.cpp b/clang-tools-extra/clangd/unittests/TestTU.cpp --- a/clang-tools-extra/clangd/unittests/TestTU.cpp +++ b/clang-tools-extra/clangd/unittests/TestTU.cpp @@ -187,7 +187,7 @@ } const NamedDecl &findDecl(ParsedAST &AST, llvm::StringRef QName) { - llvm::SmallVector Components; + llvm::SmallVector Components; QName.split(Components, "::"); auto &Ctx = AST.getASTContext(); diff --git a/clang-tools-extra/clangd/unittests/support/TraceTests.cpp b/clang-tools-extra/clangd/unittests/support/TraceTests.cpp --- a/clang-tools-extra/clangd/unittests/support/TraceTests.cpp +++ b/clang-tools-extra/clangd/unittests/support/TraceTests.cpp @@ -154,7 +154,7 @@ std::vector outputLines() { // Deliberately don't flush output stream, the tracer should do that. // This is important when clangd crashes. - llvm::SmallVector Lines; + llvm::SmallVector Lines; llvm::StringRef(Output).split(Lines, "\r\n"); return {Lines.begin(), Lines.end()}; }