MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / getTypeIndex

Method getTypeIndex

lib/Bytecode/Writer/BytecodeWriter.cpp:333–345  ·  view source on GitHub ↗

Gets or creates an index for a type in the type table.

Source from the content-addressed store, hash-verified

331
332 // Gets or creates an index for a type in the type table.
333 uint64_t getTypeIndex(Type type) {
334 // Use the type's memory address as a unique key for lookup
335 const void *key = type.getAsOpaquePointer();
336 auto it = typeIndexMap.find(key);
337 if (it != typeIndexMap.end())
338 return it->second;
339 // Ensure dependent/nested types are registered before the type itself
340 registerDependentTypes(type);
341 uint64_t index = typeList.size();
342 typeIndexMap[key] = index;
343 typeList.push_back(type);
344 return index;
345 }
346
347 LogicalResult writeTypeSection(raw_ostream &stream) {
348 SmallVector<char> buffer;

Callers 2

buildFunctionMapMethod · 0.80
writeGlobalSectionFunction · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected