handle_type.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/lower/function_context.h"
  5. namespace Carbon::Lower {
  6. auto HandleArrayType(FunctionContext& context, SemIR::InstId inst_id,
  7. SemIR::ArrayType /*inst*/) -> void {
  8. context.SetLocal(inst_id, context.GetTypeAsValue());
  9. }
  10. auto HandleClassType(FunctionContext& context, SemIR::InstId inst_id,
  11. SemIR::ClassType /*inst*/) -> void {
  12. context.SetLocal(inst_id, context.GetTypeAsValue());
  13. }
  14. auto HandleConstType(FunctionContext& context, SemIR::InstId inst_id,
  15. SemIR::ConstType /*inst*/) -> void {
  16. context.SetLocal(inst_id, context.GetTypeAsValue());
  17. }
  18. auto HandlePointerType(FunctionContext& context, SemIR::InstId inst_id,
  19. SemIR::PointerType /*inst*/) -> void {
  20. context.SetLocal(inst_id, context.GetTypeAsValue());
  21. }
  22. auto HandleStructType(FunctionContext& context, SemIR::InstId inst_id,
  23. SemIR::StructType /*inst*/) -> void {
  24. context.SetLocal(inst_id, context.GetTypeAsValue());
  25. }
  26. auto HandleTupleType(FunctionContext& context, SemIR::InstId inst_id,
  27. SemIR::TupleType /*inst*/) -> void {
  28. context.SetLocal(inst_id, context.GetTypeAsValue());
  29. }
  30. auto HandleUnboundElementType(FunctionContext& context, SemIR::InstId inst_id,
  31. SemIR::UnboundElementType /*inst*/) -> void {
  32. context.SetLocal(inst_id, context.GetTypeAsValue());
  33. }
  34. } // namespace Carbon::Lower