di-loc =: DebugTag[DILoc] diScopeIndex[varint] - DILocalScopeAttr fileNameIndex[varint] - StringAttr lineNumber[varint] - unsigned columnNumber[varint] - unsigned
| 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] |
nothing calls this directly
no test coverage detected