MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / SLaddMLError

Function SLaddMLError

src/API/SLAPI.cpp:119–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void SLaddMLError(ErrorContainer* errors, const char* messageId,
120 const char* fileName1, uint32_t line1, uint32_t col1,
121 const char* objectName1, const char* fileName2,
122 uint32_t line2, uint32_t col2, const char* objectName2) {
123 if (errors == nullptr) return;
124 FileSystem* const fileSystem = FileSystem::getInstance();
125 SymbolTable* symbolTable = errors->getSymbolTable();
126 const PathId fileId1 = IsEmpty(fileName1)
127 ? BadPathId
128 : fileSystem->toPathId(fileName1, symbolTable);
129 const SymbolId objectId1 = IsEmpty(objectName1)
130 ? BadSymbolId
131 : symbolTable->registerSymbol(objectName1);
132 Location loc1(fileId1, line1, col1, objectId1);
133
134 PathId fileId2 = IsEmpty(fileName2)
135 ? BadPathId
136 : fileSystem->toPathId(fileName2, symbolTable);
137 SymbolId objectId2 = IsEmpty(objectName2)
138 ? BadSymbolId
139 : symbolTable->registerSymbol(objectName2);
140 Location loc2(fileId2, line2, col2, objectId2);
141
142 ErrorDefinition::ErrorType type = ErrorDefinition::getErrorType(messageId);
143 Error err(type, loc2, loc2);
144 errors->addError(err, false, false);
145}
146
147void SLaddErrorContext(SV3_1aPythonListener* prog,
148 antlr4::ParserRuleContext* context,

Callers

nothing calls this directly

Calls 5

IsEmptyFunction · 0.85
toPathIdMethod · 0.80
getSymbolTableMethod · 0.45
registerSymbolMethod · 0.45
addErrorMethod · 0.45

Tested by

no test coverage detected