BUILD 2.7 KB

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