From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- source/slang/slang-options.cpp | 1887 ++++++++++++++++++++++++++-------------- 1 file changed, 1215 insertions(+), 672 deletions(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 72281cf05..969ce4143 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -5,44 +5,36 @@ #include "slang-options.h" -#include "slang.h" - -#include "slang-compiler.h" -#include "slang-profile.h" - #include "../compiler-core/slang-artifact-desc-util.h" - #include "../compiler-core/slang-artifact-impl.h" #include "../compiler-core/slang-artifact-representation-impl.h" - -#include "../compiler-core/slang-name-convention-util.h" - -#include "slang-repro.h" -#include "slang-serialize-ir.h" -#include "slang-hlsl-to-vulkan-layout-options.h" - -#include "../core/slang-castable.h" -#include "../core/slang-file-system.h" -#include "../core/slang-type-text-util.h" -#include "../core/slang-hex-dump-util.h" - #include "../compiler-core/slang-command-line-args.h" -#include "../compiler-core/slang-artifact-desc-util.h" #include "../compiler-core/slang-core-diagnostics.h" +#include "../compiler-core/slang-name-convention-util.h" #include "../compiler-core/slang-source-embed-util.h" - -#include "../core/slang-string-slice-pool.h" +#include "../core/slang-castable.h" #include "../core/slang-char-util.h" - -#include "../core/slang-name-value.h" #include "../core/slang-command-options-writer.h" +#include "../core/slang-file-system.h" +#include "../core/slang-hex-dump-util.h" +#include "../core/slang-name-value.h" +#include "../core/slang-string-slice-pool.h" +#include "../core/slang-type-text-util.h" #include "slang-compiler-options.h" +#include "slang-compiler.h" +#include "slang-hlsl-to-vulkan-layout-options.h" +#include "slang-profile.h" +#include "slang-repro.h" +#include "slang-serialize-ir.h" +#include "slang.h" #include -namespace Slang { +namespace Slang +{ -namespace { // anonymous +namespace +{ // anonymous // All of the options are given an unique enum typedef CompilerOptionName OptionKind; @@ -67,7 +59,7 @@ enum class ValueCategory DebugInfoFormat, HelpStyle, OptimizationLevel, - DebugLevel, + DebugLevel, FileSystemType, VulkanShift, SourceEmbedStyle, @@ -75,10 +67,18 @@ enum class ValueCategory CountOf, }; -template +template struct GetValueCategory; -#define SLANG_GET_VALUE_CATEGORY(cat, type) template <> struct GetValueCategory { enum { Value = Index(ValueCategory::cat) }; }; +#define SLANG_GET_VALUE_CATEGORY(cat, type) \ + template<> \ + struct GetValueCategory \ + { \ + enum \ + { \ + Value = Index(ValueCategory::cat) \ + }; \ + }; SLANG_GET_VALUE_CATEGORY(Compiler, SlangPassThrough) SLANG_GET_VALUE_CATEGORY(ArchiveType, SlangArchiveType) @@ -91,13 +91,14 @@ SLANG_GET_VALUE_CATEGORY(VulkanShift, HLSLToVulkanLayoutOptions::Kind) SLANG_GET_VALUE_CATEGORY(SourceEmbedStyle, SourceEmbedUtil::Style) SLANG_GET_VALUE_CATEGORY(Language, SourceLanguage) -} // anonymous +} // namespace static void _addOptions(const ConstArrayView