BUILD 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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", "cc_test")
  5. package(default_visibility = ["//visibility:public"])
  6. cc_library(
  7. name = "builtin_inst_kind",
  8. srcs = ["builtin_inst_kind.cpp"],
  9. hdrs = ["builtin_inst_kind.h"],
  10. textual_hdrs = ["builtin_inst_kind.def"],
  11. deps = ["//common:enum_base"],
  12. )
  13. cc_library(
  14. name = "block_value_store",
  15. hdrs = ["block_value_store.h"],
  16. deps = [
  17. "//common:hashing",
  18. "//common:set",
  19. "//toolchain/base:value_store",
  20. "//toolchain/base:yaml",
  21. "@llvm-project//llvm:Support",
  22. ],
  23. )
  24. cc_library(
  25. name = "ids",
  26. hdrs = [
  27. "id_kind.h",
  28. "ids.h",
  29. ],
  30. deps = [
  31. "//common:check",
  32. "//common:ostream",
  33. "//toolchain/base:index_base",
  34. "//toolchain/base:shared_value_stores",
  35. "//toolchain/base:value_ids",
  36. "//toolchain/diagnostics:diagnostic_emitter",
  37. "//toolchain/parse:node_kind",
  38. "//toolchain/sem_ir:builtin_inst_kind",
  39. ],
  40. )
  41. cc_library(
  42. name = "inst_kind",
  43. srcs = ["inst_kind.cpp"],
  44. hdrs = [
  45. "inst_kind.h",
  46. "typed_insts.h",
  47. ],
  48. textual_hdrs = ["inst_kind.def"],
  49. deps = [
  50. "//common:check",
  51. "//common:enum_base",
  52. "//toolchain/parse:node_kind",
  53. "//toolchain/sem_ir:builtin_inst_kind",
  54. "//toolchain/sem_ir:ids",
  55. "@llvm-project//llvm:Support",
  56. ],
  57. )
  58. cc_library(
  59. name = "inst",
  60. srcs = ["inst.cpp"],
  61. hdrs = ["inst.h"],
  62. deps = [
  63. ":block_value_store",
  64. ":builtin_inst_kind",
  65. ":ids",
  66. ":inst_kind",
  67. "//common:check",
  68. "//common:hashing",
  69. "//common:ostream",
  70. "//common:struct_reflection",
  71. "//toolchain/base:index_base",
  72. "//toolchain/base:value_store",
  73. "@llvm-project//llvm:Support",
  74. ],
  75. )
  76. cc_library(
  77. name = "file",
  78. srcs = [
  79. "builtin_function_kind.cpp",
  80. "class.cpp",
  81. "constant.cpp",
  82. "file.cpp",
  83. "function.cpp",
  84. "generic.cpp",
  85. "impl.cpp",
  86. "name.cpp",
  87. "type_info.cpp",
  88. ],
  89. hdrs = [
  90. "builtin_function_kind.h",
  91. "class.h",
  92. "constant.h",
  93. "copy_on_write_block.h",
  94. "entity_name.h",
  95. "entity_with_params_base.h",
  96. "file.h",
  97. "function.h",
  98. "generic.h",
  99. "impl.h",
  100. "import_ir.h",
  101. "interface.h",
  102. "name.h",
  103. "name_scope.h",
  104. "type.h",
  105. "type_info.h",
  106. ],
  107. textual_hdrs = [
  108. "builtin_function_kind.def",
  109. ],
  110. deps = [
  111. ":block_value_store",
  112. ":builtin_inst_kind",
  113. ":ids",
  114. ":inst",
  115. ":inst_kind",
  116. "//common:check",
  117. "//common:enum_base",
  118. "//common:error",
  119. "//common:hashing",
  120. "//common:map",
  121. "//common:ostream",
  122. "//common:set",
  123. "//toolchain/base:kind_switch",
  124. "//toolchain/base:shared_value_stores",
  125. "//toolchain/base:value_ids",
  126. "//toolchain/base:value_store",
  127. "//toolchain/base:yaml",
  128. "//toolchain/lex:token_kind",
  129. "//toolchain/parse:node_kind",
  130. "@llvm-project//llvm:Support",
  131. ],
  132. )
  133. cc_library(
  134. name = "stringify_type",
  135. srcs = ["stringify_type.cpp"],
  136. hdrs = ["stringify_type.h"],
  137. deps = [
  138. ":file",
  139. ":ids",
  140. ":inst_kind",
  141. "//common:check",
  142. "//toolchain/base:kind_switch",
  143. "@llvm-project//llvm:Support",
  144. ],
  145. )
  146. cc_library(
  147. name = "inst_namer",
  148. srcs = ["inst_namer.cpp"],
  149. hdrs = ["inst_namer.h"],
  150. deps = [
  151. ":file",
  152. ":ids",
  153. ":inst_kind",
  154. "//common:ostream",
  155. "//toolchain/base:kind_switch",
  156. "//toolchain/base:shared_value_stores",
  157. "//toolchain/lex:tokenized_buffer",
  158. "//toolchain/parse:tree",
  159. "@llvm-project//llvm:Support",
  160. ],
  161. )
  162. cc_library(
  163. name = "formatter",
  164. srcs = ["formatter.cpp"],
  165. hdrs = ["formatter.h"],
  166. deps = [
  167. ":file",
  168. ":ids",
  169. ":inst_kind",
  170. ":inst_namer",
  171. "//common:ostream",
  172. "//toolchain/base:kind_switch",
  173. "//toolchain/base:shared_value_stores",
  174. "//toolchain/lex:tokenized_buffer",
  175. "//toolchain/parse:tree",
  176. "@llvm-project//llvm:Support",
  177. ],
  178. )
  179. cc_library(
  180. name = "entry_point",
  181. srcs = ["entry_point.cpp"],
  182. hdrs = ["entry_point.h"],
  183. deps = [
  184. ":file",
  185. "@llvm-project//llvm:Support",
  186. ],
  187. )
  188. cc_test(
  189. name = "typed_insts_test",
  190. size = "small",
  191. srcs = ["typed_insts_test.cpp"],
  192. deps = [
  193. ":inst",
  194. ":inst_kind",
  195. "//testing/base:gtest_main",
  196. "@googletest//:gtest",
  197. ],
  198. )
  199. cc_test(
  200. name = "yaml_test",
  201. size = "small",
  202. srcs = ["yaml_test.cpp"],
  203. deps = [
  204. "//common:ostream",
  205. "//testing/base:global_exe_path",
  206. "//testing/base:gtest_main",
  207. "//testing/base:test_raw_ostream",
  208. "//toolchain/driver",
  209. "//toolchain/testing:yaml_test_helpers",
  210. "@googletest//:gtest",
  211. "@llvm-project//llvm:Support",
  212. ],
  213. )