BUILD 2.8 KB

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