mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:41:04 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user