[PATCH] D90397: [clangd] Value initialize SymbolIDs

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 31 22:13:16 PDT 2020


nridge added a comment.

In D90397#2366769 <https://reviews.llvm.org/D90397#2366769>, @sammccall wrote:

> In D90397#2366727 <https://reviews.llvm.org/D90397#2366727>, @nridge wrote:
>
>> Would it have been possible to disallow default-constructing `SymbolID` altogether, and preserve the ability to represent "an always-valid symbol id" (`SymbolID`) vs. "a maybe-valid symbol id" (`Optional<SymbolID>`) as distinct types in the type system?
>
> Absolutely, except where it matters`sizeof(SymbolID)==8` and `sizeof(Optional<SymbolID>)==16`.
> I think the trigger here was `SymbolID Ref::Container` - we can't afford to use `Optional` there.

Good point!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90397/new/

https://reviews.llvm.org/D90397



More information about the cfe-commits mailing list