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

Method parseDILoc

lib/Bytecode/Reader/BytecodeReader.cpp:985–1010  ·  view source on GitHub ↗

di-loc =: DebugTag[DILoc] diScopeIndex[varint] - DILocalScopeAttr fileNameIndex[varint] - StringAttr lineNumber[varint] - unsigned columnNumber[varint] - unsigned

Source from the content-addressed store, hash-verified

983 // lineNumber[varint] - unsigned
984 // columnNumber[varint] - unsigned
985 LogicalResult parseDILoc(EncodingReader &reader, Attribute &diLoc) {
986 auto scope = readAndGetDebugInfo<DILocalScopeAttr>(reader);
987 if (!scope)
988 return reader.emitError()
989 << "failed to read scope attribute when parsing DILocAttr";
990
991 StringRef filenameStr;
992 if (failed(reader.readAndGetString(filenameStr)))
993 return reader.emitError() << "failed to read file name attribute when "
994 "parsing FileLineColLoc";
995 StringAttr filename = StringAttr::get(&context, filenameStr);
996
997 uint64_t line;
998 if (failed(reader.readVarInt(line)))
999 return reader.emitError()
1000 << "failed to read line number when parsing FileLineColLoc";
1001
1002 uint64_t column;
1003 if (failed(reader.readVarInt(column)))
1004 return reader.emitError()
1005 << "failed to read column number when parsing FileLineColLoc";
1006
1007 auto fileLineCol = FileLineColLoc::get(&context, filename, line, column);
1008 diLoc = DILocAttr::get(&context, fileLineCol, scope);
1009 return success();
1010 }
1011
1012 // di-subprogram =:
1013 // DebugTag[DISubprogram]

Callers

nothing calls this directly

Calls 3

emitErrorMethod · 0.80
readAndGetStringMethod · 0.80
readVarIntMethod · 0.80

Tested by

no test coverage detected