BUILD 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. package(default_visibility = ["//visibility:public"])
  5. cc_library(
  6. name = "nodes",
  7. hdrs = [
  8. "nodes/declared_name.h",
  9. "nodes/expression_statement.h",
  10. "nodes/function.h",
  11. "nodes/infix_operator.h",
  12. "nodes/literal.h",
  13. "meta_node.h",
  14. "meta_node_block.h",
  15. "nodes/pattern_binding.h",
  16. "nodes/return.h",
  17. ],
  18. deps = [
  19. "//common:check",
  20. "//common:ostream",
  21. "//toolchain/parser:parse_tree",
  22. "@llvm-project//llvm:Support",
  23. ],
  24. )
  25. cc_library(
  26. name = "parse_subtree_consumer",
  27. srcs = ["parse_subtree_consumer.cpp"],
  28. hdrs = ["parse_subtree_consumer.h"],
  29. deps = [
  30. "//common:check",
  31. "//toolchain/parser:parse_tree",
  32. ],
  33. )
  34. cc_library(
  35. name = "semantics_ir",
  36. srcs = ["semantics_ir.cpp"],
  37. hdrs = ["semantics_ir.h"],
  38. deps = [
  39. ":nodes",
  40. "//common:check",
  41. "//toolchain/lexer:tokenized_buffer",
  42. "//toolchain/parser:parse_tree",
  43. "@llvm-project//llvm:Support",
  44. ],
  45. )
  46. cc_library(
  47. name = "semantics_ir_factory",
  48. srcs = ["semantics_ir_factory.cpp"],
  49. hdrs = ["semantics_ir_factory.h"],
  50. deps = [
  51. ":nodes",
  52. ":parse_subtree_consumer",
  53. ":semantics_ir",
  54. "//common:check",
  55. "//toolchain/lexer:tokenized_buffer",
  56. "//toolchain/parser:parse_node_kind",
  57. "//toolchain/parser:parse_tree",
  58. "@llvm-project//llvm:Support",
  59. ],
  60. )
  61. cc_library(
  62. name = "semantics_ir_test_helpers",
  63. testonly = 1,
  64. srcs = ["semantics_ir_for_test.cpp"],
  65. hdrs = [
  66. "nodes/declared_name_test_matchers.h",
  67. "nodes/function_test_matchers.h",
  68. "nodes/infix_operator_test_matchers.h",
  69. "nodes/literal_test_matchers.h",
  70. "nodes/pattern_binding_test_matchers.h",
  71. "nodes/return_test_matchers.h",
  72. "semantics_ir_for_test.h",
  73. "semantics_ir_test_helpers.h",
  74. ],
  75. deps = [
  76. ":nodes",
  77. ":semantics_ir",
  78. "//common:check",
  79. "//common:ostream",
  80. "@com_google_googletest//:gtest",
  81. "@llvm-project//llvm:Support",
  82. ],
  83. )
  84. cc_test(
  85. name = "semantics_ir_factory_test",
  86. size = "small",
  87. srcs = ["semantics_ir_factory_test.cpp"],
  88. deps = [
  89. ":semantics_ir_factory",
  90. ":semantics_ir_test_helpers",
  91. "//common:gtest_main",
  92. "//toolchain/diagnostics:mocks",
  93. "//toolchain/lexer:tokenized_buffer",
  94. "//toolchain/parser:parse_tree",
  95. "//toolchain/source:source_buffer",
  96. "@com_google_googletest//:gtest",
  97. "@llvm-project//llvm:Support",
  98. ],
  99. )