[PATCH] D88024: [SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 07:48:37 PDT 2020


eduucaldas created this revision.
eduucaldas added a reviewer: gribozavr2.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
eduucaldas requested review of this revision.

I also assured that there are no other functions unnecessarily using std::vector as argument.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88024

Files:
  clang/include/clang/Tooling/Syntax/BuildTree.h
  clang/lib/Tooling/Syntax/Synthesis.cpp


Index: clang/lib/Tooling/Syntax/Synthesis.cpp
===================================================================
--- clang/lib/Tooling/Syntax/Synthesis.cpp
+++ clang/lib/Tooling/Syntax/Synthesis.cpp
@@ -190,7 +190,7 @@
 
 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);
Index: clang/include/clang/Tooling/Syntax/BuildTree.h
===================================================================
--- clang/include/clang/Tooling/Syntax/BuildTree.h
+++ clang/include/clang/Tooling/Syntax/BuildTree.h
@@ -39,7 +39,7 @@
 /// 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88024.293173.patch
Type: text/x-patch
Size: 1084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200921/94c6b547/attachment.bin>


More information about the cfe-commits mailing list