generic_region_stack.cpp 709 B

123456789101112131415161718192021
  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() -> void { dependent_insts_stack_.PushArray(); }
  7. auto GenericRegionStack::Pop() -> void { dependent_insts_stack_.PopArray(); }
  8. auto GenericRegionStack::AddDependentInst(DependentInst inst) -> void {
  9. dependent_insts_stack_.AppendToTop(inst);
  10. }
  11. auto GenericRegionStack::PeekDependentInsts() -> llvm::ArrayRef<DependentInst> {
  12. return dependent_insts_stack_.PeekArray();
  13. }
  14. } // namespace Carbon::Check