BUILD 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. deps = [
  18. ":address",
  19. ":dictionary",
  20. ":field_path",
  21. ":heap_allocation_interface",
  22. ":stack",
  23. "//common:check",
  24. "//common:ostream",
  25. "//explorer/ast:declaration",
  26. "//explorer/ast:expression",
  27. "//explorer/ast:pattern",
  28. "//explorer/ast:statement",
  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:ostream",
  43. "//explorer/ast:statement",
  44. "@llvm-project//llvm:Support",
  45. ],
  46. )
  47. cc_library(
  48. name = "address",
  49. hdrs = ["address.h"],
  50. deps = [
  51. ":field_path",
  52. "//common:ostream",
  53. "@llvm-project//llvm:Support",
  54. ],
  55. )
  56. cc_library(
  57. name = "dictionary",
  58. hdrs = ["dictionary.h"],
  59. deps = ["//explorer/common:arena"],
  60. )
  61. cc_library(
  62. name = "exec_program",
  63. srcs = ["exec_program.cpp"],
  64. hdrs = ["exec_program.h"],
  65. visibility = [
  66. "//explorer:__pkg__",
  67. "//explorer/fuzzing:__pkg__",
  68. ],
  69. deps = [
  70. ":interpreter",
  71. ":resolve_control_flow",
  72. ":resolve_names",
  73. ":type_checker",
  74. "//common:check",
  75. "//common:ostream",
  76. "//explorer/ast",
  77. "//explorer/common:arena",
  78. "@llvm-project//llvm:Support",
  79. ],
  80. )
  81. cc_library(
  82. name = "field_path",
  83. hdrs = ["field_path.h"],
  84. deps = [
  85. "//common:ostream",
  86. "//explorer/ast",
  87. "//explorer/ast:static_scope",
  88. "@llvm-project//llvm:Support",
  89. ],
  90. )
  91. cc_library(
  92. name = "heap",
  93. srcs = ["heap.cpp"],
  94. hdrs = ["heap.h"],
  95. deps = [
  96. ":action_and_value",
  97. ":address",
  98. ":heap_allocation_interface",
  99. "//common:ostream",
  100. "//explorer/common:error_builders",
  101. "//explorer/common:nonnull",
  102. "//explorer/common:source_location",
  103. "@llvm-project//llvm:Support",
  104. ],
  105. )
  106. cc_library(
  107. name = "heap_allocation_interface",
  108. hdrs = ["heap_allocation_interface.h"],
  109. deps = [
  110. ":address",
  111. "//explorer/common:arena",
  112. "//explorer/common:nonnull",
  113. ],
  114. )
  115. cc_library(
  116. name = "interpreter",
  117. srcs = [
  118. "interpreter.cpp",
  119. ],
  120. hdrs = [
  121. "interpreter.h",
  122. ],
  123. deps = [
  124. ":action_and_value",
  125. ":action_stack",
  126. ":address",
  127. ":heap",
  128. ":stack",
  129. "//common:check",
  130. "//common:ostream",
  131. "//explorer/ast",
  132. "//explorer/ast:declaration",
  133. "//explorer/ast:expression",
  134. "//explorer/ast:pattern",
  135. "//explorer/common:arena",
  136. "//explorer/common:error_builders",
  137. "@llvm-project//llvm:Support",
  138. ],
  139. )
  140. cc_library(
  141. name = "resolve_control_flow",
  142. srcs = ["resolve_control_flow.cpp"],
  143. hdrs = ["resolve_control_flow.h"],
  144. deps = [
  145. "//common:check",
  146. "//explorer/ast",
  147. "//explorer/ast:declaration",
  148. "//explorer/ast:return_term",
  149. "//explorer/ast:statement",
  150. "//explorer/common:error_builders",
  151. "//explorer/common:nonnull",
  152. "@llvm-project//llvm:Support",
  153. ],
  154. )
  155. cc_library(
  156. name = "resolve_names",
  157. srcs = ["resolve_names.cpp"],
  158. hdrs = ["resolve_names.h"],
  159. deps = [
  160. ":action_and_value",
  161. "//common:check",
  162. "//explorer/ast",
  163. "//explorer/ast:declaration",
  164. "//explorer/ast:expression",
  165. "//explorer/ast:pattern",
  166. "//explorer/ast:return_term",
  167. "//explorer/ast:statement",
  168. "//explorer/ast:static_scope",
  169. "//explorer/common:arena",
  170. "@llvm-project//llvm:Support",
  171. ],
  172. )
  173. cc_library(
  174. name = "stack",
  175. hdrs = ["stack.h"],
  176. deps = ["//common:check"],
  177. )
  178. cc_library(
  179. name = "type_checker",
  180. srcs = [
  181. "impl_scope.cpp",
  182. "type_checker.cpp",
  183. ],
  184. hdrs = [
  185. "impl_scope.h",
  186. "type_checker.h",
  187. ],
  188. deps = [
  189. ":action_and_value",
  190. ":dictionary",
  191. ":interpreter",
  192. "//common:ostream",
  193. "//explorer/ast",
  194. "//explorer/ast:declaration",
  195. "//explorer/ast:expression",
  196. "//explorer/ast:statement",
  197. "//explorer/common:arena",
  198. "//explorer/common:error_builders",
  199. "//explorer/common:nonnull",
  200. "@llvm-project//llvm:Support",
  201. ],
  202. )