[PATCH] gcc compatibility: silent -finline-limit=1234 & -finline-limit

Reid Kleckner rnk at google.com
Mon Jul 7 14:30:31 PDT 2014

One alternative is to recognize the flag, but warn on it.  An easy way to do this with a poor diagnostic experience is to simply add it to our option table, don't put it into clang_ignored_f_Group, and don't check it in the driver.  Clang will emit 'warning: argument unused during compilation '-finline-limit=1234''.

For extra credit, we could have a diagnostic like "ignoring GCC optimization tuning flag" and use that for all GCC optimization flags that don't have analogues in Clang/LLVM.

Comment at: include/clang/Driver/Options.td:1561
@@ -1560,2 +1560,3 @@
 defm implicit_templates : BooleanFFlag<"implicit-templates">, Group<clang_ignored_f_Group>;
+def inline_limit_EQ : Joined<["-"], "finline-limit=">, Group<clang_ignored_f_Group>;
 defm inline_limit : BooleanFFlag<"inline-limit">, Group<clang_ignored_f_Group>;
This should be finline_limit_EQ.


More information about the cfe-commits mailing list