This revision was automatically updated to reflect the committed changes. Closed by commit rGec094d259ecf: [z/OS][pg] Throw error when using -pg on z/OS (authored by francii).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137756/new/ https://reviews.llvm.org/D137756 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/zos-profiling-error.c Index: clang/test/Driver/zos-profiling-error.c =================================================================== --- /dev/null +++ clang/test/Driver/zos-profiling-error.c @@ -0,0 +1,2 @@ +// RUN: %clang 2>&1 -### --target=s390x-none-zos -pg -S %s | FileCheck -check-prefix=FAIL-PG-NAME %s +// FAIL-PG-NAME: error: unsupported option '-pg' for target 's390x-none-zos' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -6338,6 +6338,12 @@ << A->getAsString(Args) << TripleStr; } } + if (Arg *A = Args.getLastArgNoClaim(options::OPT_pg)) { + if (TC.getTriple().isOSzOS()) { + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getAsString(Args) << TripleStr; + } + } if (Args.getLastArg(options::OPT_fapple_kext) || (Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
Index: clang/test/Driver/zos-profiling-error.c =================================================================== --- /dev/null +++ clang/test/Driver/zos-profiling-error.c @@ -0,0 +1,2 @@ +// RUN: %clang 2>&1 -### --target=s390x-none-zos -pg -S %s | FileCheck -check-prefix=FAIL-PG-NAME %s +// FAIL-PG-NAME: error: unsupported option '-pg' for target 's390x-none-zos' Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -6338,6 +6338,12 @@ << A->getAsString(Args) << TripleStr; } } + if (Arg *A = Args.getLastArgNoClaim(options::OPT_pg)) { + if (TC.getTriple().isOSzOS()) { + D.Diag(diag::err_drv_unsupported_opt_for_target) + << A->getAsString(Args) << TripleStr; + } + } if (Args.getLastArg(options::OPT_fapple_kext) || (Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits