For internal use, I need to make changes in the Swift compiler. I am not quite familiar with it so I need help.
I want the compiler to throw a warning if no parameters are passed to a function in Swift. I know it's not a syntax error or logical error so I didn't want to include it in the parser section. I believe it would be better to have it in the Swift Intermediate Language Generation (SILGen) phase.
I was able to locate where it checks for arguments through some readings. According to my understanding, it's on the line no 443 of lib/SILGen/SILGenProlog.cpp. Now, I need to perform a check if ArgNo == 0, I need to throw a warning in the terminal.
Now, I am not sure even if that's the correct thing. I would really appreciate it if someone could help me with understanding the warning/error throwing mechanism in the Swift and capturing the argNo in a function.