| 1902 | } |
| 1903 | |
| 1904 | void SymbolScanner::addForwardDeclaration(DataType *dataType) |
| 1905 | { |
| 1906 | if (Symbol *symbol = m_globals->getSymbol(dataType->getName())) |
| 1907 | { |
| 1908 | throw semantic_error(format_string("line %d: Declaring type '%s' already declared here '%d'", |
| 1909 | dataType->getFirstLine(), dataType->getName().c_str(), |
| 1910 | symbol->getFirstLine())); |
| 1911 | } |
| 1912 | |
| 1913 | auto findDataTypeIT = m_forwardDeclarations.find(dataType->getName()); |
| 1914 | if (findDataTypeIT != m_forwardDeclarations.end()) |
| 1915 | { |
| 1916 | if (findDataTypeIT->second->getDataType() != dataType->getDataType()) |
| 1917 | { |
| 1918 | throw semantic_error(format_string("line %d: Declaring type '%s' already declared here '%d'", |
| 1919 | dataType->getFirstLine(), dataType->getName().c_str(), |
| 1920 | findDataTypeIT->second->getFirstLine())); |
| 1921 | } |
| 1922 | else |
| 1923 | { |
| 1924 | return; |
| 1925 | } |
| 1926 | } |
| 1927 | m_forwardDeclarations[dataType->getName()] = dataType; |
| 1928 | } |
| 1929 | |
| 1930 | void SymbolScanner::removeForwardDeclaration(DataType *dataType) |
| 1931 | { |
nothing calls this directly
no test coverage detected