eduucaldas added a reviewer: gribozavr2.
eduucaldas added a comment.

As a result of this change `getDeclaratorRange` is used exclusively inside 
`processDeclaratorAndDeclaration` and the last two arguments are direct results 
of `getQualifiedNameStart(D)` and `getInitializerRange(D)`, which are used 
exclusively in this context.



================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:1462
     // Build node for the declarator, if any.
-    auto ReturnDeclaratorRange =
-        getDeclaratorRange(this->Builder.sourceManager(), ReturnedType,
-                           /*Name=*/SourceLocation(),
-                           /*Initializer=*/SourceLocation());
+    auto ReturnDeclaratorRange = SourceRange(GetStartLoc().Visit(ReturnedType),
+                                             ReturnedType.getEndLoc());
----------------
1. TrailingReturn is not a Declarator
2. Inlining the arguments is actually less code and much than using the 
`getDeclaratorRange` here.


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:393
     // Next sibling is not the same type, this one is responsible.
-    if (NextT == nullptr) {
+    if (D->getKind() != Next->getKind()) {
       return true;
----------------
I would argue that this is much clearer :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86719/new/

https://reviews.llvm.org/D86719

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to