]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rust: Add comment inside block [PR119342]
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 20 Mar 2025 00:30:02 +0000 (17:30 -0700)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 14 Apr 2025 16:23:52 +0000 (18:23 +0200)
Inside a BLOCK node, all of the variables of the scope/block
are chained together and that connects them to the block.
This just adds a comment to that effect as reading the code
it is not so obvious why they need to be chained together.

gcc/rust/ChangeLog:

PR rust/119342
* rust-gcc.cc (block): Add comment on why chaining
the variables of the scope toether.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/rust/rust-gcc.cc

index bd1f13920bfe3d0cee644c2676e35877cde557f2..234721c585fd6f9b9c165accd31a48f7de205534 100644 (file)
@@ -1792,6 +1792,8 @@ block (tree fndecl, tree enclosing, const std::vector<Bvariable *> &vars,
       *pp = block_tree;
     }
 
+  // Chain the variables of the scope together so they are all connected
+  // to the block.
   tree *pp = &BLOCK_VARS (block_tree);
   for (Bvariable *bv : vars)
     {