diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-11-01 10:31:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-01 10:31:01 -0400 |
| commit | 068f2a2552ba49335a8a1e72e1731d047335fe82 (patch) | |
| tree | 98c3f8019da4bd256168d3d953878da9512d4518 /source/slang/slang-compiler.cpp | |
| parent | f59df3814a514cab01f69a24e3330d13de3f9c92 (diff) | |
-extract-repro gives approximation of 'command line' used (#1103)
* Added feature to repro manifest of approximation of command line that was used.
* Add missing slang-options.h
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 705b4ed59..92759ed0f 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -396,23 +396,23 @@ namespace Slang } } - Stage findStageByName(String const& name) + static const struct { - static const struct - { - char const* name; - Stage stage; - } kStages[] = - { - #define PROFILE_STAGE(ID, NAME, ENUM) \ + char const* name; + Stage stage; + } kStages[] = + { + #define PROFILE_STAGE(ID, NAME, ENUM) \ { #NAME, Stage::ID }, #define PROFILE_STAGE_ALIAS(ID, NAME, VAL) \ { #NAME, Stage::ID }, #include "slang-profile-defs.h" - }; + }; + Stage findStageByName(String const& name) + { for(auto entry : kStages) { if(name == entry.name) @@ -424,6 +424,18 @@ namespace Slang return Stage::Unknown; } + UnownedStringSlice getStageText(Stage stage) + { + for (auto entry : kStages) + { + if (stage == entry.stage) + { + return UnownedStringSlice(entry.name); + } + } + return UnownedStringSlice(); + } + static UnownedStringSlice _getPassThroughAsText(PassThroughMode mode) { switch (mode) |
