carbon-lang
carbon-lang copied to clipboard
When poisoning a name, keep the triggering instruction instead of the triggering location
This discussion: https://discord.com/channels/655572317891461132/655578254970716160/1349053005609046108
Requires using AddPlaceholderInst() and ReplaceInstBeforeConstantUse() instead of AddInst() in some cases to allow using the InstId when looking up the name.
Destroy is a special case (in LookupMemberNameInScope()) because we only add it if lookup is fails finding the name.
Part of #4622.