[Driver] Change some Separate CC1 options to use the Joined = form
-f{constexpr,macro,template}-backtrace-limit=, -fspell-checking-limit=, -ftemplate-depth=
This commit is contained in:
@@ -1507,8 +1507,9 @@ def fconstexpr_steps_EQ : Joined<["-"], "fconstexpr-steps=">, Group<f_Group>;
|
||||
def fexperimental_new_constant_interpreter : Flag<["-"], "fexperimental-new-constant-interpreter">, Group<f_Group>,
|
||||
HelpText<"Enable the experimental new constant interpreter">, Flags<[CC1Option]>,
|
||||
MarshallingInfoFlag<LangOpts<"EnableNewConstInterp">>;
|
||||
def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">,
|
||||
Group<f_Group>;
|
||||
def fconstexpr_backtrace_limit_EQ : Joined<["-"], "fconstexpr-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit)">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
|
||||
def fcrash_diagnostics_EQ : Joined<["-"], "fcrash-diagnostics=">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
|
||||
HelpText<"Set level of crash diagnostic reporting, (option: off, compiler, all)">;
|
||||
def fcrash_diagnostics : Flag<["-"], "fcrash-diagnostics">, Group<f_clang_Group>, Flags<[NoArgumentUnused, CoreOption]>,
|
||||
@@ -2289,7 +2290,9 @@ def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
|
||||
HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
|
||||
MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
|
||||
def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
|
||||
Group<f_Group>, Flags<[NoXarchOption, CoreOption]>;
|
||||
Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
|
||||
HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
|
||||
defm merge_all_constants : BoolFOption<"merge-all-constants",
|
||||
CodeGenOpts<"MergeAllConstants">, DefaultFalse,
|
||||
PosFlag<SetTrue, [CC1Option, CoreOption], "Allow">, NegFlag<SetFalse, [], "Disallow">,
|
||||
@@ -2893,7 +2896,9 @@ defm show_source_location : BoolFOption<"show-source-location",
|
||||
defm spell_checking : BoolFOption<"spell-checking",
|
||||
LangOpts<"SpellChecking">, DefaultTrue,
|
||||
NegFlag<SetFalse, [CC1Option], "Disable spell-checking">, PosFlag<SetTrue>>;
|
||||
def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>;
|
||||
def fspell_checking_limit_EQ : Joined<["-"], "fspell-checking-limit=">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit)">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
|
||||
def fsigned_bitfields : Flag<["-"], "fsigned-bitfields">, Group<f_Group>;
|
||||
defm signed_char : BoolFOption<"signed-char",
|
||||
LangOpts<"CharIsSigned">, DefaultTrue,
|
||||
@@ -2962,10 +2967,13 @@ def fsyntax_only : Flag<["-"], "fsyntax-only">,
|
||||
Flags<[NoXarchOption,CoreOption,CC1Option,FC1Option,FlangOption]>, Group<Action_Group>,
|
||||
HelpText<"Run the preprocessor, parser and semantic analysis stages">;
|
||||
def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group<f_Group>;
|
||||
def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>;
|
||||
def ftemplate_depth_ : Joined<["-"], "ftemplate-depth-">, Group<f_Group>;
|
||||
def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">,
|
||||
Group<f_Group>;
|
||||
def ftemplate_depth_EQ : Joined<["-"], "ftemplate-depth=">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Set the maximum depth of recursive template instantiation">,
|
||||
MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
|
||||
def : Joined<["-"], "ftemplate-depth-">, Group<f_Group>, Alias<ftemplate_depth_EQ>;
|
||||
def ftemplate_backtrace_limit_EQ : Joined<["-"], "ftemplate-backtrace-limit=">, Group<f_Group>, Flags<[CC1Option]>,
|
||||
HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit)">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
|
||||
def foperator_arrow_depth_EQ : Joined<["-"], "foperator-arrow-depth=">,
|
||||
Group<f_Group>;
|
||||
|
||||
@@ -5926,18 +5934,6 @@ def ftabstop : Separate<["-"], "ftabstop">, MetaVarName<"<N>">,
|
||||
def ferror_limit : Separate<["-"], "ferror-limit">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of errors to emit before stopping (0 = no limit).">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"ErrorLimit">>;
|
||||
def fmacro_backtrace_limit : Separate<["-"], "fmacro-backtrace-limit">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit).">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"MacroBacktraceLimit">, "DiagnosticOptions::DefaultMacroBacktraceLimit">;
|
||||
def ftemplate_backtrace_limit : Separate<["-"], "ftemplate-backtrace-limit">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of entries to print in a template instantiation backtrace (0 = no limit).">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"TemplateBacktraceLimit">, "DiagnosticOptions::DefaultTemplateBacktraceLimit">;
|
||||
def fconstexpr_backtrace_limit : Separate<["-"], "fconstexpr-backtrace-limit">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of entries to print in a constexpr evaluation backtrace (0 = no limit).">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"ConstexprBacktraceLimit">, "DiagnosticOptions::DefaultConstexprBacktraceLimit">;
|
||||
def fspell_checking_limit : Separate<["-"], "fspell-checking-limit">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of times to perform spell checking on unrecognized identifiers (0 = no limit).">,
|
||||
MarshallingInfoInt<DiagnosticOpts<"SpellCheckingLimit">, "DiagnosticOptions::DefaultSpellCheckingLimit">;
|
||||
def fcaret_diagnostics_max_lines :
|
||||
Separate<["-"], "fcaret-diagnostics-max-lines">, MetaVarName<"<N>">,
|
||||
HelpText<"Set the maximum number of source lines to show in a caret diagnostic">,
|
||||
@@ -6395,9 +6391,6 @@ def ftype_visibility : Joined<["-"], "ftype-visibility=">,
|
||||
def fapply_global_visibility_to_externs : Flag<["-"], "fapply-global-visibility-to-externs">,
|
||||
HelpText<"Apply global symbol visibility to external declarations without an explicit visibility">,
|
||||
MarshallingInfoFlag<LangOpts<"SetVisibilityForExternDecls">>;
|
||||
def ftemplate_depth : Separate<["-"], "ftemplate-depth">,
|
||||
HelpText<"Maximum depth of recursive template instantiation">,
|
||||
MarshallingInfoInt<LangOpts<"InstantiationDepth">, "1024">;
|
||||
def foperator_arrow_depth : Separate<["-"], "foperator-arrow-depth">,
|
||||
HelpText<"Maximum number of 'operator->'s to call for a member access">,
|
||||
MarshallingInfoInt<LangOpts<"ArrowDepth">, "256">;
|
||||
|
||||
@@ -5969,11 +5969,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
|
||||
addDebugPrefixMapArg(D, TC, Args, CmdArgs);
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_ftemplate_depth_,
|
||||
options::OPT_ftemplate_depth_EQ)) {
|
||||
CmdArgs.push_back("-ftemplate-depth");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
Args.AddLastArg(CmdArgs, options::OPT_ftemplate_depth_EQ);
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_foperator_arrow_depth_EQ)) {
|
||||
CmdArgs.push_back("-foperator-arrow-depth");
|
||||
@@ -6054,25 +6050,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
else
|
||||
CmdArgs.push_back("19");
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_fmacro_backtrace_limit_EQ)) {
|
||||
CmdArgs.push_back("-fmacro-backtrace-limit");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_ftemplate_backtrace_limit_EQ)) {
|
||||
CmdArgs.push_back("-ftemplate-backtrace-limit");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_fconstexpr_backtrace_limit_EQ)) {
|
||||
CmdArgs.push_back("-fconstexpr-backtrace-limit");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
|
||||
if (Arg *A = Args.getLastArg(options::OPT_fspell_checking_limit_EQ)) {
|
||||
CmdArgs.push_back("-fspell-checking-limit");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
}
|
||||
Args.AddLastArg(CmdArgs, options::OPT_fconstexpr_backtrace_limit_EQ);
|
||||
Args.AddLastArg(CmdArgs, options::OPT_fmacro_backtrace_limit_EQ);
|
||||
Args.AddLastArg(CmdArgs, options::OPT_ftemplate_backtrace_limit_EQ);
|
||||
Args.AddLastArg(CmdArgs, options::OPT_fspell_checking_limit_EQ);
|
||||
|
||||
// Pass -fmessage-length=.
|
||||
unsigned MessageLength = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
void f(int *ip, float *fp) {
|
||||
if (M12(ip, fp)) { }
|
||||
// RUN: %clang_cc1 -fsyntax-only -fmacro-backtrace-limit 5 %s 2>&1 \
|
||||
// RUN: %clang_cc1 -fsyntax-only -fmacro-backtrace-limit=5 %s 2>&1 \
|
||||
// RUN: | FileCheck %s -check-prefix=CHECK-LIMIT
|
||||
// CHECK-LIMIT: macro-backtrace.c:18:7: warning: comparison of distinct pointer types ('int *' and 'float *')
|
||||
// CHECK-LIMIT: if (M12(ip, fp)) { }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: not %clang_cc1 -fsyntax-only -fmacro-backtrace-limit 0 %s 2>&1 | FileCheck %s --check-prefix=ALL
|
||||
// RUN: not %clang_cc1 -fsyntax-only -fmacro-backtrace-limit 2 %s 2>&1 | FileCheck %s --check-prefix=SKIP
|
||||
// RUN: not %clang_cc1 -fsyntax-only -fmacro-backtrace-limit=0 %s 2>&1 | FileCheck %s --check-prefix=ALL
|
||||
// RUN: not %clang_cc1 -fsyntax-only -fmacro-backtrace-limit=2 %s 2>&1 | FileCheck %s --check-prefix=SKIP
|
||||
|
||||
#define F(x) x + 1
|
||||
#define G(x) F(x) + 2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 0 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST1
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit=0 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST1
|
||||
// TEST1: constant expression
|
||||
// TEST1-NEXT: exceeded maximum depth of 4
|
||||
// TEST1-NEXT: in call to 'recurse(2)'
|
||||
@@ -6,21 +6,21 @@
|
||||
// TEST1-NEXT: in call to 'recurse(4)'
|
||||
// TEST1-NEXT: in call to 'recurse(5)'
|
||||
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST2
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit=2 -fconstexpr-depth 4 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST2
|
||||
// TEST2: constant expression
|
||||
// TEST2-NEXT: exceeded maximum depth of 4
|
||||
// TEST2-NEXT: in call to 'recurse(2)'
|
||||
// TEST2-NEXT: skipping 2 calls
|
||||
// TEST2-NEXT: in call to 'recurse(5)'
|
||||
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 2 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST3
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit=2 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST3
|
||||
// TEST3: constant expression
|
||||
// TEST3-NEXT: reinterpret_cast
|
||||
// TEST3-NEXT: in call to 'recurse(0)'
|
||||
// TEST3-NEXT: skipping 4 calls
|
||||
// TEST3-NEXT: in call to 'recurse(5)'
|
||||
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit 8 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST4
|
||||
// RUN: not %clang_cc1 -std=c++11 -fsyntax-only %s -fconstexpr-backtrace-limit=8 -fconstexpr-depth 8 -fno-caret-diagnostics 2>&1 | FileCheck %s -check-prefix=TEST4
|
||||
// TEST4: constant expression
|
||||
// TEST4-NEXT: reinterpret_cast
|
||||
// TEST4-NEXT: in call to 'recurse(0)'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// RUN: %clang_cc1 -fspell-checking-limit 0 -verify -Wno-c++11-extensions -fcxx-exceptions %s
|
||||
// RUN: %clang_cc1 -fspell-checking-limit 0 -verify -Wno-c++11-extensions -fcxx-exceptions -std=c++20 %s
|
||||
// RUN: %clang_cc1 -fspell-checking-limit=0 -verify -Wno-c++11-extensions -fcxx-exceptions %s
|
||||
// RUN: %clang_cc1 -fspell-checking-limit=0 -verify -Wno-c++11-extensions -fcxx-exceptions -std=c++20 %s
|
||||
|
||||
namespace PR21817{
|
||||
int a(-rsing[2]); // expected-error {{undeclared identifier 'rsing'; did you mean 'using'?}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -triple %itanium_abi_triple -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -triple %itanium_abi_triple -std=c++11 -ftemplate-depth=16 -fcxx-exceptions -fexceptions %s
|
||||
|
||||
// DR1330: an exception specification for a function template is only
|
||||
// instantiated when it is needed.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 128 -ftemplate-backtrace-limit 4 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth=128 -ftemplate-backtrace-limit=4 %s
|
||||
|
||||
template<int N> struct S {
|
||||
typedef typename S<N-1>::type type;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-backtrace-limit 2 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-backtrace-limit=2 %s
|
||||
//
|
||||
// FIXME: Disable this test when Clang was built with ASan, because ASan
|
||||
// increases our per-frame stack usage enough that this test no longer fits
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -ftemplate-depth=16 -fcxx-exceptions -fexceptions %s
|
||||
|
||||
template<int N> struct X {
|
||||
static int go(int a) noexcept(noexcept(X<N+1>::go(a))); // \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -verify %s -ftemplate-depth 2
|
||||
// RUN: %clang_cc1 -verify %s -ftemplate-depth=2
|
||||
|
||||
template<int N> struct S { };
|
||||
template<typename T> S<T() + T()> operator+(T, T); // expected-error {{instantiation exceeded maximum depth}} expected-note 2{{while substituting}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -std=c++11 -verify %s -ftemplate-depth 2
|
||||
// RUN: %clang_cc1 -std=c++11 -verify %s -ftemplate-depth=2
|
||||
|
||||
// PR9793
|
||||
template<typename T> auto f(T t) -> decltype(f(t)); // \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 5 -ftemplate-backtrace-limit 4 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 %s
|
||||
// RUN: %clang -fsyntax-only -Xclang -verify -ftemplate-depth-5 -ftemplate-backtrace-limit=4 %s
|
||||
// RUN: %clang -fsyntax-only -Xclang -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 %s
|
||||
|
||||
@@ -16,7 +16,7 @@ void test() {
|
||||
|
||||
#else
|
||||
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth 5 -ftemplate-backtrace-limit 4 -std=c++11 -DNOEXCEPT %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -ftemplate-depth=5 -ftemplate-backtrace-limit=4 -std=c++11 -DNOEXCEPT %s
|
||||
|
||||
template<typename T> struct S {
|
||||
S() noexcept(noexcept(S<S>())); \
|
||||
|
||||
Reference in New Issue
Block a user