BUILD 5.0 KB

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