mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 09:21:03 +01:00
Move TODOs from CARBON_CHECK to SemanticsTODO diagnostics (#2558)
This change is to make it clearer what is a TODO versus unexpected behavior. I'm doing this now because I feel it's been getting a little confusing in code.
So for example if I write the code a return type `-> i32`, I get the diagnostic output plus the dump of the (invalid) IR:
```
/carbon-lang/toolchain/semantics/testdata/function/basic.carbon:37:10: Semantics TODO: HandleReturnType
cross_reference_irs_size: 1
callables: [
]
integer_literals: [
]
strings: [
]
nodes: [
{kind: CrossReference, arg0: ir0, arg1: block0, type: node0},
{kind: CrossReference, arg0: ir0, arg1: block1, type: node1},
{kind: CrossReference, arg0: ir0, arg1: block2, type: node0},
{kind: CrossReference, arg0: ir0, arg1: block3, type: node0},
]
node_blocks: [
[
],
]
```
This commit is contained in:
@@ -23,8 +23,6 @@ class SemanticsNodeBlockStack {
|
||||
llvm::raw_ostream* vlog_stream)
|
||||
: node_blocks_(&node_blocks), vlog_stream_(vlog_stream) {}
|
||||
|
||||
~SemanticsNodeBlockStack() { CARBON_CHECK(stack_.empty()) << stack_.size(); }
|
||||
|
||||
// Pushes a new node block. It will be invalid unless PeekForAdd is called in
|
||||
// order to support lazy allocation.
|
||||
auto Push() -> void;
|
||||
@@ -47,6 +45,9 @@ class SemanticsNodeBlockStack {
|
||||
// Prints the stack for a stack dump.
|
||||
auto PrintForStackDump(llvm::raw_ostream& output) const -> void;
|
||||
|
||||
auto empty() const -> bool { return stack_.empty(); }
|
||||
auto size() const -> size_t { return stack_.size(); }
|
||||
|
||||
private:
|
||||
// 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