Skip to content

Commit b1551d2

Browse files
author
Erich Keane
authored
[NFCI][SYCL] Correct -fdeclare-spirv-builtins to use marshalling (#3515)
The -fdeclare-spirv-builtins flag never got updated to use the marshalling, so it causes a problem with the round-tripping. However, the solution we used (to call 'generate-arg' for it) is unnecessary with the marshalling.
1 parent 551f528 commit b1551d2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5559,8 +5559,10 @@ def finclude_default_header : Flag<["-"], "finclude-default-header">,
55595559
HelpText<"Include default header file for OpenCL">;
55605560
def fdeclare_opencl_builtins : Flag<["-"], "fdeclare-opencl-builtins">,
55615561
HelpText<"Add OpenCL builtin function declarations (experimental)">;
5562-
def fdeclare_spirv_builtins : Flag<["-"], "fdeclare-spirv-builtins">,
5563-
HelpText<"Add SPIR-V builtin function declarations (experimental)">;
5562+
def fdeclare_spirv_builtins
5563+
: Flag<["-"], "fdeclare-spirv-builtins">,
5564+
HelpText<"Add SPIR-V builtin function declarations (experimental)">,
5565+
MarshallingInfoFlag<LangOpts<"DeclareSPIRVBuiltins">>;
55645566

55655567
def fpreserve_vec3_type : Flag<["-"], "fpreserve-vec3-type">,
55665568
HelpText<"Preserve 3-component vector type">,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,8 +3502,6 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts,
35023502
LangOptions::SignReturnAddressKeyKind::BKey)
35033503
GenerateArg(Args, OPT_msign_return_address_key_EQ, "b_key", SA);
35043504

3505-
if (Opts.DeclareSPIRVBuiltins)
3506-
GenerateArg(Args, OPT_fdeclare_spirv_builtins, SA);
35073505
}
35083506

35093507
bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
@@ -3594,8 +3592,6 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
35943592
}
35953593
}
35963594

3597-
Opts.DeclareSPIRVBuiltins = Args.hasArg(OPT_fdeclare_spirv_builtins);
3598-
35993595
// These need to be parsed now. They are used to set OpenCL defaults.
36003596
Opts.IncludeDefaultHeader = Args.hasArg(OPT_finclude_default_header);
36013597
Opts.DeclareOpenCLBuiltins = Args.hasArg(OPT_fdeclare_opencl_builtins);

0 commit comments

Comments
 (0)