generic_region_stack.cpp 732 B

1234567891011121314151617181920212223
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "toolchain/check/generic_region_stack.h"
  5. namespace Carbon::Check {
  6. auto GenericRegionStack::Push(PendingGeneric generic) -> void {
  7. pending_generic_ids_.push_back(generic);
  8. pending_eval_block_stack_.PushArray();
  9. dependent_inst_stack_.PushArray();
  10. constants_in_generic_stack_.emplace_back();
  11. }
  12. auto GenericRegionStack::Pop() -> void {
  13. pending_generic_ids_.pop_back();
  14. pending_eval_block_stack_.PopArray();
  15. dependent_inst_stack_.PopArray();
  16. constants_in_generic_stack_.pop_back();
  17. }
  18. } // namespace Carbon::Check