Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -1608,6 +1608,7 @@ NegFlag>; def fencoding_EQ : Joined<["-"], "fencoding=">, Group; def ferror_limit_EQ : Joined<["-"], "ferror-limit=">, Group, Flags<[CoreOption]>; +def fcaret_diagnostics_max_lines_EQ : Joined<["-"], "fcaret-diagnostics-max-lines=">, Group, Flags<[CoreOption]>; defm exceptions : BoolFOption<"exceptions", LangOpts<"Exceptions">, DefaultFalse, PosFlag, NegFlag, Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -4109,6 +4109,12 @@ Args.addOptOutFlag(CmdArgs, options::OPT_fdiagnostics_show_line_numbers, options::OPT_fno_diagnostics_show_line_numbers); + if (const Arg *A = + Args.getLastArg(options::OPT_fcaret_diagnostics_max_lines_EQ)) { + CmdArgs.push_back("-fcaret-diagnostics-max-lines"); + CmdArgs.push_back(A->getValue()); + } + if (Args.hasArg(options::OPT_fdiagnostics_absolute_paths)) CmdArgs.push_back("-fdiagnostics-absolute-paths");