MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / addIdentDef

Method addIdentDef

utils/vscode/src/parser/parser.go:695–706  ·  view source on GitHub ↗

addIdentDef records the token definition for the instruction inst with the given id.

(id string, inst *Instruction, def *Token)

Source from the content-addressed store, hash-verified

693// addIdentDef records the token definition for the instruction inst with the
694// given id.
695func (p *parser) addIdentDef(id string, inst *Instruction, def *Token) {
696 i, existing := p.idents[id]
697 if !existing {
698 i = &Identifier{}
699 p.idents[id] = i
700 }
701 if i.Definition == nil {
702 i.Definition = inst
703 } else {
704 p.err(def, "id '%v' redeclared", id)
705 }
706}
707
708// addIdentRef adds a identifier reference for the token ref.
709func (p *parser) addIdentRef(ref *Token) {

Callers 1

instructionMethod · 0.95

Calls 1

errMethod · 0.95

Tested by

no test coverage detected