JSSpecCompiler: Restrict usage of NodeSubtreePointer

This class stores a non-owning raw pointer to a member of `Node`, so
extra care is needed to ensure that referenced `Node`s will be alive
by the time `NodeSubtreePointer` is used. Since we only need to use this
class while traversing AST in `RecursiveASTVisitor`, access to class
methods can be restricted using `Badge<RecursiveASTVisitor>`.
This commit is contained in:
Dan Klishch 2023-09-02 14:33:35 -04:00 committed by Andrew Kaster
commit 1c4cd34320
Notes: sideshowbarker 2024-07-16 21:39:23 +09:00
3 changed files with 8 additions and 4 deletions

View file

@ -37,6 +37,9 @@ class Variable;
class FunctionPointer;
using FunctionPointerRef = NonnullRefPtr<FunctionPointer>;
// Compiler/GenericASTPass.h
class RecursiveASTVisitor;
// Parser/SpecParser.h
class AlgorithmStep;
class AlgorithmStepList;