BUILD 5.4 KB

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