| 832 | compSym->Implementations.Add(compImpl); |
| 833 | } |
| 834 | virtual RefPtr<ProgramSyntaxNode> VisitProgram(ProgramSyntaxNode * programNode) override |
| 835 | { |
| 836 | HashSet<String> funcNames; |
| 837 | this->program = programNode; |
| 838 | this->function = nullptr; |
| 839 | for (auto & s : program->Members) |
| 840 | { |
| 841 | symbolTable->globalDecls.AddIfNotExists(s->Name.Content, s.Ptr()); |
| 842 | } |
| 843 | for (auto & s : program->GetTypeDefs()) |
| 844 | VisitTypeDefDecl(s.Ptr()); |
| 845 | for (auto & s : program->GetStructs()) |
| 846 | { |
| 847 | if (!s->SemanticallyChecked) |
| 848 | { |
| 849 | VisitStruct(s.Ptr()); |
| 850 | s->SemanticallyChecked = true; |
| 851 | } |
| 852 | } |
| 853 | for (auto & func : program->GetFunctions()) |
| 854 | { |
| 855 | if (!func->SemanticallyChecked) |
| 856 | { |
| 857 | VisitFunctionDeclaration(func.Ptr()); |
| 858 | if (funcNames.Contains(func->InternalName)) |
| 859 | { |
| 860 | StringBuilder argList; |
| 861 | argList << "("; |
| 862 | bool first = true; |
| 863 | for (auto & param : func->GetParameters()) |
| 864 | { |
| 865 | if (!first) |
| 866 | argList << ", "; |
| 867 | argList << param->Type->ToString(); |
| 868 | first = false; |
| 869 | } |
| 870 | argList << ")"; |
| 871 | getSink()->diagnose(func, Diagnostics::functionRedefinitionWithArgList, func->Name, argList.ProduceString()); |
| 872 | } |
| 873 | else |
| 874 | funcNames.Add(func->InternalName); |
| 875 | } |
| 876 | } |
| 877 | for (auto & func : program->GetFunctions()) |
| 878 | { |
| 879 | if (!func->SemanticallyChecked) |
| 880 | { |
| 881 | func->Accept(this); |
| 882 | func->SemanticallyChecked = true; |
| 883 | } |
| 884 | } |
| 885 | for (auto & pipeline : program->GetPipelines()) |
| 886 | { |
| 887 | VisitPipeline(pipeline.Ptr()); |
| 888 | } |
| 889 | for (auto & interfaceNode : program->GetInterfaces()) |
| 890 | { |
| 891 | if (!interfaceNode->SemanticallyChecked) |
nothing calls this directly
no test coverage detected