BUILD 4.5 KB

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