From 068f2a2552ba49335a8a1e72e1731d047335fe82 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 1 Nov 2019 10:31:01 -0400 Subject: -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 --- source/slang/slang-options.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 7429db2fc..b17e35d69 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -3,6 +3,8 @@ // Implementation of options parsing for `slangc` command line, // and also for API interface that takes command-line argument strings. +#include "slang-options.h" + #include "../../slang.h" #include "slang-compiler.h" @@ -61,6 +63,16 @@ static SlangResult _parsePassThrough(const UnownedStringSlice& name, SlangPassTh return SLANG_FAIL; } +UnownedStringSlice getPassThroughName(SlangPassThrough passThru) +{ +#define SLANG_PASS_THROUGH_TYPE_TO_NAME(x, y) \ + if (passThru == SLANG_PASS_THROUGH_##y) return UnownedStringSlice::fromLiteral(#x); + + SLANG_PASS_THROUGH_TYPES(SLANG_PASS_THROUGH_TYPE_TO_NAME) + + return UnownedStringSlice::fromLiteral("unknown"); +} + struct OptionsParser { SlangSession* session = nullptr; -- cgit v1.2.3