addDefsToModule adds IR top-level declarations and definitions to the IR module in order of occurrence in the input.
()
| 165 | // addDefsToModule adds IR top-level declarations and definitions to the IR |
| 166 | // module in order of occurrence in the input. |
| 167 | func (gen *generator) addDefsToModule() { |
| 168 | // 8. Add IR top-level declarations and definitions to the IR module in order |
| 169 | // of occurrence in the input. |
| 170 | // |
| 171 | // Note: the substeps of 8 can be done concurrently. |
| 172 | // |
| 173 | // 8a. Add IR type definitions to the IR module in natural sorting order. |
| 174 | gen.addTypeDefsToModule() |
| 175 | // 8b. Add IR comdat definitions to the IR module in natural sorting order. |
| 176 | gen.addComdatDefsToModule() |
| 177 | // 8c. Add IR global variable declarations and definitions, indirect symbol |
| 178 | // definitions, and function declarations and definitions to the IR |
| 179 | // module in order of occurrence in the input. |
| 180 | gen.addGlobalEntitiesToModule() |
| 181 | // 8d. Add IR attribute group definitions to the IR module in numeric order. |
| 182 | gen.addAttrGroupDefsToModule() |
| 183 | // 8e. Add IR named metadata definitions to the IR module. |
| 184 | gen.addNamedMetadataDefsToModule() |
| 185 | // 8f. Add IR metadata definitions to the IR module in numeric order. |
| 186 | gen.addMetadataDefsToModule() |
| 187 | } |
| 188 | |
| 189 | // addTypeDefsToModule adds IR type definitions to the IR module in natural |
| 190 | // sorting order. |
no test coverage detected