From b8702dfb6d0e41515fa0f9f899d86b7935dfc3fd Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 25 Aug 2020 21:55:05 -0700 Subject: Export witness table and RTTI objects in compiled libraries. (#1514) * Export witness table objects in compiled code. - Ensure that witness tables are preceeded with `extern "C"` modifier in the generated C++ code. - RTTI objects use the mangled name of the type directly, so that can be queried using the type's mangled name directly from the resulting DLL. - Expose `Linkage::getTypeConformanceWitnessMangledName` to return the mangled name of witness tables to the host. - Ensure that all witness tables (including those for associated types) have proper mangled name. * Fix GCC error in Slang generated code. --- source/slang/slang-ir-generics-lowering-context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/slang-ir-generics-lowering-context.cpp') diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp index 67f376153..317532e8c 100644 --- a/source/slang/slang-ir-generics-lowering-context.cpp +++ b/source/slang/slang-ir-generics-lowering-context.cpp @@ -72,7 +72,7 @@ namespace Slang // Give a name to the rtti object. if (auto exportDecoration = typeInst->findDecoration()) { - String rttiObjName = String(exportDecoration->getMangledName()) + "_rtti"; + String rttiObjName = exportDecoration->getMangledName(); builder->addExportDecoration(result, rttiObjName.getUnownedSlice()); } mapTypeToRTTIObject[typeInst] = result; -- cgit v1.2.3