Index: cfe/trunk/include/clang/Driver/CC1Options.td =================================================================== --- cfe/trunk/include/clang/Driver/CC1Options.td +++ cfe/trunk/include/clang/Driver/CC1Options.td @@ -275,8 +275,6 @@ HelpText<"Try to use a split stack if possible.">; def mno_zero_initialized_in_bss : Flag<["-"], "mno-zero-initialized-in-bss">, HelpText<"Do not put zero initialized data in the BSS">; -def backend_option : Separate<["-"], "backend-option">, - HelpText<"Additional arguments to forward to LLVM backend (during code gen)">; def mregparm : Separate<["-"], "mregparm">, HelpText<"Limit the number of registers available for integer arguments">; def munwind_tables : Flag<["-"], "munwind-tables">, Index: cfe/trunk/include/clang/Frontend/CodeGenOptions.h =================================================================== --- cfe/trunk/include/clang/Frontend/CodeGenOptions.h +++ cfe/trunk/include/clang/Frontend/CodeGenOptions.h @@ -177,9 +177,6 @@ /// function instead of to trap instructions. std::string TrapFuncName; - /// A list of command-line options to forward to the LLVM backend. - std::vector BackendOptions; - /// A list of dependent libraries. std::vector DependentLibraries; Index: cfe/trunk/lib/CodeGen/BackendUtil.cpp =================================================================== --- cfe/trunk/lib/CodeGen/BackendUtil.cpp +++ cfe/trunk/lib/CodeGen/BackendUtil.cpp @@ -658,8 +658,6 @@ BackendArgs.push_back("-limit-float-precision"); BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str()); } - for (const std::string &BackendOption : CodeGenOpts.BackendOptions) - BackendArgs.push_back(BackendOption.c_str()); BackendArgs.push_back(nullptr); llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1, BackendArgs.data()); Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp =================================================================== --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp @@ -1350,7 +1350,7 @@ // Forward the -mglobal-merge option for explicit control over the pass. if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, options::OPT_mno_global_merge)) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-arm-global-merge=false"); else @@ -1464,21 +1464,21 @@ if (Arg *A = Args.getLastArg(options::OPT_mfix_cortex_a53_835769, options::OPT_mno_fix_cortex_a53_835769)) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mfix_cortex_a53_835769)) CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1"); else CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=0"); } else if (Triple.isAndroid()) { // Enabled A53 errata (835769) workaround by default on android - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1"); } // Forward the -mglobal-merge option for explicit control over the pass. if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge, options::OPT_mno_global_merge)) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-aarch64-enable-global-merge=false"); else @@ -3048,13 +3048,13 @@ // Always enabled for SCE tuning. if (Args.hasArg(options::OPT_gdwarf_aranges) || DebuggerTuning == llvm::DebuggerKind::SCE) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-generate-arange-section"); } if (Args.hasFlag(options::OPT_fdebug_types_section, options::OPT_fno_debug_types_section, false)) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-generate-type-units"); } @@ -4073,17 +4073,17 @@ if (Arg *A = Args.getLastArg(options::OPT_mrestrict_it, options::OPT_mno_restrict_it)) { if (A->getOption().matches(options::OPT_mrestrict_it)) { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-restrict-it"); } else { - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-no-restrict-it"); } } else if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm || Triple.getArch() == llvm::Triple::thumb)) { // Windows on ARM expects restricted IT blocks - CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-mllvm"); CmdArgs.push_back("-arm-restrict-it"); } Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp =================================================================== --- cfe/trunk/lib/Frontend/CompilerInvocation.cpp +++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp @@ -677,7 +677,6 @@ Opts.ReciprocalMath = Args.hasArg(OPT_freciprocal_math); Opts.NoTrappingMath = Args.hasArg(OPT_fno_trapping_math); Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss); - Opts.BackendOptions = Args.getAllArgValues(OPT_backend_option); Opts.NumRegisterParameters = getLastArgIntValue(Args, OPT_mregparm, 0, Diags); Opts.NoExecStack = Args.hasArg(OPT_mno_exec_stack); Opts.FatalWarnings = Args.hasArg(OPT_massembler_fatal_warnings); Index: cfe/trunk/test/CodeGen/thinlto-backend-option.ll =================================================================== --- cfe/trunk/test/CodeGen/thinlto-backend-option.ll +++ cfe/trunk/test/CodeGen/thinlto-backend-option.ll @@ -1,4 +1,4 @@ -; Test to ensure -backend-options work when invoking the ThinLTO backend path. +; Test to ensure -mllvm work when invoking the ThinLTO backend path. ; This test uses a non-existent backend option to test that backend options are ; being parsed. While it's more important that the existing options are parsed @@ -8,8 +8,8 @@ ; RUN: %clang -flto=thin -c -o %t.o %s ; RUN: llvm-lto -thinlto -o %t %t.o -; RUN: not %clang_cc1 -x ir %t.o -fthinlto-index=%t.thinlto.bc -backend-option -nonexistent -emit-obj -o /dev/null 2>&1 | FileCheck %s -check-prefix=UNKNOWN -; UNKNOWN: clang: Unknown command line argument '-nonexistent' +; RUN: not %clang_cc1 -x ir %t.o -fthinlto-index=%t.thinlto.bc -mllvm -nonexistent -emit-obj -o /dev/null 2>&1 | FileCheck %s -check-prefix=UNKNOWN +; UNKNOWN: clang (LLVM option parsing): Unknown command line argument '-nonexistent' ; RUN: not %clang_cc1 -flto=thinfoo 2>&1 | FileCheck %s -check-prefix=INVALID ; INVALID: error: invalid value 'thinfoo' in '-flto=thinfoo' Index: cfe/trunk/test/CodeGenCUDA/link-device-bitcode.cu =================================================================== --- cfe/trunk/test/CodeGenCUDA/link-device-bitcode.cu +++ cfe/trunk/test/CodeGenCUDA/link-device-bitcode.cu @@ -31,7 +31,7 @@ // Make sure NVVMReflect pass is enabled in NVPTX back-end. // RUN: %clang_cc1 -triple nvptx-unknown-cuda -fcuda-is-device \ // RUN: -mlink-cuda-bitcode %t.bc -S -o /dev/null %s \ -// RUN: -backend-option -debug-pass=Structure 2>&1 \ +// RUN: -mllvm -debug-pass=Structure 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-REFLECT #include "Inputs/cuda.h" Index: cfe/trunk/test/Driver/aarch64-fix-cortex-a53-835769.c =================================================================== --- cfe/trunk/test/Driver/aarch64-fix-cortex-a53-835769.c +++ cfe/trunk/test/Driver/aarch64-fix-cortex-a53-835769.c @@ -8,6 +8,6 @@ // RUN: %clang -target aarch64-android-eabi %s -### 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-YES %s -// CHECK-DEF-NOT: "-backend-option" "-aarch64-fix-cortex-a53-835769" -// CHECK-YES: "-backend-option" "-aarch64-fix-cortex-a53-835769=1" -// CHECK-NO: "-backend-option" "-aarch64-fix-cortex-a53-835769=0" +// CHECK-DEF-NOT: "-mllvm" "-aarch64-fix-cortex-a53-835769" +// CHECK-YES: "-mllvm" "-aarch64-fix-cortex-a53-835769=1" +// CHECK-NO: "-mllvm" "-aarch64-fix-cortex-a53-835769=0" Index: cfe/trunk/test/Driver/apple-kext-mkernel.c =================================================================== --- cfe/trunk/test/Driver/apple-kext-mkernel.c +++ cfe/trunk/test/Driver/apple-kext-mkernel.c @@ -26,7 +26,3 @@ // RUN: %clang -target x86_64-apple-darwin10 \ // RUN: -Werror -fno-builtin -fno-exceptions -fno-common -fno-rtti \ // RUN: -mkernel -fsyntax-only %s - -// RUN: %clang -c %s -target armv7k-apple-watchos -fapple-kext -mwatchos-version-min=1.0.0 -### 2>&1 \ -// RUN: | FileCheck %s --check-prefix=CHECK-WATCH -// CHECK-WATCH-NOT: "-backend-option" "-arm-long-calls" Index: cfe/trunk/test/Driver/arm-restrict-it.c =================================================================== --- cfe/trunk/test/Driver/arm-restrict-it.c +++ cfe/trunk/test/Driver/arm-restrict-it.c @@ -4,7 +4,7 @@ // RUN: %clang -target armv8a-none-gnueabi -mrestrict-it -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-RESTRICTED < %t %s -// CHECK-RESTRICTED: "-backend-option" "-arm-restrict-it" +// CHECK-RESTRICTED: "-mllvm" "-arm-restrict-it" // RUN: %clang -target arm-none-gnueabi -mno-restrict-it -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s @@ -12,4 +12,4 @@ // RUN: %clang -target armv8a-none-gnueabi -mno-restrict-it -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-NO-RESTRICTED < %t %s -// CHECK-NO-RESTRICTED: "-backend-option" "-arm-no-restrict-it" +// CHECK-NO-RESTRICTED: "-mllvm" "-arm-no-restrict-it" Index: cfe/trunk/test/Driver/debug-options.c =================================================================== --- cfe/trunk/test/Driver/debug-options.c +++ cfe/trunk/test/Driver/debug-options.c @@ -225,9 +225,9 @@ // // GARANGE: -generate-arange-section // -// FDTS: "-backend-option" "-generate-type-units" +// FDTS: "-mllvm" "-generate-type-units" // -// NOFDTS-NOT: "-backend-option" "-generate-type-units" +// NOFDTS-NOT: "-mllvm" "-generate-type-units" // // CI: "-dwarf-column-info" // Index: cfe/trunk/test/Driver/mglobal-merge.c =================================================================== --- cfe/trunk/test/Driver/mglobal-merge.c +++ cfe/trunk/test/Driver/mglobal-merge.c @@ -10,8 +10,8 @@ // RUN: -mno-global-merge // RUN: FileCheck --check-prefix=CHECK-NONE < %t %s -// CHECK-NGM-ARM: "-backend-option" "-arm-global-merge=false" -// CHECK-NGM-AARCH64: "-backend-option" "-aarch64-enable-global-merge=false" +// CHECK-NGM-ARM: "-mllvm" "-arm-global-merge=false" +// CHECK-NGM-AARCH64: "-mllvm" "-aarch64-enable-global-merge=false" // RUN: %clang -target armv7-unknown-unknown -### -fsyntax-only %s 2> %t \ // RUN: -mglobal-merge @@ -25,8 +25,8 @@ // RUN: -mglobal-merge // RUN: FileCheck --check-prefix=CHECK-NONE < %t %s -// CHECK-GM-ARM: "-backend-option" "-arm-global-merge=true" -// CHECK-GM-AARCH64: "-backend-option" "-aarch64-enable-global-merge=true" +// CHECK-GM-ARM: "-mllvm" "-arm-global-merge=true" +// CHECK-GM-AARCH64: "-mllvm" "-aarch64-enable-global-merge=true" // RUN: %clang -target armv7-unknown-unknown -### -fsyntax-only %s 2> %t // RUN: FileCheck --check-prefix=CHECK-NONE < %t %s Index: cfe/trunk/test/Driver/woa-restrict-it.c =================================================================== --- cfe/trunk/test/Driver/woa-restrict-it.c +++ cfe/trunk/test/Driver/woa-restrict-it.c @@ -1,4 +1,4 @@ // RUN: %clang -target armv7-windows -### %s 2>&1 | FileCheck %s -// CHECK: "-backend-option" "-arm-restrict-it" +// CHECK: "-mllvm" "-arm-restrict-it" Index: cfe/trunk/test/Frontend/backend-option.c =================================================================== --- cfe/trunk/test/Frontend/backend-option.c +++ cfe/trunk/test/Frontend/backend-option.c @@ -1,4 +0,0 @@ -// RUN: %clang_cc1 %s -emit-llvm -backend-option -time-passes -o - 2>&1 | FileCheck %s -// RUN: %clang_cc1 %s -emit-llvm -backend-option -time-passes -o - -triple spir-unknown-unknown 2>&1 | FileCheck %s -// CHECK: Pass execution timing report -