MCPcopy Create free account
hub / github.com/llir/llvm / addComdatDefsToModule

Method addComdatDefsToModule

asm/translate.go:212–229  ·  view source on GitHub ↗

addComdatDefsToModule adds IR comdat definitions to the IR module in natural sorting order.

()

Source from the content-addressed store, hash-verified

210// addComdatDefsToModule adds IR comdat definitions to the IR module in natural
211// sorting order.
212func (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

Callers 1

addDefsToModuleMethod · 0.95

Calls 2

StringsFunction · 0.92
ComdatNameFunction · 0.92

Tested by

no test coverage detected