BUILD 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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_kind",
  8. srcs = ["builtin_kind.cpp"],
  9. hdrs = ["builtin_kind.h"],
  10. textual_hdrs = ["builtin_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. "//toolchain/base:value_store",
  18. "//toolchain/base:yaml",
  19. "@llvm-project//llvm:Support",
  20. ],
  21. )
  22. cc_library(
  23. name = "ids",
  24. hdrs = [
  25. "id_kind.h",
  26. "ids.h",
  27. ],
  28. deps = [
  29. "//common:check",
  30. "//common:ostream",
  31. "//toolchain/base:index_base",
  32. "//toolchain/base:value_store",
  33. "//toolchain/diagnostics:diagnostic_emitter",
  34. "//toolchain/sem_ir:builtin_kind",
  35. ],
  36. )
  37. cc_library(
  38. name = "inst_kind",
  39. srcs = ["inst_kind.cpp"],
  40. hdrs = [
  41. "inst_kind.h",
  42. "typed_insts.h",
  43. ],
  44. textual_hdrs = ["inst_kind.def"],
  45. deps = [
  46. "//common:enum_base",
  47. "//toolchain/parse:node_kind",
  48. "//toolchain/sem_ir:builtin_kind",
  49. "//toolchain/sem_ir:ids",
  50. "@llvm-project//llvm:Support",
  51. ],
  52. )
  53. cc_library(
  54. name = "inst",
  55. srcs = ["inst.cpp"],
  56. hdrs = ["inst.h"],
  57. deps = [
  58. ":block_value_store",
  59. ":builtin_kind",
  60. ":ids",
  61. ":inst_kind",
  62. "//common:check",
  63. "//common:ostream",
  64. "//common:struct_reflection",
  65. "//toolchain/base:index_base",
  66. "@llvm-project//llvm:Support",
  67. ],
  68. )
  69. cc_library(
  70. name = "file",
  71. srcs = [
  72. "builtin_function_kind.cpp",
  73. "constant.cpp",
  74. "file.cpp",
  75. "inst_profile.cpp",
  76. "inst_profile.h",
  77. "name.cpp",
  78. ],
  79. hdrs = [
  80. "builtin_function_kind.h",
  81. "class.h",
  82. "constant.h",
  83. "copy_on_write_block.h",
  84. "file.h",
  85. "function.h",
  86. "impl.h",
  87. "interface.h",
  88. "name.h",
  89. "name_scope.h",
  90. "type.h",
  91. ],
  92. textual_hdrs = [
  93. "builtin_function_kind.def",
  94. ],
  95. deps = [
  96. ":block_value_store",
  97. ":builtin_kind",
  98. ":ids",
  99. ":inst",
  100. ":inst_kind",
  101. ":type_info",
  102. "//common:check",
  103. "//common:enum_base",
  104. "//common:error",
  105. "//toolchain/base:value_store",
  106. "//toolchain/base:yaml",
  107. "//toolchain/lex:token_kind",
  108. "//toolchain/parse:node_kind",
  109. "@llvm-project//llvm:Support",
  110. ],
  111. )
  112. cc_library(
  113. name = "formatter",
  114. srcs = ["formatter.cpp"],
  115. hdrs = ["formatter.h"],
  116. deps = [
  117. ":file",
  118. ":ids",
  119. ":inst_kind",
  120. "//common:ostream",
  121. "//toolchain/base:kind_switch",
  122. "//toolchain/base:value_store",
  123. "//toolchain/lex:tokenized_buffer",
  124. "//toolchain/parse:tree",
  125. "@llvm-project//llvm:Support",
  126. ],
  127. )
  128. cc_library(
  129. name = "entry_point",
  130. srcs = ["entry_point.cpp"],
  131. hdrs = ["entry_point.h"],
  132. deps = [
  133. ":file",
  134. "@llvm-project//llvm:Support",
  135. ],
  136. )
  137. cc_library(
  138. name = "type_info",
  139. hdrs = ["type_info.h"],
  140. deps = [
  141. ":ids",
  142. ":inst",
  143. "//common:ostream",
  144. ],
  145. )
  146. cc_test(
  147. name = "typed_insts_test",
  148. size = "small",
  149. srcs = ["typed_insts_test.cpp"],
  150. deps = [
  151. ":inst",
  152. ":inst_kind",
  153. "//testing/base:gtest_main",
  154. "@googletest//:gtest",
  155. ],
  156. )
  157. cc_test(
  158. name = "yaml_test",
  159. size = "small",
  160. srcs = ["yaml_test.cpp"],
  161. deps = [
  162. "//common:ostream",
  163. "//testing/base:gtest_main",
  164. "//testing/base:test_raw_ostream",
  165. "//toolchain/driver",
  166. "//toolchain/testing:yaml_test_helpers",
  167. "@googletest//:gtest",
  168. "@llvm-project//llvm:Support",
  169. ],
  170. )