static string
get_internal_real_type_name(const type_base*);
+static string
+get_real_type_name(const type_base* t);
+
static void
update_qualified_name(decl_base * d);
return name;
}
+static string
+get_real_type_name(const type_base* t)
+{
+ string name;
+ type_decl *type = is_real_type(t);
+
+ if (!type)
+ return name;
+
+ real_type int_type;
+ if (parse_real_type(type->get_name(), int_type))
+ name = int_type.to_string(/*internal=*/false);
+
+ return name;
+}
+
/// Get the name of a given type and return a copy of it.
///
/// @param t the type to consider.
{
const environment& env = get_environment();
-
- if (internal)
- if (is_real_type(this))
- {
- if (get_naked_canonical_type())
- {
- if (decl_base::priv_->internal_qualified_name_.empty())
- decl_base::priv_->internal_qualified_name_ =
+ if (is_real_type(this))
+ {
+ if (get_naked_canonical_type())
+ {
+ if (internal)
+ {
+ if (decl_base::priv_->internal_qualified_name_.empty())
+ decl_base::priv_->internal_qualified_name_ =
+ env.intern(get_internal_real_type_name(this));
+ return decl_base::priv_->internal_qualified_name_;
+ }
+ else
+ {
+ if (decl_base::priv_->qualified_name_.empty())
+ decl_base::priv_->qualified_name_ =
+ env.intern(get_real_type_name(this));
+ return decl_base::priv_->qualified_name_;
+ }
+ }
+ else
+ {
+ if (internal)
+ {
+ decl_base::priv_->temporary_internal_qualified_name_ =
env.intern(get_internal_real_type_name(this));
- return decl_base::priv_->internal_qualified_name_;
- }
- else
- {
- decl_base::priv_->temporary_internal_qualified_name_ =
- env.intern(get_internal_real_type_name(this));
- return decl_base::priv_->temporary_internal_qualified_name_;
- }
- }
+ return decl_base::priv_->temporary_internal_qualified_name_;
+ }
+ else
+ {
+ decl_base::priv_->temporary_qualified_name_ =
+ env.intern(get_real_type_name(this));
+ return decl_base::priv_->temporary_qualified_name_;
+ }
+ }
+ }
- return decl_base::get_qualified_name(/*internal=*/false);
+ return decl_base::get_qualified_name(internal);
}
/// Get the pretty representation of the current instance of @ref
d->priv_->qualified_name_ = abigail::interned_string();
else
{
- d->priv_->qualified_name_ =
- env.intern(d->priv_->qualified_parent_name_ + "::" + d->get_name());
- d->priv_->internal_qualified_name_ = env.intern(d->get_name());
+ if (abigail::ir::type_decl* t = is_real_type(d))
+ {
+ d->priv_->qualified_name_ = env.intern(get_real_type_name(t));
+ d->priv_->internal_qualified_name_ =
+ env.intern(get_internal_real_type_name(t));
+ }
+ else
+ {
+ d->priv_->qualified_name_ =
+ env.intern(d->priv_->qualified_parent_name_ + "::" + d->get_name());
+ d->priv_->internal_qualified_name_ = env.intern(d->get_name());
+ }
}
}
// Make sure the internal qualified name (used for type
- // canonicalization puroses) is always the qualified name. For
+ // canonicalization purposes) is always the qualified name. For
// integral/real types however, only the non qualified type is used.
- if (!is_integral_type(d))
+ if (!is_real_type(d))
d->priv_->internal_qualified_name_ = d->priv_->qualified_name_;
if (d->priv_->scoped_name_.empty())