summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index 72ad80873..0bb1d73e5 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -177,6 +177,8 @@ Result linkAndOptimizeIR(
auto target = codeGenContext->getTargetFormat();
auto targetRequest = codeGenContext->getTargetReq();
+ // Get the artifact desc for the target
+ const auto artifactDesc = ArtifactDesc::makeFromCompileTarget(asExternal(target));
// We start out by performing "linking" at the level of the IR.
// This step will create a fresh IR module to be used for
@@ -203,12 +205,20 @@ Result linkAndOptimizeIR(
switch (target)
{
- default:
- break;
- case CodeGenTarget::HostCPPSource:
- lowerComInterfaces(irModule, sink);
- generateDllImportFuncs(irModule, sink);
- break;
+ case CodeGenTarget::CPPSource:
+ {
+ // TODO(JS):
+ // We want the interface transformation to take place for 'regular' CPPSource for now too.
+ lowerComInterfaces(irModule, artifactDesc.style, sink);
+ break;
+ }
+ case CodeGenTarget::HostCPPSource:
+ {
+ lowerComInterfaces(irModule, artifactDesc.style, sink);
+ generateDllImportFuncs(irModule, sink);
+ break;
+ }
+ default: break;
}
// Lower `Result<T,E>` types into ordinary struct types.