mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 02:42:41 +00:00
This starts adding builtins with TypeType and IntegerLiteralType. Note, structurally that's all they are, and not directly accessible in any way. Adds a type field to SemanticsNode. Now, IntegerLiteralType can be identified as having type=TypeType, and IntegerLiteral as type=IntegerLiteralType. The current iteration doesn't do anything for type propagation, because I wanted to avoid making this too big. This also switches the Identifier IR to instead BindName, with some side-effects. I'd been trying to think how to provide a name for TypeType, and switching around how things worked seemed like a better approach. And while I think it's the right direction (e.g., alias should just be a BindName), I also realized I don't need to name TypeType: there's probably a keyword to refer to the builtin, so it shouldn't use regular name lookup.
53 lines
1.4 KiB
Python
53 lines
1.4 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 = "semantics_builtin_kind",
|
|
srcs = ["semantics_builtin_kind.cpp"],
|
|
hdrs = ["semantics_builtin_kind.h"],
|
|
textual_hdrs = ["semantics_builtin_kind.def"],
|
|
deps = [
|
|
"//common:ostream",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "semantics_node_kind",
|
|
srcs = ["semantics_node_kind.cpp"],
|
|
hdrs = ["semantics_node_kind.h"],
|
|
textual_hdrs = ["semantics_node_kind.def"],
|
|
deps = [
|
|
"//common:ostream",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "semantics_ir",
|
|
srcs = [
|
|
"semantics_parse_tree_handler.cpp",
|
|
"semantics_ir.cpp",
|
|
"semantics_node.cpp",
|
|
],
|
|
hdrs = [
|
|
"semantics_parse_tree_handler.h",
|
|
"semantics_ir.h",
|
|
"semantics_node.h",
|
|
],
|
|
deps = [
|
|
":semantics_builtin_kind",
|
|
":semantics_node_kind",
|
|
"//common:check",
|
|
"//common:ostream",
|
|
"//toolchain/lexer:token_kind",
|
|
"//toolchain/lexer:tokenized_buffer",
|
|
"//toolchain/parser:parse_node_kind",
|
|
"//toolchain/parser:parse_tree",
|
|
"@llvm-project//llvm:Support",
|
|
],
|
|
)
|