mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:41:08 +01:00
It was in my mind to add String in order to support libraries in `package`. `print` is added in order to have a String go to stdout. I've tried to do `print` in a way that won't be too hard to add other printable types, but it's probably also somewhat optional here -- that is, if desired, I could remove it. But it was a lot easier to doublecheck `\n` behavior with it, and I suspect it'll be helpful in other tests if it supports more value types. On the side, this also fixes dereferencing in Pattern/Expression Print() calls, which I was noticing printing pointers instead of values. This may be another argument for moving away from passing pointers, since this seems to be a difficult-to-catch error. Co-authored-by: Geoff Romer <gromer@google.com>
67 lines
1.3 KiB
Python
67 lines
1.3 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
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
cc_library(
|
|
name = "check",
|
|
hdrs = ["check.h"],
|
|
deps = [
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "check_test",
|
|
srcs = ["check_test.cpp"],
|
|
deps = [
|
|
":check",
|
|
"@llvm-project//llvm:gtest",
|
|
"@llvm-project//llvm:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "indirect_value",
|
|
srcs = ["indirect_value.h"],
|
|
)
|
|
|
|
cc_test(
|
|
name = "indirect_value_test",
|
|
srcs = ["indirect_value_test.cpp"],
|
|
deps = [
|
|
":indirect_value",
|
|
"@llvm-project//llvm:gtest",
|
|
"@llvm-project//llvm:gtest_main",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "ostream",
|
|
hdrs = ["ostream.h"],
|
|
deps = [
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "string_helpers",
|
|
srcs = ["string_helpers.cpp"],
|
|
hdrs = ["string_helpers.h"],
|
|
deps = [
|
|
":check",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "string_helpers_test",
|
|
srcs = ["string_helpers_test.cpp"],
|
|
deps = [
|
|
":string_helpers",
|
|
"@llvm-project//llvm:gtest",
|
|
"@llvm-project//llvm:gtest_main",
|
|
],
|
|
)
|