From 6db02dc4311b3ee52ec6e7e5e5cafb2600e7b30f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 4 Jul 2025 16:20:53 -0500 Subject: [Clang] Introduce `--offload-targets` for `-fopenmp-targets` (#146594) Summary: This patch is mostly an NFC that renames the existing `-fopenmp-targets` into `--offload-targets`. Doing this early to simplify a follow-up patch that will hopefully allow this syntax to be used more generically over the existing `--offload` syntax (which I think is mostly unmaintained now.). Following in the well-trodden path of trying to pull language specific offload options into generic ones, but right now this is still just OpenMP specific. --- clang/lib/Frontend/CompilerInvocation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9b3200b..6633e4a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3891,7 +3891,7 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts, llvm::interleave( Opts.OMPTargetTriples, OS, [&OS](const llvm::Triple &T) { OS << T.str(); }, ","); - GenerateArg(Consumer, OPT_fopenmp_targets_EQ, Targets); + GenerateArg(Consumer, OPT_offload_targets_EQ, Targets); } if (!Opts.OMPHostIRFile.empty()) @@ -4322,7 +4322,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Opts.OpenMPIRBuilder = Opts.OpenMP && Args.hasArg(options::OPT_fopenmp_enable_irbuilder); bool IsTargetSpecified = - Opts.OpenMPIsTargetDevice || Args.hasArg(options::OPT_fopenmp_targets_EQ); + Opts.OpenMPIsTargetDevice || Args.hasArg(options::OPT_offload_targets_EQ); if (Opts.OpenMP || Opts.OpenMPSimd) { if (int Version = getLastArgIntValue( @@ -4382,7 +4382,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, } // Get the OpenMP target triples if any. - if (Arg *A = Args.getLastArg(options::OPT_fopenmp_targets_EQ)) { + if (Arg *A = Args.getLastArg(options::OPT_offload_targets_EQ)) { enum ArchPtrSize { Arch16Bit, Arch32Bit, Arch64Bit }; auto getArchPtrSize = [](const llvm::Triple &T) { if (T.isArch16Bit()) -- cgit v1.1