From 9718ab32e91ba632b03ad8d0f5e89a597b225a4c Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Fri, 21 Jul 2017 11:37:31 -0700 Subject: Add an API option to control emission of `#line` directives - API users can use this to get "clean" output to aid with debugging Slang issues - Also changes the prefix on intermediate files that Slang dumps, to make them easier to ignore with a regexp --- source/slang/compiler.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/slang/compiler.h') diff --git a/source/slang/compiler.h b/source/slang/compiler.h index a7d104b5f..09797664f 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -48,6 +48,14 @@ namespace Slang ReflectionJSON = SLANG_REFLECTION_JSON, }; + enum class LineDirectiveMode : SlangLineDirectiveMode + { + Default = SLANG_LINE_DIRECTIVE_MODE_DEFAULT, + None = SLANG_LINE_DIRECTIVE_MODE_NONE, + Standard = SLANG_LINE_DIRECTIVE_MODE_STANDARD, + GLSL = SLANG_LINE_DIRECTIVE_MODE_GLSL, + }; + enum class ResultFormat { None, @@ -210,6 +218,9 @@ namespace Slang // Should we dump intermediate results along the way, for debugging? bool shouldDumpIntermediates = false; + // How should `#line` directives be emitted (if at all)? + LineDirectiveMode lineDirectiveMode = LineDirectiveMode::Default; + // Output stuff DiagnosticSink mSink; String mDiagnosticOutput; -- cgit v1.2.3