pcc created this revision. pcc added a reviewer: tejohnson. pcc added a subscriber: cfe-commits. Herald added a subscriber: mehdi_amini.
The other output formats aren't really useful to end users. The equivalent functionality can still be accessed by developers with tools such as llvm-lto. http://reviews.llvm.org/D21825 Files: lib/Driver/Tools.cpp test/Driver/thinlto_backend.c Index: test/Driver/thinlto_backend.c =================================================================== --- test/Driver/thinlto_backend.c +++ test/Driver/thinlto_backend.c @@ -6,5 +6,9 @@ // CHECK-THINLTOBE-ACTION: -fthinlto-index= // Ensure clang driver gives the expected error for incorrect input type -// RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING -// CHECK-WARNING: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' +// RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERR1 +// CHECK-ERR1: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' + +// And for incorrect output type +// RUN: not %clang -O2 -o %t1.o -x ir %s -S -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERR2 +// CHECK-ERR2: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-c' Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -3895,6 +3895,9 @@ if (!types::isLLVMIR(Input.getType())) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-x ir"; + if (!isa<AssembleJobAction>(JA)) + D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) + << "-c"; Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); }
Index: test/Driver/thinlto_backend.c =================================================================== --- test/Driver/thinlto_backend.c +++ test/Driver/thinlto_backend.c @@ -6,5 +6,9 @@ // CHECK-THINLTOBE-ACTION: -fthinlto-index= // Ensure clang driver gives the expected error for incorrect input type -// RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-WARNING -// CHECK-WARNING: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' +// RUN: not %clang -O2 -o %t1.o %s -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERR1 +// CHECK-ERR1: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-x ir' + +// And for incorrect output type +// RUN: not %clang -O2 -o %t1.o -x ir %s -S -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERR2 +// CHECK-ERR2: error: invalid argument '-fthinlto-index={{.*}}' only allowed with '-c' Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -3895,6 +3895,9 @@ if (!types::isLLVMIR(Input.getType())) D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) << "-x ir"; + if (!isa<AssembleJobAction>(JA)) + D.Diag(diag::err_drv_argument_only_allowed_with) << A->getAsString(Args) + << "-c"; Args.AddLastArg(CmdArgs, options::OPT_fthinlto_index_EQ); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits