BUILD 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
  5. package(default_visibility = ["//explorer:__subpackages__"])
  6. cc_library(
  7. name = "ast",
  8. srcs = [
  9. "ast_node.cpp",
  10. "ast_rtti.cpp",
  11. "bindings.cpp",
  12. "clone_context.cpp",
  13. "declaration.cpp",
  14. "element.cpp",
  15. "expression.cpp",
  16. "impl_binding.cpp",
  17. "pattern.cpp",
  18. "statement.cpp",
  19. "value.cpp",
  20. ],
  21. hdrs = [
  22. "address.h",
  23. "ast.h",
  24. "ast_kinds.h",
  25. "ast_node.h",
  26. "ast_rtti.h",
  27. "bindings.h",
  28. "clone_context.h",
  29. "declaration.h",
  30. "element.h",
  31. "element_path.h",
  32. "expression.h",
  33. "impl_binding.h",
  34. "pattern.h",
  35. "return_term.h",
  36. "statement.h",
  37. "value.h",
  38. "value_node.h",
  39. "value_transform.h",
  40. ],
  41. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  42. # don't spend time linting it.
  43. tags = ["no-clang-tidy"],
  44. textual_hdrs = [
  45. "value_kinds.def",
  46. ],
  47. deps = [
  48. ":expression_category",
  49. ":library_name",
  50. ":paren_contents",
  51. "//common:check",
  52. "//common:enum_base",
  53. "//common:error",
  54. "//common:indirect_value",
  55. "//common:ostream",
  56. "//explorer/base:arena",
  57. "//explorer/base:decompose",
  58. "//explorer/base:error_builders",
  59. "//explorer/base:nonnull",
  60. "//explorer/base:print_as_id",
  61. "//explorer/base:source_location",
  62. "@llvm-project//llvm:Support",
  63. ],
  64. )
  65. cc_library(
  66. name = "ast_test_matchers",
  67. testonly = 1,
  68. srcs = [
  69. "ast_test_matchers_internal.cpp",
  70. "ast_test_matchers_internal.h",
  71. ],
  72. hdrs = ["ast_test_matchers.h"],
  73. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  74. # don't spend time linting it.
  75. tags = ["no-clang-tidy"],
  76. deps = [
  77. ":ast",
  78. "@googletest//:gtest",
  79. "@llvm-project//llvm:Support",
  80. ],
  81. )
  82. cc_test(
  83. name = "ast_test_matchers_test",
  84. size = "small",
  85. srcs = ["ast_test_matchers_test.cpp"],
  86. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  87. # don't spend time linting it.
  88. tags = ["no-clang-tidy"],
  89. deps = [
  90. ":ast",
  91. ":ast_test_matchers",
  92. "//explorer/base:arena",
  93. "//testing/base:gtest_main",
  94. "@googletest//:gtest",
  95. ],
  96. )
  97. cc_test(
  98. name = "expression_test",
  99. size = "small",
  100. srcs = ["expression_test.cpp"],
  101. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  102. # don't spend time linting it.
  103. tags = ["no-clang-tidy"],
  104. deps = [
  105. ":ast",
  106. ":paren_contents",
  107. "//explorer/base:arena",
  108. "//testing/base:gtest_main",
  109. "@googletest//:gtest",
  110. "@llvm-project//llvm:Support",
  111. ],
  112. )
  113. cc_library(
  114. name = "library_name",
  115. hdrs = ["library_name.h"],
  116. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  117. # don't spend time linting it.
  118. tags = ["no-clang-tidy"],
  119. )
  120. cc_library(
  121. name = "paren_contents",
  122. hdrs = ["paren_contents.h"],
  123. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  124. # don't spend time linting it.
  125. tags = ["no-clang-tidy"],
  126. deps = [
  127. "//explorer/base:error_builders",
  128. "//explorer/base:source_location",
  129. ],
  130. )
  131. cc_test(
  132. name = "element_test",
  133. size = "small",
  134. srcs = ["element_test.cpp"],
  135. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  136. # don't spend time linting it.
  137. tags = ["no-clang-tidy"],
  138. deps = [
  139. ":ast",
  140. ":paren_contents",
  141. "//explorer/base:arena",
  142. "//testing/base:gtest_main",
  143. "@googletest//:gtest",
  144. "@llvm-project//llvm:Support",
  145. ],
  146. )
  147. cc_test(
  148. name = "pattern_test",
  149. size = "small",
  150. srcs = ["pattern_test.cpp"],
  151. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  152. # don't spend time linting it.
  153. tags = ["no-clang-tidy"],
  154. deps = [
  155. ":ast",
  156. ":paren_contents",
  157. "//explorer/base:arena",
  158. "//testing/base:gtest_main",
  159. "@googletest//:gtest",
  160. "@llvm-project//llvm:Support",
  161. ],
  162. )
  163. cc_library(
  164. name = "static_scope",
  165. srcs = ["static_scope.cpp"],
  166. hdrs = ["static_scope.h"],
  167. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  168. # don't spend time linting it.
  169. tags = ["no-clang-tidy"],
  170. deps = [
  171. ":ast",
  172. "//common:check",
  173. "//common:error",
  174. "//common:ostream",
  175. "//explorer/base:error_builders",
  176. "//explorer/base:nonnull",
  177. "//explorer/base:print_as_id",
  178. "//explorer/base:source_location",
  179. "//explorer/base:trace_stream",
  180. "@llvm-project//llvm:Support",
  181. ],
  182. )
  183. cc_library(
  184. name = "expression_category",
  185. hdrs = ["expression_category.h"],
  186. # Running clang-tidy is slow, and explorer is currently feature frozen, so
  187. # don't spend time linting it.
  188. tags = ["no-clang-tidy"],
  189. deps = ["@llvm-project//llvm:Support"],
  190. )