| 404 | } |
| 405 | |
| 406 | Scope Scope::NewSubScope(const string& child_scope_name) const { |
| 407 | if (child_scope_name.empty()) { |
| 408 | return Scope(new Impl(*this, Impl::Tags::ScopeName(), impl()->name_, |
| 409 | true /* copy_names */)); |
| 410 | } |
| 411 | const string unique_name = |
| 412 | impl()->GetUniqueName(child_scope_name, false /* check_single_use */); |
| 413 | const string sep = |
| 414 | impl()->name_.empty() || unique_name.empty() ? "" : kScopeSeparator; |
| 415 | return Scope(new Impl(*this, Impl::Tags::ScopeName(), |
| 416 | strings::StrCat(impl()->name_, sep, unique_name), |
| 417 | false /* copy_names */)); |
| 418 | } |
| 419 | |
| 420 | Scope Scope::WithOpNameImpl(const string& op_name) const { |
| 421 | if (impl()->single_use_scope()) { |