mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-10 12:28:25 +00:00
`IdentifiedFacetType` is a concept that is only used by check. It does not appear in the semir output, unlike `DeclaredFacetType`s. `IdentifiedFacetType` is used in check to collapse named constraints together, building a single structure of requirements from a `DeclaredFacetType` and any referenced named constraints. This is used for operations like impl lookup, and building `FacetValue`s. The outputs of `IdentifiedFacetType` are now in an intermediate state, where they contain `IdentifiedWitness`es, and need to be processed before they are used. We'd like to build that into the API of `IdentifiedFacetType` so that their use is more robust. But the `IdentifiedWitnesses` need to be replaced by subst, which is a part of check, so we need to move `IdentifiedFacetType` to check in order to build the type on top of subst.
476 lines
11 KiB
Python
476 lines
11 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
load("//bazel/cc_rules:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
cc_library(
|
|
name = "typed_insts",
|
|
srcs = [
|
|
"ids.cpp",
|
|
"inst_kind.cpp",
|
|
],
|
|
hdrs = [
|
|
"id_kind.h",
|
|
"ids.h",
|
|
"inst_categories.h",
|
|
"inst_kind.h",
|
|
"singleton_insts.h",
|
|
"specific_interface.h",
|
|
"specific_named_constraint.h",
|
|
"typed_insts.h",
|
|
],
|
|
textual_hdrs = ["inst_kind.def"],
|
|
deps = [
|
|
"//common:check",
|
|
"//common:enum_base",
|
|
"//common:ostream",
|
|
"//common:template_string",
|
|
"//common:type_enum",
|
|
"//toolchain/base:canonical_value_store",
|
|
"//toolchain/base:index_base",
|
|
"//toolchain/base:int",
|
|
"//toolchain/base:value_ids",
|
|
"//toolchain/diagnostics:emitter",
|
|
"//toolchain/parse:node_kind",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "ids_test",
|
|
srcs = ["ids_test.cpp"],
|
|
deps = [
|
|
":typed_insts",
|
|
"//testing/base:gtest_main",
|
|
"@googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "clang_decl",
|
|
srcs = ["clang_decl.cpp"],
|
|
hdrs = ["clang_decl.h"],
|
|
deps = [
|
|
":typed_insts",
|
|
"//common:hashtable_key_context",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"//common:set",
|
|
"//toolchain/base:canonical_value_store",
|
|
"//toolchain/base:value_store",
|
|
"@llvm-project//clang:ast",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "cpp_file",
|
|
hdrs = [
|
|
"cpp_domain.h",
|
|
"cpp_file.h",
|
|
],
|
|
deps = [
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//common:map",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:basic",
|
|
"@llvm-project//clang:codegen",
|
|
"@llvm-project//clang:frontend",
|
|
"@llvm-project//clang:lex",
|
|
"@llvm-project//clang:sema",
|
|
"@llvm-project//llvm:Core",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "file",
|
|
srcs = [
|
|
"associated_constant.cpp",
|
|
"builtin_function_kind.cpp",
|
|
"bundle.cpp",
|
|
"class.cpp",
|
|
"constant.cpp",
|
|
"core_interface.cpp",
|
|
"cpp_domain.cpp",
|
|
"cpp_file.cpp",
|
|
"cpp_initializer_list.cpp",
|
|
"cpp_overload_set.cpp",
|
|
"declared_facet_type.cpp",
|
|
"dominance.cpp",
|
|
"entity_name.cpp",
|
|
"field.cpp",
|
|
"file.cpp",
|
|
"function.cpp",
|
|
"generic.cpp",
|
|
"impl.cpp",
|
|
"import_ir.cpp",
|
|
"inst.cpp",
|
|
"interface.cpp",
|
|
"name.cpp",
|
|
"name_scope.cpp",
|
|
"named_constraint.cpp",
|
|
"observe.cpp",
|
|
"pattern.cpp",
|
|
"require_impls.cpp",
|
|
"specific_interface.cpp",
|
|
"struct_type_field.cpp",
|
|
"type.cpp",
|
|
"type_info.cpp",
|
|
"type_iterator.cpp",
|
|
"vtable.cpp",
|
|
],
|
|
hdrs = [
|
|
"associated_constant.h",
|
|
"builtin_function_kind.h",
|
|
"bundle.h",
|
|
"class.h",
|
|
"constant.h",
|
|
"copy_on_write_block.h",
|
|
"core_interface.h",
|
|
"cpp_domain.h",
|
|
"cpp_initializer_list.h",
|
|
"cpp_overload_set.h",
|
|
"declared_facet_type.h",
|
|
"dominance.h",
|
|
"entity_name.h",
|
|
"entity_with_params_base.h",
|
|
"field.h",
|
|
"file.h",
|
|
"function.h",
|
|
"generic.h",
|
|
"impl.h",
|
|
"import_cpp.h",
|
|
"import_ir.h",
|
|
"inst.h",
|
|
"interface.h",
|
|
"name.h",
|
|
"name_scope.h",
|
|
"named_constraint.h",
|
|
"observe.h",
|
|
"pattern.h",
|
|
"require_impls.h",
|
|
"struct_type_field.h",
|
|
"thunk.h",
|
|
"type.h",
|
|
"type_info.h",
|
|
"type_iterator.h",
|
|
"vtable.h",
|
|
],
|
|
textual_hdrs = [
|
|
"builtin_function_kind.def",
|
|
"core_interface_kind.def",
|
|
],
|
|
deps = [
|
|
":clang_decl",
|
|
":cpp_file",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//common:enum_base",
|
|
"//common:enum_mask_base",
|
|
"//common:error",
|
|
"//common:hashing",
|
|
"//common:map",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"//common:set",
|
|
"//common:struct_reflection",
|
|
"//toolchain/base:block_value_store",
|
|
"//toolchain/base:canonical_value_store",
|
|
"//toolchain/base:grouped_value_store",
|
|
"//toolchain/base:id_tag",
|
|
"//toolchain/base:index_base",
|
|
"//toolchain/base:int",
|
|
"//toolchain/base:kind_switch",
|
|
"//toolchain/base:relational_value_store",
|
|
"//toolchain/base:shared_value_stores",
|
|
"//toolchain/base:value_ids",
|
|
"//toolchain/base:value_store",
|
|
"//toolchain/base:yaml",
|
|
"//toolchain/lex:token_kind",
|
|
"//toolchain/parse:node_kind",
|
|
"//toolchain/parse:tree",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:basic",
|
|
"@llvm-project//clang:frontend",
|
|
"@llvm-project//clang:parse",
|
|
"@llvm-project//clang:sema",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sugared_type",
|
|
srcs = ["sugared_type.cpp"],
|
|
hdrs = ["sugared_type.h"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//toolchain/base:kind_switch",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "stringify",
|
|
srcs = ["stringify.cpp"],
|
|
hdrs = ["stringify.h"],
|
|
deps = [
|
|
":file",
|
|
":sugared_type",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//common:concepts",
|
|
"//common:raw_string_ostream",
|
|
"//toolchain/base:kind_switch",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "inst_namer",
|
|
srcs = [
|
|
"inst_fingerprinter.cpp",
|
|
"inst_namer.cpp",
|
|
],
|
|
hdrs = [
|
|
"inst_fingerprinter.h",
|
|
"inst_namer.h",
|
|
],
|
|
deps = [
|
|
":dump",
|
|
":file",
|
|
":typed_insts",
|
|
"//common:concepts",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"//common:type_enum",
|
|
"//toolchain/base:fixed_size_value_store",
|
|
"//toolchain/base:kind_switch",
|
|
"//toolchain/base:shared_value_stores",
|
|
"//toolchain/base:value_ids",
|
|
"//toolchain/lex:tokenized_buffer",
|
|
"//toolchain/parse:tree",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "formatter_chunks",
|
|
srcs = ["formatter_chunks.cpp"],
|
|
hdrs = ["formatter_chunks.h"],
|
|
deps = [
|
|
"//common:check",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "formatter",
|
|
srcs = ["formatter.cpp"],
|
|
hdrs = ["formatter.h"],
|
|
deps = [
|
|
":expr_info",
|
|
":file",
|
|
":formatter_chunks",
|
|
":inst_namer",
|
|
":typed_insts",
|
|
"//common:concepts",
|
|
"//common:ostream",
|
|
"//toolchain/base:fixed_size_value_store",
|
|
"//toolchain/base:kind_switch",
|
|
"//toolchain/base:shared_value_stores",
|
|
"//toolchain/lex:tokenized_buffer",
|
|
"//toolchain/parse:tree",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "entry_point",
|
|
srcs = ["entry_point.cpp"],
|
|
hdrs = ["entry_point.h"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "absolute_node_ref",
|
|
srcs = ["absolute_node_ref.cpp"],
|
|
hdrs = ["absolute_node_ref.h"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"//toolchain/parse:tree",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "expr_info",
|
|
srcs = ["expr_info.cpp"],
|
|
hdrs = ["expr_info.h"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//toolchain/base:kind_switch",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "diagnostic_loc_converter",
|
|
srcs = ["diagnostic_loc_converter.cpp"],
|
|
hdrs = ["diagnostic_loc_converter.h"],
|
|
deps = [
|
|
":absolute_node_ref",
|
|
":file",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//toolchain/diagnostics:emitter",
|
|
"//toolchain/parse:tree",
|
|
"@llvm-project//clang:basic",
|
|
"@llvm-project//clang:frontend",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "dump",
|
|
srcs = ["dump.cpp"],
|
|
hdrs = ["dump.h"],
|
|
deps = [
|
|
":file",
|
|
":stringify",
|
|
":typed_insts",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"@llvm-project//clang:ast",
|
|
],
|
|
# Always link dump methods so they are callable from a debugger
|
|
# even though they are never called.
|
|
alwayslink = 1,
|
|
)
|
|
|
|
cc_test(
|
|
name = "name_scope_test",
|
|
size = "small",
|
|
srcs = ["name_scope_test.cpp"],
|
|
deps = [
|
|
":file",
|
|
"//testing/base:gtest_main",
|
|
"@googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "typed_insts_test",
|
|
size = "small",
|
|
srcs = ["typed_insts_test.cpp"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"//testing/base:gtest_main",
|
|
"@googletest//:gtest",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "dominance_test_helpers",
|
|
testonly = 1,
|
|
hdrs = ["dominance_test_helpers.h"],
|
|
deps = [
|
|
":file",
|
|
":typed_insts",
|
|
"//toolchain/base:shared_value_stores",
|
|
"//toolchain/parse:node_kind",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "dominance_test",
|
|
size = "small",
|
|
srcs = ["dominance_test.cpp"],
|
|
deps = [
|
|
":dominance_test_helpers",
|
|
":file",
|
|
":typed_insts",
|
|
"//testing/base:gtest_main",
|
|
"//toolchain/parse:node_kind",
|
|
"@googletest//:gtest",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "dominance_benchmark",
|
|
testonly = 1,
|
|
srcs = ["dominance_benchmark.cpp"],
|
|
deps = [
|
|
":dominance_test_helpers",
|
|
":file",
|
|
":typed_insts",
|
|
"//common:check",
|
|
"//common:error",
|
|
"//testing/base:benchmark_main",
|
|
"@google_benchmark//:benchmark",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "yaml_test",
|
|
size = "small",
|
|
srcs = ["yaml_test.cpp"],
|
|
deps = [
|
|
"//common:all_llvm_targets",
|
|
"//common:ostream",
|
|
"//common:raw_string_ostream",
|
|
"//testing/base:global_exe_path",
|
|
"//testing/base:gtest_main",
|
|
"//toolchain/driver",
|
|
"//toolchain/testing:yaml_test_helpers",
|
|
"@googletest//:gtest",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "mangler",
|
|
srcs = ["mangler.cpp"],
|
|
hdrs = ["mangler.h"],
|
|
deps = [
|
|
":entry_point",
|
|
":file",
|
|
":inst_namer",
|
|
":typed_insts",
|
|
"//common:raw_string_ostream",
|
|
"//toolchain/base:kind_switch",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:basic",
|
|
"@llvm-project//clang:codegen",
|
|
"@llvm-project//llvm:Core",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "read_only_ast_source",
|
|
srcs = ["read_only_ast_source.cpp"],
|
|
hdrs = ["read_only_ast_source.h"],
|
|
deps = [
|
|
"//toolchain/sem_ir:file",
|
|
"@llvm-project//clang:ast",
|
|
"@llvm-project//clang:sema",
|
|
],
|
|
)
|