summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2025-02-05 12:37:03 -0600
committerGitHub <noreply@github.com>2025-02-05 10:37:03 -0800
commit9ec6b91686b651d959fd9ffbec283845bd725dd6 (patch)
tree2c48202cb04b76e5ddcb274be35529378ddf8f31 /source/slang/slang-options.cpp
parent4b350645042b8e8fbdad19784ee745d11c7bc616 (diff)
Feature/initialize list side branch (#6058)
* SP004: implement initialize list translation to ctor - We synthesize a member-wise constructor for each struct follow the rules described in SP004. - Add logic to translate the initialize list to constructor invoke - Add cuda-host decoration for the synthesized constructor - Remove the default constructor when we have a valid member init constructor - Disable -zero-initialize option, will re-implement it in followup (#6109). - Fix the overload lookup issue When creating invoke expression for ctor, we need to call ResolveInvoke() to find us the best candidates, however the existing lookup logic could find us the base constructor for child struct, we should eliminate this case by providing the LookupOptions::IgnoreInheritance to lookup, this requires us to create a subcontext on SemanticsVisitor to indicate that we only want to use this option on looking the constructor. - Do not implicit initialize a struct that doesn't have explicit default constructor. Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 2b4d64cd9..87c62f7ee 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -384,13 +384,6 @@ void initCommandOptions(CommandOptions& options)
"-restrictive-capability-check",
nullptr,
"Many capability warnings will become an error."},
- {OptionKind::ZeroInitialize,
- "-zero-initialize",
- nullptr,
- "Initialize all variables to zero."
- "Structs will set all struct-fields without an init expression to 0."
- "All variables will call their default constructor if not explicitly initialized as "
- "usual."},
{OptionKind::IgnoreCapabilities,
"-ignore-capabilities",
nullptr,
@@ -914,6 +907,13 @@ void initCommandOptions(CommandOptions& options)
"-parameter-blocks-use-register-spaces",
nullptr,
"Parameter blocks will use register spaces"},
+ {OptionKind::ZeroInitialize,
+ "-zero-initialize",
+ nullptr,
+ "Initialize all variables to zero."
+ "Structs will set all struct-fields without an init expression to 0."
+ "All variables will call their default constructor if not explicitly initialized as "
+ "usual."},
};
_addOptions(makeConstArrayView(deprecatedOpts), options);
@@ -2138,7 +2138,6 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
case OptionKind::VulkanUseEntryPointName:
case OptionKind::VulkanUseGLLayout:
case OptionKind::VulkanEmitReflection:
- case OptionKind::ZeroInitialize:
case OptionKind::IgnoreCapabilities:
case OptionKind::RestrictiveCapabilityCheck:
case OptionKind::MinimumSlangOptimization: