mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:30:12 +01:00
Move None to IdBase (#5030)
Use CRTP to eliminate per-type declarations of `None`. Note this adds `None` to a few that may not need it, but eliminates a lot off boilerplate. Note this leaves `GenericInstIndex::None` because it has a more complex construction. Also fix `InstId::InitTombstone` to be `NoneIndex - 1`
This commit is contained in:
@@ -29,14 +29,9 @@ struct DeferredDefinitionIndex : public IndexBase<DeferredDefinitionIndex> {
|
||||
static constexpr llvm::StringLiteral Label = "deferred_def";
|
||||
using ValueType = DeferredDefinition;
|
||||
|
||||
static const DeferredDefinitionIndex None;
|
||||
|
||||
using IndexBase::IndexBase;
|
||||
};
|
||||
|
||||
constexpr DeferredDefinitionIndex DeferredDefinitionIndex::None =
|
||||
DeferredDefinitionIndex(NoneIndex);
|
||||
|
||||
// A function whose definition is deferred because it is defined inline in a
|
||||
// class or similar scope.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user