Switch interpreter Stacks to Ptr (#763)

This also eliminates the ctad wrapper for Stack: I think the leaning is to remove it. It felt worth keeping the constructor because constructing with a single element is a common use-case.

Adds a single-argument constructor for Scope because the `std::list<std::string>()` is common, and eliding it is consistent with what we've done for things like tuples.

I was considering a vector constructor due to the double-Push on line 1139, but thought the Push() semantics may mean that it's better not to provide.
This commit is contained in:
Jon Meow
2021-08-19 11:34:03 -07:00
committed by GitHub
parent 925c60b669
commit 47325be112
7 changed files with 142 additions and 154 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ void Action::Print(llvm::raw_ostream& out) const {
}
}
void Action::PrintList(const Stack<Action*>& ls, llvm::raw_ostream& out) {
void Action::PrintList(const Stack<Ptr<Action>>& ls, llvm::raw_ostream& out) {
llvm::ListSeparator sep(" :: ");
for (const auto& action : ls) {
out << sep << *action;