Skip to content

Commit d1629e9

Browse files
committed
fbc: __FB_QUERY_SYMBOL__ extended to return mangled names
__FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.mangletype, symbol ) returns the mangled type name of symbol __FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.mangleid, symbol ) returns the mangled name of symbol
1 parent 16fea29 commit d1629e9

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Version 1.20.0
2828
- fbdoc: change CRegex.bas to use pcre2 since the libpcre (a.k.a pcre3) is obsolete in favour of pcre2 by upstream (Ahmad Khalifa)
2929
- PEEK, POKE, and SWAP are now quirk words instead of keywords allowing these names to be used as member procedure names
3030
- "\Unnnnnnnn" escape sequence is mapped as follows: when within unicode BMP, "\unnnn", otherwise on linux "\Unnnnnnnn", or on windows "\uD8XX\uDCXX" surrogate pair.
31+
- __FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.mangletype, symbol ) returns the mangled type name of symbol
3132

3233
[added]
3334
- x86_64: optimize SHL MOD INTDIV to use 32-bit operation when result will be converted to long/ulong
@@ -69,6 +70,7 @@ Version 1.20.0
6970
- github #426: add __FB_ARG_LISTEXPAND__( macroname, macroargcount, args... ): expands to one or more 'macroname( .... )' depending on the value of macroargcount and number of arguments in the args... list (skyfish)
7071
- fbc: command line option '-z optabstract' to support optimizing purely abstract types, and only preserve used pure abstract types (skyfish)
7172
- fbc: warning when "\u" or "\U" escape sequences are invalid or truncated
73+
- fbc: __FB_QUERY_SYMBOL__( fbc.FB_QUERY_SYMBOL.mangleid, symbol ) returns the mangled name of symbol
7274

7375
[fixed]
7476
- github #410: give consistent floating point comparisons results involving NaNs.

inc/fbc-int/symbol.bi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ enum FB_QUERY_SYMBOL explicit
112112
dataclass = &h0002 '' return the symbol's data class as FB_DATACLASS
113113
typename = &h0003 '' return the typename as text
114114
typenameid = &h0004 '' return the typename as text with specical characters replaced with '_'
115-
mangleid = &h0005 '' return the decorated (mangled) type name (WIP)
116-
exists = &h0006 '' return if the symbol name / identifier is exists
115+
mangletype = &h0005 '' return the decorated (mangled) type name (WIP)
116+
mangleid = &h0006 '' return the decorated (mangled) name (WIP)
117+
exists = &h0007 '' return if the symbol name / identifier is exists
117118

118119
querymask = &h00ff '' mask for query values
119120

src/compiler/symb-define.bas

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,8 +1200,9 @@ enum FB_QUERY_SYMBOL explicit
12001200
dataclass = &h0002 '' return the symbol's data class as FB_DATACLASS
12011201
typename = &h0003 '' return the typename as text
12021202
typenameid = &h0004 '' return the typename as text with specical characters replaced with '_'
1203-
mangleid = &h0005 '' return the decorated (mangled) type name (WIP)
1204-
exists = &h0006 '' return if the symbol name / identifier is exists
1203+
mangletype = &h0005 '' return the decorated (mangled) type name (WIP)
1204+
mangleid = &h0006 '' return the decorated (mangled) type name (WIP)
1205+
exists = &h0007 '' return if the symbol name / identifier is exists
12051206
querymask = &h00ff '' mask for query values
12061207

12071208
'' filters
@@ -1261,6 +1262,7 @@ private function hDefQuerySymZ_cb( byval argtb as LEXPP_ARGTB ptr, byval errnum
12611262
select case queryvalue
12621263
case FB_QUERY_SYMBOL.typename, _
12631264
FB_QUERY_SYMBOL.typenameid, _
1265+
FB_QUERY_SYMBOL.mangletype, _
12641266
FB_QUERY_SYMBOL.mangleid, _
12651267
FB_QUERY_SYMBOL.exists
12661268

@@ -1385,7 +1387,7 @@ private function hDefQuerySymZ_cb( byval argtb as LEXPP_ARGTB ptr, byval errnum
13851387
hReplaceChar( res, asc(")"), asc("_") )
13861388
hReplaceChar( res, asc("*"), asc("_") )
13871389
end if
1388-
case FB_QUERY_SYMBOL.mangleid
1390+
case FB_QUERY_SYMBOL.mangletype
13891391
if( sym ) then
13901392
symbMangleType( res, dtype, sym )
13911393
symbMangleResetAbbrev( )
@@ -1395,6 +1397,14 @@ private function hDefQuerySymZ_cb( byval argtb as LEXPP_ARGTB ptr, byval errnum
13951397
else
13961398
res = str(0)
13971399
end if
1400+
case FB_QUERY_SYMBOL.mangleid
1401+
if( sym ) then
1402+
res = *symbGetMangledName( sym )
1403+
elseif( subtype ) then
1404+
res = *symbGetMangledName( subtype )
1405+
else
1406+
res = str(0)
1407+
end if
13981408
case FB_QUERY_SYMBOL.exists
13991409
res = str( sym <> NULL )
14001410
case else

0 commit comments

Comments
 (0)