mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Augment getDepthMap with information about parent expressions
Which is very useful for the solver because otherwise it'd have to compute and store this information twice.
This commit is contained in:
@@ -524,10 +524,10 @@ public:
|
||||
/// the parent map.
|
||||
llvm::DenseMap<Expr *, Expr *> getParentMap();
|
||||
|
||||
/// Produce a mapping from each subexpression to its depth in the root
|
||||
/// expression. The root expression has depth 0, its children have depth
|
||||
/// 1, etc.
|
||||
llvm::DenseMap<Expr *, unsigned> getDepthMap();
|
||||
/// Produce a mapping from each subexpression to its depth and parent,
|
||||
/// in the root expression. The root expression has depth 0, its children have
|
||||
/// depth 1, etc.
|
||||
llvm::DenseMap<Expr *, std::pair<unsigned, Expr *>> getDepthMap();
|
||||
|
||||
/// Produce a mapping from each expression to its index according to a
|
||||
/// preorder traversal of the expressions. The parent has index 0, its first
|
||||
|
||||
Reference in New Issue
Block a user