From 384aa15b9bda10fe8851d97b4a799ee854d7b7ae Mon Sep 17 00:00:00 2001 From: jmgomez Date: Mon, 12 Aug 2024 10:42:34 +0100 Subject: [PATCH] Better encoding Encode types so `MyClass[T]` becomes `typedef MyClass TY_MyClass_int;` instead of `Ty_QjHlYnbKApuWy39cRg7R7dw` --- compiler/ccgtypes.nim | 9 +++---- compiler/ccgutils.nim | 60 ++++++++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 424855a7289a7..fe0df068bd50d 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -57,11 +57,11 @@ proc mangleField(m: BModule; name: PIdent): string = proc mangleProc(m: BModule; s: PSym; makeUnique: bool): string = result = "_Z" # Common prefix in Itanium ABI - result.add encodeSym(m, s, makeUnique) + result.add encodeSym(m, s, maItanium, makeUnique) if s.typ.len > 1: #we dont care about the return param for i in 1..