diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/compiler.cpp | 4 | ||||
| -rw-r--r-- | source/slang/compiler.h | 1 | ||||
| -rw-r--r-- | source/slang/emit.cpp | 5 | ||||
| -rw-r--r-- | source/slang/options.cpp | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp index f9c188764..2f6204eb2 100644 --- a/source/slang/compiler.cpp +++ b/source/slang/compiler.cpp @@ -461,6 +461,10 @@ namespace Slang } break; + case CodeGenTarget::None: + // The user requested no output + break; + // Note(tfoley): We currently hit this case when compiling the stdlib case CodeGenTarget::Unknown: break; diff --git a/source/slang/compiler.h b/source/slang/compiler.h index e106973bc..cb7eb6265 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -36,6 +36,7 @@ namespace Slang enum class CodeGenTarget { Unknown = SLANG_TARGET_UNKNOWN, + None = SLANG_TARGET_NONE, GLSL = SLANG_GLSL, GLSL_Vulkan = SLANG_GLSL_VULKAN, GLSL_Vulkan_OneDesc = SLANG_GLSL_VULKAN_ONE_DESC, diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 01b3e8cc2..155e1e39a 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -2159,6 +2159,11 @@ struct EmitVisitor void EmitStmt(RefPtr<StatementSyntaxNode> stmt) { + // TODO(tfoley): this shouldn't occur, but sometimes + // lowering will get confused by an empty function body... + if (!stmt) + return; + // Try to ensure that debugging can find the right location advanceToSourceLocation(stmt->Position); diff --git a/source/slang/options.cpp b/source/slang/options.cpp index 53c441f6b..bb292a4dc 100644 --- a/source/slang/options.cpp +++ b/source/slang/options.cpp @@ -230,6 +230,7 @@ struct OptionsParser CASE(spirv, SPIRV); CASE(spirv-assembly, SPIRV_ASM); + CASE(none, TARGET_NONE); #undef CASE |
