Author: Eduardo Caldas Date: 2020-09-22T06:47:36Z New Revision: 1dc7836aed134b4543bad6aa54f15cc0e51a627f
URL: https://github.com/llvm/llvm-project/commit/1dc7836aed134b4543bad6aa54f15cc0e51a627f DIFF: https://github.com/llvm/llvm-project/commit/1dc7836aed134b4543bad6aa54f15cc0e51a627f.diff LOG: [SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree` I also assured that there are no other functions unnecessarily using std::vector as argument. Differential Revision: https://reviews.llvm.org/D88024 Added: Modified: clang/include/clang/Tooling/Syntax/BuildTree.h clang/lib/Tooling/Syntax/Synthesis.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Tooling/Syntax/BuildTree.h b/clang/include/clang/Tooling/Syntax/BuildTree.h index 7b36dff123f6..ab4868747e69 100644 --- a/clang/include/clang/Tooling/Syntax/BuildTree.h +++ b/clang/include/clang/Tooling/Syntax/BuildTree.h @@ -39,7 +39,7 @@ syntax::Leaf *createLeaf(syntax::Arena &A, tok::TokenKind K); /// Returns it as a pointer to the base class `Tree`. syntax::Tree * createTree(syntax::Arena &A, - std::vector<std::pair<syntax::Node *, syntax::NodeRole>> Children, + ArrayRef<std::pair<syntax::Node *, syntax::NodeRole>> Children, syntax::NodeKind K); // Synthesis of Syntax Nodes diff --git a/clang/lib/Tooling/Syntax/Synthesis.cpp b/clang/lib/Tooling/Syntax/Synthesis.cpp index c8fcac27e0d5..9dc83f966d8c 100644 --- a/clang/lib/Tooling/Syntax/Synthesis.cpp +++ b/clang/lib/Tooling/Syntax/Synthesis.cpp @@ -190,7 +190,7 @@ syntax::Tree *allocateTree(syntax::Arena &A, syntax::NodeKind Kind) { syntax::Tree *clang::syntax::createTree( syntax::Arena &A, - std::vector<std::pair<syntax::Node *, syntax::NodeRole>> Children, + ArrayRef<std::pair<syntax::Node *, syntax::NodeRole>> Children, syntax::NodeKind K) { auto *T = allocateTree(A, K); FactoryImpl::setCanModify(T); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits