mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 18:51:09 +01:00
Change result_id to use is_valid instead of an optional. (#2449)
Incrementally shrinks size, but should also make the errors a bit clearer with better context.
This commit is contained in:
@@ -37,8 +37,11 @@ class SemanticsParseTreeHandler {
|
||||
|
||||
struct TraversalStackEntry {
|
||||
ParseTree::Node parse_node;
|
||||
std::optional<SemanticsNodeId> result_id;
|
||||
// The result_id may be invalid if there's no result.
|
||||
SemanticsNodeId result_id;
|
||||
};
|
||||
static_assert(sizeof(TraversalStackEntry) == 8,
|
||||
"Unexpected TraversalStackEntry size");
|
||||
|
||||
// Adds an identifier for a DeclaredName node, returning its reference.
|
||||
auto AddIdentifier(ParseTree::Node decl_node) -> SemanticsIdentifierId;
|
||||
|
||||
Reference in New Issue
Block a user