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

Function SLaddError

src/API/SLAPI.cpp:100–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98static bool IsEmpty(const char* str) { return !(str && *str); }
99
100void SLaddError(ErrorContainer* errors, const char* messageId,
101 const char* fileName, uint32_t line, uint32_t col,
102 const char* objectName) {
103 if (errors == nullptr) return;
104 FileSystem* const fileSystem = FileSystem::getInstance();
105 SymbolTable* symbolTable = errors->getSymbolTable();
106 const PathId fileId = IsEmpty(fileName)
107 ? BadPathId
108 : fileSystem->toPathId(fileName, symbolTable);
109 const SymbolId objectId = IsEmpty(objectName)
110 ? BadSymbolId
111 : symbolTable->registerSymbol(objectName);
112 Location loc(fileId, line, col, objectId);
113
114 ErrorDefinition::ErrorType type = ErrorDefinition::getErrorType(messageId);
115 Error err(type, loc);
116 errors->addError(err, false, false);
117}
118
119void SLaddMLError(ErrorContainer* errors, const char* messageId,
120 const char* fileName1, uint32_t line1, uint32_t col1,

Callers 6

recurseInstanceFunction · 0.85
slUserCallbackPerFileFunction · 0.85
recurseInstanceFunction · 0.85
slUserCallbackPerFileFunction · 0.85
recurseInstanceFunction · 0.85
slUserCallbackPerFileFunction · 0.85

Calls 5

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

Tested by

no test coverage detected