[clang-tools-extra] bb10e03 - [clangd] Refine comment on declarator ranges

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 5 07:00:17 PST 2022


Author: Sam McCall
Date: 2022-01-05T16:00:13+01:00
New Revision: bb10e03fba7106e51d2e64269d10c3ba95055b26

URL: https://github.com/llvm/llvm-project/commit/bb10e03fba7106e51d2e64269d10c3ba95055b26
DIFF: https://github.com/llvm/llvm-project/commit/bb10e03fba7106e51d2e64269d10c3ba95055b26.diff

LOG: [clangd] Refine comment on declarator ranges

Added: 
    

Modified: 
    clang-tools-extra/clangd/Selection.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/Selection.cpp b/clang-tools-extra/clangd/Selection.cpp
index ef964da7b28d..7dc8a868ea00 100644
--- a/clang-tools-extra/clangd/Selection.cpp
+++ b/clang-tools-extra/clangd/Selection.cpp
@@ -745,19 +745,19 @@ class SelectionVisitor : public RecursiveASTVisitor<SelectionVisitor> {
     //                              which accept A<char> and return R<int>.
     // The TypeLoc hierarchy:
     //   Vec<R<int>(*[2])(A<char>)> m;
-    //   Vec<--------------------->      TemplateSpecialization Vec
+    //   Vec<#####################>      TemplateSpecialization Vec
     //       --------[2]----------       `-Array
     //       -------*-------------         `-Pointer
     //       ------(----)---------           `-Paren
-    //       ------------(-------)             `-Function
-    //       R<--->                              |-TemplateSpecialization R
+    //       ------------(#######)             `-Function
+    //       R<###>                              |-TemplateSpecialization R
     //         int                               | `-Builtin int
-    //                    A<---->                `-TemplateSpecialization A
+    //                    A<####>                `-TemplateSpecialization A
     //                      char                   `-Builtin char
     //
-    // In each row, --- represents unclaimed parts of the SourceRange.
-    // For declarator types, we are careful never to claim these.
-    // For non-declarator types, children are guaranteed to claim them first.
+    // In each row
+    //   --- represents unclaimed parts of the SourceRange.
+    //   ### represents parts that children already claimed.
     if (const auto *TL = N.get<TypeLoc>()) {
       if (auto PTL = TL->getAs<ParenTypeLoc>()) {
         claimRange(PTL.getLParenLoc(), Result);


        


More information about the cfe-commits mailing list