You'd think a stand-alone program could take care of this quite nicely? No need to clutter the compiler itself.
To parse a C file correctly a tools needs to know the exact set of include path and defines you passed to the compiler. Then it needs to go read the whole tree of header files and preprocess everything. It needs to know where your standard header files are (different from the system header file when cross compiling). It needs to know about your compiler's built-in defines. It may also choke on any C extensions that your code (or any header file) is using.
In this particular case it may be enough to parse the file with some regexes but I wouldn't trust it; people do some crazy things with C macros.