Expertcoderz wrote:

> I’d go with std::optional<Stmt *> if we want to do that, along w/ a comment 
> that explains the three possible states are (1. not labelled, 2. labelled, 
> but the LabelDecl doesn’t exist yet, 3. labelled and it does exist).

(commenting here since github marked the review as outdated)

That should be a good compromise between keeping the interface simple and 
preventing people from assuming that it will always return a non-null pointer. 
I've switched `getNamedLoopIOrSwitch()` over to using `const std::optional<Stmt 
*>` as its return type.

https://github.com/llvm/llvm-project/pull/228655
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to