addComdatDefsToModule adds IR comdat definitions to the IR module in natural sorting order.
()
| 210 | // addComdatDefsToModule adds IR comdat definitions to the IR module in natural |
| 211 | // sorting order. |
| 212 | func (gen *generator) addComdatDefsToModule() { |
| 213 | // 8b. Add IR comdat definitions to the IR module in natural sorting order. |
| 214 | comdatNames := make([]string, 0, len(gen.old.comdatDefs)) |
| 215 | for name := range gen.old.comdatDefs { |
| 216 | comdatNames = append(comdatNames, name) |
| 217 | } |
| 218 | natsort.Strings(comdatNames) |
| 219 | if len(comdatNames) > 0 { |
| 220 | gen.m.ComdatDefs = make([]*ir.ComdatDef, len(comdatNames)) |
| 221 | for i, name := range comdatNames { |
| 222 | def, ok := gen.new.comdatDefs[name] |
| 223 | if !ok { |
| 224 | panic(fmt.Errorf("unable to locate comdat name %q", enc.ComdatName(name))) |
| 225 | } |
| 226 | gen.m.ComdatDefs[i] = def |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | // addGlobalEntitiesToModule adds IR global variable declarations and |
| 232 | // definitions, indirect symbol definitions, and function declarations and |
no test coverage detected