From 65c2e7f1ccc6cdb5daec343c7e32b4a9dc463ae4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 12 Apr 2022 15:23:53 -0700 Subject: Support `[DllImport]` (#2181) * Support `[DllImport]` * Fix. * Fix. * Fix array type emit in cpp. * Fix. * Fix. * Fix Co-authored-by: Yong He --- source/slang/slang-emit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 067d0a99a..d09217b58 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -9,6 +9,7 @@ #include "slang-ir-byte-address-legalize.h" #include "slang-ir-collect-global-uniforms.h" #include "slang-ir-dce.h" +#include "slang-ir-dll-import.h" #include "slang-ir-entry-point-uniforms.h" #include "slang-ir-entry-point-raw-ptr-params.h" #include "slang-ir-explicit-global-context.h" @@ -682,6 +683,15 @@ Result linkAndOptimizeIR( break; } + switch (target) + { + default: + break; + case CodeGenTarget::HostCPPSource: + generateDllImportFuncs(irModule, sink); + break; + } + // TODO: our current dynamic dispatch pass will remove all uses of witness tables. // If we are going to support function-pointer based, "real" modular dynamic dispatch, // we will need to disable this pass. -- cgit v1.2.3