BUILD 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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")
  5. package(default_visibility = ["//explorer/parse_and_execute:__pkg__"])
  6. cc_library(
  7. name = "action",
  8. srcs = [
  9. "action.cpp",
  10. ],
  11. hdrs = [
  12. "action.h",
  13. ],
  14. deps = [
  15. ":dictionary",
  16. ":heap_allocation_interface",
  17. ":stack",
  18. "//common:check",
  19. "//common:error",
  20. "//common:ostream",
  21. "//explorer/ast",
  22. "//explorer/base:arena",
  23. "//explorer/base:error_builders",
  24. "//explorer/base:nonnull",
  25. "//explorer/base:print_as_id",
  26. "//explorer/base:source_location",
  27. "@llvm-project//llvm:Support",
  28. ],
  29. )
  30. cc_library(
  31. name = "action_stack",
  32. srcs = [
  33. "action_stack.cpp",
  34. ],
  35. hdrs = [
  36. "action_stack.h",
  37. ],
  38. deps = [
  39. ":action",
  40. ":stack",
  41. "//common:check",
  42. "//common:error",
  43. "//common:ostream",
  44. "//explorer/ast",
  45. "//explorer/base:trace_stream",
  46. "@llvm-project//llvm:Support",
  47. ],
  48. )
  49. cc_library(
  50. name = "dictionary",
  51. hdrs = ["dictionary.h"],
  52. deps = ["//explorer/base:arena"],
  53. )
  54. cc_library(
  55. name = "exec_program",
  56. srcs = ["exec_program.cpp"],
  57. hdrs = ["exec_program.h"],
  58. deps = [
  59. ":interpreter",
  60. ":resolve_control_flow",
  61. ":resolve_names",
  62. ":resolve_unformed",
  63. ":type_checker",
  64. "//common:check",
  65. "//common:error",
  66. "//common:ostream",
  67. "//explorer/ast",
  68. "//explorer/base:arena",
  69. "//explorer/base:trace_stream",
  70. "@llvm-project//llvm:Support",
  71. ],
  72. )
  73. cc_library(
  74. name = "heap",
  75. srcs = ["heap.cpp"],
  76. hdrs = ["heap.h"],
  77. deps = [
  78. ":action",
  79. ":heap_allocation_interface",
  80. "//common:check",
  81. "//common:error",
  82. "//common:ostream",
  83. "//explorer/ast",
  84. "//explorer/base:error_builders",
  85. "//explorer/base:nonnull",
  86. "//explorer/base:source_location",
  87. "//explorer/base:trace_stream",
  88. "@llvm-project//llvm:Support",
  89. ],
  90. )
  91. cc_library(
  92. name = "heap_allocation_interface",
  93. hdrs = ["heap_allocation_interface.h"],
  94. deps = [
  95. "//common:error",
  96. "//explorer/ast",
  97. "//explorer/base:arena",
  98. "//explorer/base:nonnull",
  99. "//explorer/base:source_location",
  100. ],
  101. )
  102. cc_library(
  103. name = "interpreter",
  104. srcs = [
  105. "interpreter.cpp",
  106. ],
  107. hdrs = [
  108. "interpreter.h",
  109. ],
  110. deps = [
  111. ":action",
  112. ":action_stack",
  113. ":heap",
  114. ":pattern_match",
  115. ":stack",
  116. ":type_utils",
  117. "//common:check",
  118. "//common:error",
  119. "//common:ostream",
  120. "//explorer/ast",
  121. "//explorer/ast:expression_category",
  122. "//explorer/base:arena",
  123. "//explorer/base:error_builders",
  124. "//explorer/base:print_as_id",
  125. "//explorer/base:source_location",
  126. "//explorer/base:trace_stream",
  127. "@llvm-project//llvm:Support",
  128. ],
  129. )
  130. cc_library(
  131. name = "resolve_control_flow",
  132. srcs = ["resolve_control_flow.cpp"],
  133. hdrs = ["resolve_control_flow.h"],
  134. deps = [
  135. "//common:check",
  136. "//explorer/ast",
  137. "//explorer/base:error_builders",
  138. "//explorer/base:nonnull",
  139. "//explorer/base:print_as_id",
  140. "//explorer/base:trace_stream",
  141. "@llvm-project//llvm:Support",
  142. ],
  143. )
  144. cc_library(
  145. name = "resolve_names",
  146. srcs = ["resolve_names.cpp"],
  147. hdrs = ["resolve_names.h"],
  148. deps = [
  149. ":stack_space",
  150. "//common:check",
  151. "//explorer/ast",
  152. "//explorer/ast:static_scope",
  153. "//explorer/base:arena",
  154. "//explorer/base:print_as_id",
  155. "//explorer/base:trace_stream",
  156. "@llvm-project//llvm:Support",
  157. ],
  158. )
  159. cc_library(
  160. name = "stack",
  161. hdrs = ["stack.h"],
  162. deps = ["//common:check"],
  163. )
  164. cc_library(
  165. name = "pattern_analysis",
  166. srcs = [
  167. "pattern_analysis.cpp",
  168. ],
  169. hdrs = [
  170. "pattern_analysis.h",
  171. ],
  172. deps = [
  173. ":action",
  174. "//common:error",
  175. "//explorer/ast",
  176. "//explorer/base:nonnull",
  177. "@llvm-project//llvm:Support",
  178. ],
  179. )
  180. cc_library(
  181. name = "type_checker",
  182. srcs = [
  183. "builtins.cpp",
  184. "impl_scope.cpp",
  185. "matching_impl_set.cpp",
  186. "type_checker.cpp",
  187. ],
  188. hdrs = [
  189. "builtins.h",
  190. "impl_scope.h",
  191. "matching_impl_set.h",
  192. "type_checker.h",
  193. ],
  194. textual_hdrs = [
  195. "builtins.def",
  196. ],
  197. deps = [
  198. ":action",
  199. ":dictionary",
  200. ":interpreter",
  201. ":pattern_analysis",
  202. ":pattern_match",
  203. ":stack_space",
  204. ":type_structure",
  205. ":type_utils",
  206. "//common:check",
  207. "//common:enum_base",
  208. "//common:error",
  209. "//common:ostream",
  210. "//explorer/ast",
  211. "//explorer/base:arena",
  212. "//explorer/base:error_builders",
  213. "//explorer/base:nonnull",
  214. "//explorer/base:print_as_id",
  215. "//explorer/base:source_location",
  216. "//explorer/base:trace_stream",
  217. "@llvm-project//llvm:Support",
  218. ],
  219. )
  220. cc_library(
  221. name = "resolve_unformed",
  222. srcs = [
  223. "resolve_unformed.cpp",
  224. ],
  225. hdrs = [
  226. "resolve_unformed.h",
  227. ],
  228. deps = [
  229. ":stack_space",
  230. "//common:check",
  231. "//explorer/ast",
  232. "//explorer/ast:static_scope",
  233. "//explorer/base:error_builders",
  234. "//explorer/base:nonnull",
  235. "//explorer/base:print_as_id",
  236. "//explorer/base:trace_stream",
  237. "@llvm-project//llvm:Support",
  238. ],
  239. )
  240. cc_library(
  241. name = "stack_space",
  242. srcs = ["stack_space.cpp"],
  243. hdrs = ["stack_space.h"],
  244. deps = [
  245. "//common:check",
  246. "//common:error",
  247. "@llvm-project//llvm:Support",
  248. ],
  249. )
  250. cc_library(
  251. name = "type_structure",
  252. srcs = [
  253. "type_structure.cpp",
  254. ],
  255. hdrs = [
  256. "type_structure.h",
  257. ],
  258. deps = [
  259. "//common:ostream",
  260. "//explorer/ast",
  261. "//explorer/ast:expression_category",
  262. "//explorer/base:nonnull",
  263. "@llvm-project//llvm:Support",
  264. ],
  265. )
  266. cc_library(
  267. name = "type_utils",
  268. srcs = [
  269. "type_utils.cpp",
  270. ],
  271. hdrs = [
  272. "type_utils.h",
  273. ],
  274. deps = [
  275. "//explorer/ast",
  276. "//explorer/base:nonnull",
  277. "@llvm-project//llvm:Support",
  278. ],
  279. )
  280. cc_library(
  281. name = "pattern_match",
  282. srcs = [
  283. "pattern_match.cpp",
  284. ],
  285. hdrs = [
  286. "pattern_match.h",
  287. ],
  288. deps = [
  289. ":action",
  290. ":type_utils",
  291. "//explorer/ast",
  292. "//explorer/base:arena",
  293. "//explorer/base:nonnull",
  294. "//explorer/base:source_location",
  295. "//explorer/base:trace_stream",
  296. "@llvm-project//llvm:Support",
  297. ],
  298. )