mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Implement calls in the toolchain. (#2582)
This adds tracking of call information plus basic type checking. It adds a builtin for the empty tuple, mainly so that I have the basis for a default function return type. As an aside, it also unifies printing within SemanticsIR, fixing a missing comma after callables. Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
22d7cd19ed
commit
f7924aa93f
@@ -19,9 +19,10 @@ namespace Carbon {
|
||||
class SemanticsNodeBlockStack {
|
||||
public:
|
||||
explicit SemanticsNodeBlockStack(
|
||||
llvm::StringLiteral name,
|
||||
llvm::SmallVector<llvm::SmallVector<SemanticsNodeId>>& node_blocks,
|
||||
llvm::raw_ostream* vlog_stream)
|
||||
: node_blocks_(&node_blocks), vlog_stream_(vlog_stream) {}
|
||||
: name_(name), node_blocks_(&node_blocks), vlog_stream_(vlog_stream) {}
|
||||
|
||||
// Pushes a new node block. It will be invalid unless PeekForAdd is called in
|
||||
// order to support lazy allocation.
|
||||
@@ -45,6 +46,9 @@ class SemanticsNodeBlockStack {
|
||||
auto size() const -> size_t { return stack_.size(); }
|
||||
|
||||
private:
|
||||
// A name for debugging.
|
||||
llvm::StringLiteral name_;
|
||||
|
||||
// The underlying node block storage on SemanticsIR. Always non-null.
|
||||
llvm::SmallVector<llvm::SmallVector<SemanticsNodeId>>* const node_blocks_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user