BUILD 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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("//bazel/cc_rules:defs.bzl", "cc_library", "cc_test")
  5. package(default_visibility = ["//visibility:public"])
  6. cc_library(
  7. name = "block_value_store",
  8. hdrs = ["block_value_store.h"],
  9. deps = [
  10. "//common:hashing",
  11. "//common:set",
  12. "//toolchain/base:value_store",
  13. "//toolchain/base:yaml",
  14. "@llvm-project//llvm:Support",
  15. ],
  16. )
  17. cc_library(
  18. name = "typed_insts",
  19. srcs = [
  20. "ids.cpp",
  21. "inst_kind.cpp",
  22. ],
  23. hdrs = [
  24. "id_kind.h",
  25. "ids.h",
  26. "inst_kind.h",
  27. "singleton_insts.h",
  28. "typed_insts.h",
  29. ],
  30. textual_hdrs = ["inst_kind.def"],
  31. deps = [
  32. "//common:check",
  33. "//common:enum_base",
  34. "//common:ostream",
  35. "//toolchain/base:index_base",
  36. "//toolchain/base:int",
  37. "//toolchain/base:value_ids",
  38. "//toolchain/diagnostics:diagnostic_emitter",
  39. "//toolchain/parse:node_kind",
  40. "@llvm-project//llvm:Support",
  41. ],
  42. )
  43. cc_test(
  44. name = "ids_test",
  45. srcs = ["ids_test.cpp"],
  46. deps = [
  47. ":typed_insts",
  48. "//testing/base:gtest_main",
  49. "@googletest//:gtest",
  50. ],
  51. )
  52. cc_library(
  53. name = "file",
  54. srcs = [
  55. "builtin_function_kind.cpp",
  56. "class.cpp",
  57. "constant.cpp",
  58. "facet_type_info.cpp",
  59. "file.cpp",
  60. "function.cpp",
  61. "generic.cpp",
  62. "impl.cpp",
  63. "import_ir.cpp",
  64. "inst.cpp",
  65. "name.cpp",
  66. "name_scope.cpp",
  67. "pattern.cpp",
  68. "type.cpp",
  69. "type_info.cpp",
  70. "type_iterator.cpp",
  71. ],
  72. hdrs = [
  73. "associated_constant.h",
  74. "builtin_function_kind.h",
  75. "class.h",
  76. "constant.h",
  77. "copy_on_write_block.h",
  78. "entity_name.h",
  79. "entity_with_params_base.h",
  80. "facet_type_info.h",
  81. "file.h",
  82. "function.h",
  83. "generic.h",
  84. "impl.h",
  85. "import_cpp.h",
  86. "import_ir.h",
  87. "inst.h",
  88. "interface.h",
  89. "name.h",
  90. "name_scope.h",
  91. "pattern.h",
  92. "struct_type_field.h",
  93. "type.h",
  94. "type_info.h",
  95. "type_iterator.h",
  96. ],
  97. textual_hdrs = [
  98. "builtin_function_kind.def",
  99. ],
  100. deps = [
  101. ":block_value_store",
  102. ":typed_insts",
  103. "//common:check",
  104. "//common:enum_base",
  105. "//common:error",
  106. "//common:hashing",
  107. "//common:map",
  108. "//common:ostream",
  109. "//common:raw_string_ostream",
  110. "//common:set",
  111. "//common:struct_reflection",
  112. "//toolchain/base:index_base",
  113. "//toolchain/base:int",
  114. "//toolchain/base:kind_switch",
  115. "//toolchain/base:shared_value_stores",
  116. "//toolchain/base:value_ids",
  117. "//toolchain/base:value_store",
  118. "//toolchain/base:yaml",
  119. "//toolchain/lex:token_kind",
  120. "//toolchain/parse:node_kind",
  121. "//toolchain/parse:tree",
  122. "@llvm-project//clang:ast",
  123. "@llvm-project//clang:frontend",
  124. "@llvm-project//llvm:Support",
  125. ],
  126. )
  127. cc_library(
  128. name = "stringify",
  129. srcs = ["stringify.cpp"],
  130. hdrs = ["stringify.h"],
  131. deps = [
  132. ":file",
  133. ":typed_insts",
  134. "//common:check",
  135. "//common:raw_string_ostream",
  136. "//toolchain/base:kind_switch",
  137. "@llvm-project//llvm:Support",
  138. ],
  139. )
  140. cc_library(
  141. name = "inst_namer",
  142. srcs = [
  143. "inst_fingerprinter.cpp",
  144. "inst_namer.cpp",
  145. ],
  146. hdrs = [
  147. "inst_fingerprinter.h",
  148. "inst_namer.h",
  149. ],
  150. deps = [
  151. ":file",
  152. ":typed_insts",
  153. "//common:ostream",
  154. "//common:raw_string_ostream",
  155. "//toolchain/base:kind_switch",
  156. "//toolchain/base:shared_value_stores",
  157. "//toolchain/base:value_ids",
  158. "//toolchain/lex:tokenized_buffer",
  159. "//toolchain/parse:tree",
  160. "@llvm-project//llvm:Support",
  161. ],
  162. )
  163. cc_library(
  164. name = "formatter",
  165. srcs = ["formatter.cpp"],
  166. hdrs = ["formatter.h"],
  167. deps = [
  168. ":expr_info",
  169. ":file",
  170. ":inst_namer",
  171. ":typed_insts",
  172. "//common:ostream",
  173. "//toolchain/base:kind_switch",
  174. "//toolchain/base:shared_value_stores",
  175. "//toolchain/lex:tokenized_buffer",
  176. "//toolchain/parse:tree",
  177. "@llvm-project//llvm:Support",
  178. ],
  179. )
  180. cc_library(
  181. name = "entry_point",
  182. srcs = ["entry_point.cpp"],
  183. hdrs = ["entry_point.h"],
  184. deps = [
  185. ":file",
  186. "@llvm-project//llvm:Support",
  187. ],
  188. )
  189. cc_library(
  190. name = "absolute_node_id",
  191. srcs = ["absolute_node_id.cpp"],
  192. hdrs = ["absolute_node_id.h"],
  193. deps = [
  194. ":file",
  195. ":typed_insts",
  196. "//toolchain/parse:tree",
  197. "@llvm-project//llvm:Support",
  198. ],
  199. )
  200. cc_library(
  201. name = "expr_info",
  202. srcs = ["expr_info.cpp"],
  203. hdrs = ["expr_info.h"],
  204. deps = [
  205. ":file",
  206. ":typed_insts",
  207. "//common:check",
  208. "//toolchain/base:kind_switch",
  209. ],
  210. )
  211. cc_library(
  212. name = "dump",
  213. srcs = ["dump.cpp"],
  214. hdrs = ["dump.h"],
  215. deps = [
  216. ":file",
  217. ":stringify",
  218. "//common:ostream",
  219. "//common:raw_string_ostream",
  220. ],
  221. # Always link dump methods so they are callable from a debugger
  222. # even though they are never called.
  223. alwayslink = 1,
  224. )
  225. cc_test(
  226. name = "name_scope_test",
  227. size = "small",
  228. srcs = ["name_scope_test.cpp"],
  229. deps = [
  230. ":file",
  231. "//testing/base:gtest_main",
  232. "@googletest//:gtest",
  233. ],
  234. )
  235. cc_test(
  236. name = "typed_insts_test",
  237. size = "small",
  238. srcs = ["typed_insts_test.cpp"],
  239. deps = [
  240. ":file",
  241. ":typed_insts",
  242. "//testing/base:gtest_main",
  243. "@googletest//:gtest",
  244. ],
  245. )
  246. cc_test(
  247. name = "yaml_test",
  248. size = "small",
  249. srcs = ["yaml_test.cpp"],
  250. deps = [
  251. "//common:ostream",
  252. "//common:raw_string_ostream",
  253. "//testing/base:global_exe_path",
  254. "//testing/base:gtest_main",
  255. "//toolchain/driver",
  256. "//toolchain/testing:yaml_test_helpers",
  257. "@googletest//:gtest",
  258. "@llvm-project//llvm:Support",
  259. ],
  260. )