From 4754c51f1b7225d061b03688c93ff15d4b625ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20M=20G=C3=B3mez?= Date: Mon, 24 Apr 2023 16:44:29 +0100 Subject: [PATCH] Pragma to force the exportc of a type. #21645 (#21648) exportc export all types not just those used by exported proc/globals Co-authored-by: Andreas Rumpf --- compiler/ccgtypes.nim | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 65f938ca03..1a9a5a766a 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -1612,11 +1612,20 @@ proc genTypeInfoV1(m: BModule; t: PType; info: TLineInfo): Rope = result = prefixTI.rope & result & ")".rope -proc genTypeSection(m: BModule; n: PNode) = - discard - proc genTypeInfo*(config: ConfigRef, m: BModule; t: PType; info: TLineInfo): Rope = if optTinyRtti in config.globalOptions: result = genTypeInfoV2(m, t, info) else: result = genTypeInfoV1(m, t, info) + +proc genTypeSection(m: BModule, n: PNode) = + var intSet = initIntSet() + for i in 0..