generic_region_stack.cpp 972 B

1234567891011121314151617181920212223242526272829
  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. #include "common/vlog.h"
  6. namespace Carbon::Check {
  7. auto GenericRegionStack::Push(PendingGeneric generic) -> void {
  8. CARBON_VLOG("GenericRegion Push: {0} {1}\n", generic.generic_id,
  9. generic.region);
  10. pending_generic_ids_.push_back(generic);
  11. pending_eval_block_stack_.PushArray();
  12. dependent_inst_stack_.PushArray();
  13. constants_in_generic_stack_.emplace_back();
  14. }
  15. auto GenericRegionStack::Pop() -> void {
  16. auto pending = pending_generic_ids_.pop_back_val();
  17. CARBON_VLOG("GenericRegion Pop: {0} {1}\n", pending.generic_id,
  18. pending.region);
  19. pending_eval_block_stack_.PopArray();
  20. dependent_inst_stack_.PopArray();
  21. constants_in_generic_stack_.pop_back();
  22. }
  23. } // namespace Carbon::Check