[ccache] [PATCH] Add support for the -x GCC switch
startaq at gmail.com
Mon Apr 19 02:11:56 MDT 2010
> I see that you reuse the extensions array to find out the language, but that
> will only handle the c and c++ cases. It would be nice to handle
> c-cpp-output and c++-cpp-output as well.
I haven't really looked into that yet, as the project I added support
for doesn't require it. Is there any special handling required for
those or can we handle this with an entry in the extension table?
> Another minor problem is that
> ccache will accept things like "-x cc", while gcc will not. Also, it seems
> that GCC accepts both "-x language" and "-xlanguage" forms; we should handle
> this as well.
I agree, this should be fixed.
> I think it would be better to have a separate array to map language to
> source code extension:
> c -> c
> c-cpp-output -> i
> c++ -> c++
> c++-cpp-output -> ii
> otherwise -> stats_update(STATS_UNSUPPORTED); failed();
> And then we can use the extensions array to find out i_extension.
This would certainly be a cleaner solution yes.
I'll prepare an updated patch that takes care about some of those issues.
More information about the ccache