| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- # 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("@rules_cc//cc:defs.bzl", "cc_library")
- load("//bazel/sh_run:rules.bzl", "glob_sh_run")
- load("//testing/fuzzing:rules.bzl", "cc_fuzz_test")
- package(default_visibility = ["//visibility:public"])
- filegroup(
- name = "testdata",
- data = glob(["testdata/**/*.carbon"]),
- )
- cc_library(
- name = "node_stack",
- srcs = ["node_stack.cpp"],
- hdrs = ["node_stack.h"],
- deps = [
- "//common:check",
- "//common:ostream",
- "//common:vlog",
- "//toolchain/parse:node_kind",
- "//toolchain/parse:tree",
- "//toolchain/sem_ir:node",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_library(
- name = "check",
- srcs = [
- "check.cpp",
- "context.cpp",
- "convert.cpp",
- "declaration_name_stack.cpp",
- "node_block_stack.cpp",
- ] +
- # Glob handler files to avoid missing any.
- glob([
- "handle*.cpp",
- ]),
- hdrs = [
- "check.h",
- "context.h",
- "convert.h",
- "declaration_name_stack.h",
- "node_block_stack.h",
- "pending_block.h",
- ],
- deps = [
- ":node_stack",
- "//common:check",
- "//common:ostream",
- "//common:vlog",
- "//toolchain/base:pretty_stack_trace_function",
- "//toolchain/diagnostics:diagnostic_emitter",
- "//toolchain/diagnostics:diagnostic_kind",
- "//toolchain/lex:tokenized_buffer",
- "//toolchain/parse:node_kind",
- "//toolchain/parse:tree",
- "//toolchain/parse:tree_node_location_translator",
- "//toolchain/sem_ir:builtin_kind",
- "//toolchain/sem_ir:file",
- "//toolchain/sem_ir:node",
- "//toolchain/sem_ir:node_kind",
- "@llvm-project//llvm:Support",
- ],
- )
- cc_fuzz_test(
- name = "check_fuzzer",
- size = "small",
- srcs = ["check_fuzzer.cpp"],
- corpus = glob(["fuzzer_corpus/*"]),
- deps = [
- "//toolchain/driver",
- "@llvm-project//llvm:Support",
- ],
- )
- glob_sh_run(
- args = [
- "$(location //toolchain/driver:carbon)",
- "compile",
- "--phase=check",
- "--dump-sem-ir",
- "--dump-raw-sem-ir",
- ],
- data = ["//toolchain/driver:carbon"],
- file_exts = ["carbon"],
- )
- glob_sh_run(
- args = [
- "$(location //toolchain/driver:carbon)",
- "-v",
- "compile",
- "--phase=check",
- ],
- data = ["//toolchain/driver:carbon"],
- file_exts = ["carbon"],
- run_ext = "verbose",
- )
|