GCC compatibility: Create a Group to ignore unsupported optimization.
Returns a warning when using an unknown optimization flag.
This patch includes -finline-limit as one of those ignored flags.
More options will be moved in this group
Patch by Arthur Marble <arthur@info9.net> in the context of
Debian Google Summer of code 2014.
Reviewers: rnk, Sylvestre
llvm-svn: 212805
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index cac20a1..3846d47 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3138,6 +3138,13 @@
}
}
+ // Warn about ignored options to clang.
+ for (arg_iterator it = Args.filtered_begin(
+ options::OPT_clang_ignored_gcc_optimization_f_Group),
+ ie = Args.filtered_end(); it != ie; ++it) {
+ D.Diag(diag::warn_ignored_gcc_optimization) << (*it)->getAsString(Args);
+ }
+
// Don't warn about unused -flto. This can happen when we're preprocessing or
// precompiling.
Args.ClaimAllArgs(options::OPT_flto);