BUILD 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 = "ids",
  15. hdrs = ["ids.h"],
  16. deps = [
  17. "//common:check",
  18. "//common:ostream",
  19. "//toolchain/base:index_base",
  20. "//toolchain/base:value_store",
  21. "//toolchain/sem_ir:builtin_kind",
  22. ],
  23. )
  24. cc_library(
  25. name = "inst_kind",
  26. srcs = ["inst_kind.cpp"],
  27. hdrs = [
  28. "inst_kind.h",
  29. "typed_insts.h",
  30. ],
  31. textual_hdrs = ["inst_kind.def"],
  32. deps = [
  33. "//common:enum_base",
  34. "//toolchain/parse:tree",
  35. "//toolchain/sem_ir:builtin_kind",
  36. "//toolchain/sem_ir:ids",
  37. "@llvm-project//llvm:Support",
  38. ],
  39. )
  40. cc_library(
  41. name = "inst",
  42. srcs = ["inst.cpp"],
  43. hdrs = ["inst.h"],
  44. deps = [
  45. ":builtin_kind",
  46. ":inst_kind",
  47. "//common:check",
  48. "//common:ostream",
  49. "//common:struct_reflection",
  50. "//toolchain/base:index_base",
  51. "//toolchain/parse:tree",
  52. "@llvm-project//llvm:Support",
  53. ],
  54. )
  55. cc_library(
  56. name = "file",
  57. srcs = ["file.cpp"],
  58. hdrs = ["file.h"],
  59. deps = [
  60. ":builtin_kind",
  61. ":ids",
  62. ":inst",
  63. ":inst_kind",
  64. ":type_info",
  65. ":value_stores",
  66. "//common:check",
  67. "//toolchain/base:value_store",
  68. "//toolchain/base:yaml",
  69. "@llvm-project//llvm:Support",
  70. ],
  71. )
  72. cc_library(
  73. name = "formatter",
  74. srcs = ["formatter.cpp"],
  75. hdrs = ["formatter.h"],
  76. deps = [
  77. ":file",
  78. ":ids",
  79. ":inst_kind",
  80. "//toolchain/base:value_store",
  81. "//toolchain/lex:tokenized_buffer",
  82. "//toolchain/parse:tree",
  83. "@llvm-project//llvm:Support",
  84. ],
  85. )
  86. cc_library(
  87. name = "entry_point",
  88. srcs = ["entry_point.cpp"],
  89. hdrs = ["entry_point.h"],
  90. deps = [
  91. ":file",
  92. "@llvm-project//llvm:Support",
  93. ],
  94. )
  95. cc_library(
  96. name = "type_info",
  97. hdrs = ["type_info.h"],
  98. deps = [
  99. ":ids",
  100. ":inst",
  101. "//common:ostream",
  102. ],
  103. )
  104. cc_library(
  105. name = "value_stores",
  106. srcs = ["value_stores.cpp"],
  107. hdrs = ["value_stores.h"],
  108. deps = [
  109. ":inst",
  110. ":type_info",
  111. "//toolchain/base:value_store",
  112. "//toolchain/base:yaml",
  113. "//toolchain/lex:token_kind",
  114. "@llvm-project//llvm:Support",
  115. ],
  116. )
  117. cc_test(
  118. name = "typed_insts_test",
  119. size = "small",
  120. srcs = ["typed_insts_test.cpp"],
  121. deps = [
  122. ":inst",
  123. ":inst_kind",
  124. "//testing/base:gtest_main",
  125. "@com_google_googletest//:gtest",
  126. ],
  127. )
  128. cc_test(
  129. name = "yaml_test",
  130. size = "small",
  131. srcs = ["yaml_test.cpp"],
  132. deps = [
  133. "//common:ostream",
  134. "//testing/base:gtest_main",
  135. "//testing/base:test_raw_ostream",
  136. "//toolchain/driver",
  137. "//toolchain/testing:yaml_test_helpers",
  138. "@com_google_googletest//:gtest",
  139. "@llvm-project//llvm:Support",
  140. ],
  141. )