From b81ff3ef968d1cc4e954b31a1812b3c391d17b02 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 31 May 2019 13:17:34 -0400 Subject: WIP: Support for other source target language (#971) * WIP: Setting up C/Cpp source compilation targets. * WIP: Emitting C/CPP. * WIP: Split out SourceSink, and use it for source output on emit. * SourceSink -> SourceStream * * Made SourceStream use m_ prefixing of members. * Make all methods use lower camel * Removed methods from SourceStream interface that are not used externally (use _ prefixing) * Improvements to documentation * EmitContext is now effectively empty, so just use SharedEmitContext as EmitContext. * SharedEmitContext -> EmitContext * Methods to LowerCamel in emit.cpp * Split out EmitContext and ExtensionUsageTracker into separate files. * Split out EmitVisitor into slang-c-like-source-emitter files. * EmitVisitor -> CLikeSourceEmitter * Tidy up around CLikeSourceEmitter - simplify header. * Small tidy up - removing repeated comments that are in header. * Remove EmitContext paramter threading. * Small tidy up. Use prefixed macros for slang-c-like-source-emitter.h * Small tidy up in slang-c-like-source-emitter.cpp * First pass at splitting out UnmangleContext. * MangledNameParser -> MangledLexer. * WIP making EmitOp (EOp) enum available outside of cpp * Generating EmitOpInfo from macro. * Split out emit precedence handling. Don't use kOp_ style anymore, just use an array indexed by EmitOp. * Disable C simple test for now. * Keep g++/clang happy with token pasting. * Fix win32 narrowing warning. --- tools/slang-test/slang-test-main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index ff449f64e..b7de3082f 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -516,8 +516,11 @@ static BackendFlags _getBackendFlagsForTarget(SlangCompileTarget target) switch (target) { case SLANG_TARGET_UNKNOWN: + case SLANG_HLSL: case SLANG_GLSL: + case SLANG_C_SOURCE: + case SLANG_CPP_SOURCE: { return 0; } @@ -570,6 +573,8 @@ static SlangCompileTarget _getCompileTarget(const UnownedStringSlice& name) CASE("dxil", DXIL) CASE("dxil-assembly", DXIL_ASM) CASE("dxil-asm", DXIL_ASM) + CASE("c", C_SOURCE) + CASE("cpp", CPP_SOURCE) #undef CASE return SLANG_TARGET_UNKNOWN; -- cgit v1.2.3