handle_type.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include "toolchain/sem_ir/typed_insts.h"
  6. namespace Carbon::Lower {
  7. auto HandleArrayType(FunctionContext& context, SemIR::InstId inst_id,
  8. SemIR::ArrayType /*inst*/) -> void {
  9. context.SetLocal(inst_id, context.GetTypeAsValue());
  10. }
  11. auto HandleAssociatedEntityType(FunctionContext& context, SemIR::InstId inst_id,
  12. SemIR::AssociatedEntityType /*inst*/) -> void {
  13. context.SetLocal(inst_id, context.GetTypeAsValue());
  14. }
  15. auto HandleClassType(FunctionContext& context, SemIR::InstId inst_id,
  16. SemIR::ClassType /*inst*/) -> void {
  17. context.SetLocal(inst_id, context.GetTypeAsValue());
  18. }
  19. auto HandleConstType(FunctionContext& context, SemIR::InstId inst_id,
  20. SemIR::ConstType /*inst*/) -> void {
  21. context.SetLocal(inst_id, context.GetTypeAsValue());
  22. }
  23. auto HandleFacetTypeAccess(FunctionContext& context, SemIR::InstId inst_id,
  24. SemIR::FacetTypeAccess /*inst*/) -> void {
  25. context.SetLocal(inst_id, context.GetTypeAsValue());
  26. }
  27. auto HandleInterfaceType(FunctionContext& context, SemIR::InstId inst_id,
  28. SemIR::InterfaceType /*inst*/) -> void {
  29. context.SetLocal(inst_id, context.GetTypeAsValue());
  30. }
  31. auto HandlePointerType(FunctionContext& context, SemIR::InstId inst_id,
  32. SemIR::PointerType /*inst*/) -> void {
  33. context.SetLocal(inst_id, context.GetTypeAsValue());
  34. }
  35. auto HandleStructType(FunctionContext& context, SemIR::InstId inst_id,
  36. SemIR::StructType /*inst*/) -> void {
  37. context.SetLocal(inst_id, context.GetTypeAsValue());
  38. }
  39. auto HandleTupleType(FunctionContext& context, SemIR::InstId inst_id,
  40. SemIR::TupleType /*inst*/) -> void {
  41. context.SetLocal(inst_id, context.GetTypeAsValue());
  42. }
  43. auto HandleUnboundElementType(FunctionContext& context, SemIR::InstId inst_id,
  44. SemIR::UnboundElementType /*inst*/) -> void {
  45. context.SetLocal(inst_id, context.GetTypeAsValue());
  46. }
  47. } // namespace Carbon::Lower