BUILD 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 = ["//explorer:__pkg__"])
  5. # These currently have to be a single build rule because of a dependency cycle
  6. # in printing.
  7. cc_library(
  8. name = "action_and_value",
  9. srcs = [
  10. "action.cpp",
  11. "value.cpp",
  12. ],
  13. hdrs = [
  14. "action.h",
  15. "value.h",
  16. "value_transform.h",
  17. ],
  18. textual_hdrs = [
  19. "value_kinds.def",
  20. ],
  21. # Exposed to resolve `member_test` dependencies.
  22. visibility = ["//explorer/ast:__pkg__"],
  23. deps = [
  24. ":address",
  25. ":dictionary",
  26. ":element_path",
  27. ":heap_allocation_interface",
  28. ":stack",
  29. "//common:check",
  30. "//common:error",
  31. "//common:ostream",
  32. "//explorer/ast",
  33. "//explorer/common:arena",
  34. "//explorer/common:error_builders",
  35. "//explorer/common:nonnull",
  36. "@llvm-project//llvm:Support",
  37. ],
  38. )
  39. cc_library(
  40. name = "action_stack",
  41. srcs = ["action_stack.cpp"],
  42. hdrs = ["action_stack.h"],
  43. deps = [
  44. ":action_and_value",
  45. ":stack",
  46. "//common:error",
  47. "//common:ostream",
  48. "//explorer/ast",
  49. "@llvm-project//llvm:Support",
  50. ],
  51. )
  52. cc_library(
  53. name = "address",
  54. hdrs = ["address.h"],
  55. deps = [
  56. ":element_path",
  57. "//common:ostream",
  58. "@llvm-project//llvm:Support",
  59. ],
  60. )
  61. cc_library(
  62. name = "dictionary",
  63. hdrs = ["dictionary.h"],
  64. deps = ["//explorer/common:arena"],
  65. )
  66. cc_library(
  67. name = "exec_program",
  68. srcs = ["exec_program.cpp"],
  69. hdrs = ["exec_program.h"],
  70. visibility = [
  71. "//explorer:__pkg__",
  72. "//explorer/fuzzing:__pkg__",
  73. ],
  74. deps = [
  75. ":interpreter",
  76. ":resolve_control_flow",
  77. ":resolve_names",
  78. ":resolve_unformed",
  79. ":trace_stream",
  80. ":type_checker",
  81. "//common:check",
  82. "//common:ostream",
  83. "//explorer/ast",
  84. "//explorer/common:arena",
  85. "@llvm-project//llvm:Support",
  86. ],
  87. )
  88. cc_library(
  89. name = "element_path",
  90. hdrs = ["element_path.h"],
  91. deps = [
  92. "//common:ostream",
  93. "//explorer/ast",
  94. "//explorer/ast:static_scope",
  95. "@llvm-project//llvm:Support",
  96. ],
  97. )
  98. cc_library(
  99. name = "heap",
  100. srcs = ["heap.cpp"],
  101. hdrs = ["heap.h"],
  102. deps = [
  103. ":action_and_value",
  104. ":address",
  105. ":heap_allocation_interface",
  106. "//common:ostream",
  107. "//explorer/common:error_builders",
  108. "//explorer/common:nonnull",
  109. "//explorer/common:source_location",
  110. "@llvm-project//llvm:Support",
  111. ],
  112. )
  113. cc_library(
  114. name = "heap_allocation_interface",
  115. hdrs = ["heap_allocation_interface.h"],
  116. deps = [
  117. ":address",
  118. "//explorer/common:arena",
  119. "//explorer/common:nonnull",
  120. ],
  121. )
  122. cc_library(
  123. name = "interpreter",
  124. srcs = [
  125. "interpreter.cpp",
  126. ],
  127. hdrs = [
  128. "interpreter.h",
  129. ],
  130. deps = [
  131. ":action_and_value",
  132. ":action_stack",
  133. ":address",
  134. ":heap",
  135. ":stack",
  136. ":trace_stream",
  137. "//common:check",
  138. "//common:error",
  139. "//common:ostream",
  140. "//explorer/ast",
  141. "//explorer/common:arena",
  142. "//explorer/common:error_builders",
  143. "//explorer/common:source_location",
  144. "@llvm-project//llvm:Support",
  145. ],
  146. )
  147. cc_library(
  148. name = "resolve_control_flow",
  149. srcs = ["resolve_control_flow.cpp"],
  150. hdrs = ["resolve_control_flow.h"],
  151. deps = [
  152. "//common:check",
  153. "//explorer/ast",
  154. "//explorer/common:error_builders",
  155. "//explorer/common:nonnull",
  156. "@llvm-project//llvm:Support",
  157. ],
  158. )
  159. cc_library(
  160. name = "resolve_names",
  161. srcs = ["resolve_names.cpp"],
  162. hdrs = ["resolve_names.h"],
  163. deps = [
  164. ":action_and_value",
  165. "//common:check",
  166. "//explorer/ast",
  167. "//explorer/ast:static_scope",
  168. "//explorer/common:arena",
  169. "@llvm-project//llvm:Support",
  170. ],
  171. )
  172. cc_library(
  173. name = "stack",
  174. hdrs = ["stack.h"],
  175. deps = ["//common:check"],
  176. )
  177. cc_library(
  178. name = "pattern_analysis",
  179. srcs = [
  180. "pattern_analysis.cpp",
  181. ],
  182. hdrs = [
  183. "pattern_analysis.h",
  184. ],
  185. deps = [
  186. ":action_and_value",
  187. "//common:error",
  188. "//explorer/ast",
  189. "//explorer/common:nonnull",
  190. "@llvm-project//llvm:Support",
  191. ],
  192. )
  193. cc_library(
  194. name = "trace_stream",
  195. hdrs = ["trace_stream.h"],
  196. visibility = [
  197. "//explorer:__pkg__",
  198. "//explorer/fuzzing:__pkg__",
  199. ],
  200. deps = [
  201. "//common:check",
  202. "//common:ostream",
  203. "//explorer/common:nonnull",
  204. ],
  205. )
  206. cc_library(
  207. name = "type_checker",
  208. srcs = [
  209. "builtins.cpp",
  210. "impl_scope.cpp",
  211. "matching_impl_set.cpp",
  212. "type_checker.cpp",
  213. ],
  214. hdrs = [
  215. "builtins.h",
  216. "impl_scope.h",
  217. "matching_impl_set.h",
  218. "type_checker.h",
  219. ],
  220. deps = [
  221. ":action_and_value",
  222. ":dictionary",
  223. ":interpreter",
  224. ":pattern_analysis",
  225. ":trace_stream",
  226. "//common:check",
  227. "//common:error",
  228. "//common:ostream",
  229. "//explorer/ast",
  230. "//explorer/common:arena",
  231. "//explorer/common:error_builders",
  232. "//explorer/common:nonnull",
  233. "//explorer/common:source_location",
  234. "@llvm-project//llvm:Support",
  235. ],
  236. )
  237. cc_library(
  238. name = "resolve_unformed",
  239. srcs = [
  240. "resolve_unformed.cpp",
  241. ],
  242. hdrs = [
  243. "resolve_unformed.h",
  244. ],
  245. deps = [
  246. "//common:check",
  247. "//explorer/ast",
  248. "//explorer/ast:static_scope",
  249. "//explorer/common:error_builders",
  250. "//explorer/common:nonnull",
  251. "@llvm-project//llvm:Support",
  252. ],
  253. )