BUILD 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. "facet_type_info.h",
  97. "file.h",
  98. "function.h",
  99. "generic.h",
  100. "impl.h",
  101. "import_ir.h",
  102. "interface.h",
  103. "name.h",
  104. "name_scope.h",
  105. "type.h",
  106. "type_info.h",
  107. ],
  108. textual_hdrs = [
  109. "builtin_function_kind.def",
  110. ],
  111. deps = [
  112. ":block_value_store",
  113. ":builtin_inst_kind",
  114. ":ids",
  115. ":inst",
  116. ":inst_kind",
  117. "//common:check",
  118. "//common:enum_base",
  119. "//common:error",
  120. "//common:hashing",
  121. "//common:map",
  122. "//common:ostream",
  123. "//common:set",
  124. "//toolchain/base:kind_switch",
  125. "//toolchain/base:shared_value_stores",
  126. "//toolchain/base:value_ids",
  127. "//toolchain/base:value_store",
  128. "//toolchain/base:yaml",
  129. "//toolchain/lex:token_kind",
  130. "//toolchain/parse:node_kind",
  131. "@llvm-project//llvm:Support",
  132. ],
  133. )
  134. cc_library(
  135. name = "stringify_type",
  136. srcs = ["stringify_type.cpp"],
  137. hdrs = ["stringify_type.h"],
  138. deps = [
  139. ":file",
  140. ":ids",
  141. ":inst_kind",
  142. "//common:check",
  143. "//toolchain/base:kind_switch",
  144. "@llvm-project//llvm:Support",
  145. ],
  146. )
  147. cc_library(
  148. name = "inst_namer",
  149. srcs = ["inst_namer.cpp"],
  150. hdrs = ["inst_namer.h"],
  151. deps = [
  152. ":file",
  153. ":ids",
  154. ":inst_kind",
  155. "//common:ostream",
  156. "//toolchain/base:kind_switch",
  157. "//toolchain/base:shared_value_stores",
  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. ":file",
  169. ":ids",
  170. ":inst_kind",
  171. ":inst_namer",
  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_test(
  190. name = "typed_insts_test",
  191. size = "small",
  192. srcs = ["typed_insts_test.cpp"],
  193. deps = [
  194. ":inst",
  195. ":inst_kind",
  196. "//testing/base:gtest_main",
  197. "@googletest//:gtest",
  198. ],
  199. )
  200. cc_test(
  201. name = "yaml_test",
  202. size = "small",
  203. srcs = ["yaml_test.cpp"],
  204. deps = [
  205. "//common:ostream",
  206. "//testing/base:global_exe_path",
  207. "//testing/base:gtest_main",
  208. "//testing/base:test_raw_ostream",
  209. "//toolchain/driver",
  210. "//toolchain/testing:yaml_test_helpers",
  211. "@googletest//:gtest",
  212. "@llvm-project//llvm:Support",
  213. ],
  214. )