summaryrefslogtreecommitdiff
path: root/plugins/itanium
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-03-13 14:46:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-03-13 14:46:23 (GMT)
commita955b79a17f23157a02e2312b8693498c5f54b09 (patch)
treeaf87f2d94a788b639e751afdd231ddf1b5c1bcf3 /plugins/itanium
parente1bda768f573b84e340bfcdc59fe353eb665f8e6 (diff)
Added support for extra Itanium builtin types.
Diffstat (limited to 'plugins/itanium')
-rw-r--r--plugins/itanium/abi.c84
1 files changed, 82 insertions, 2 deletions
diff --git a/plugins/itanium/abi.c b/plugins/itanium/abi.c
index 0e7ce27..2a9561f 100644
--- a/plugins/itanium/abi.c
+++ b/plugins/itanium/abi.c
@@ -2200,7 +2200,9 @@ static itanium_component *itd_builtin_type(GItaniumDemangling *context)
{
itanium_component *result; /* Construction à retourner */
input_buffer *ibuf; /* Tampon de texte manipulé */
+ size_t consumed; /* Nombre de consommations */
BaseType type; /* Type reconnu ou BTP_INVALID */
+ GDataType *std; /* Espace de noms */
itanium_component *vendor; /* Extension propriétaire */
GDataType *builtin; /* Type construit */
@@ -2228,12 +2230,24 @@ static itanium_component *itd_builtin_type(GItaniumDemangling *context)
* ::= e # long double, __float80
* ::= g # __float128
* ::= z # ellipsis
- * ::= u <source-name> # vendor extended type
+ * ::= Dd # IEEE 754r decimal floating point (64 bits)
+ * ::= De # IEEE 754r decimal floating point (128 bits)
+ * ::= Df # IEEE 754r decimal floating point (32 bits)
+ * ::= Dh # IEEE 754r half-precision floating point (16 bits)
+ * ::= DF <number> _ # ISO/IEC TS 18661 binary floating point type _FloatN (N bits)
+ * ::= Di # char32_t
+ * ::= Ds # char16_t
+ * ::= Da # auto
+ * ::= Dc # decltype(auto)
+ * ::= Dn # std::nullptr_t (i.e., decltype(nullptr))
+ * ::= u <source-name> # vendor extended type
*
*/
ibuf = &G_DEMANGLING_CONTEXT(context)->buffer;
+ consumed = 1;
+
switch (peek_input_buffer_char(ibuf))
{
case 'v':
@@ -2299,6 +2313,71 @@ static itanium_component *itd_builtin_type(GItaniumDemangling *context)
case 'z':
type = BTP_ELLIPSIS;
break;
+
+ case 'D':
+
+ consumed = 2;
+
+ switch (peek_input_buffer_next_char(ibuf))
+ {
+ case 'd':
+ type = BTP_754R_64;
+ break;
+ case 'e':
+ type = BTP_754R_128;
+ break;
+ case 'f':
+ type = BTP_754R_32;
+ break;
+ case 'h':
+ type = BTP_754R_16;
+ break;
+
+ case 'F':
+ advance_input_buffer(ibuf, 2);
+
+ if (itd_number(context, (ssize_t []) { 0 }) && check_input_buffer_char(ibuf, '_'))
+ type = BTP_754R_N;
+ else
+ type = BTP_INVALID;
+
+ consumed = 0;
+ break;
+
+ case 'i':
+ type = BTP_CHAR32_T;
+ break;
+ case 's':
+ type = BTP_CHAR16_T;
+ break;
+ case 'a':
+ type = BTP_AUTO;
+ break;
+ case 'c':
+ type = BTP_DECL_AUTO;
+ break;
+
+ case 'n':
+
+ std = g_class_enum_type_new(CET_NAMESPACE, strdup("std"));
+
+ builtin = g_class_enum_type_new(CET_CLASS, strdup("nullptr_t"));
+ g_data_type_set_namespace(builtin, std, strdup("::"));
+
+ result = itd_make_type(builtin);
+ itd_set_type(result, ICT_STD_SUBST);
+
+ goto done;
+ break;
+
+ default:
+ type = BTP_INVALID;
+ break;
+
+ }
+
+ break;
+
case 'u':
advance_input_buffer(ibuf, 1);
@@ -2320,13 +2399,14 @@ static itanium_component *itd_builtin_type(GItaniumDemangling *context)
default:
type = BTP_INVALID;
break;
+
}
if (type != BTP_INVALID)
{
builtin = g_basic_type_new(type);
result = itd_make_type(builtin);
- advance_input_buffer(ibuf, 1);
+ advance_input_buffer(ibuf, consumed);
}
else
result = NULL;