[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:
Pavel Yaskevich
2019-01-23 18:21:00 -08:00
parent 8944665650
commit 49c40d92f6
5 changed files with 36 additions and 27 deletions

View File

@@ -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