///@return the alias, or NULL if there is no alias.
elf_symbol_sptr
elf_symbol::get_next_alias() const
-{
- if (priv_->next_alias_.expired())
- return elf_symbol_sptr();
- return elf_symbol_sptr(priv_->next_alias_);
-}
+{return priv_->next_alias_.lock();}
/// Check if the current elf_symbol has an alias.
/// @return the next common instance, or nil if there is not any.
elf_symbol_sptr
elf_symbol::get_next_common_instance() const
-{
- if (priv_->next_common_instance_.expired())
- return elf_symbol_sptr();
- return elf_symbol_sptr(priv_->next_common_instance_);
-}
+{return priv_->next_common_instance_.lock();}
/// Add a common instance to the current common elf symbol.
///
/// type.
type_base_sptr
type_base::get_canonical_type() const
-{
- if (priv_->canonical_type.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->canonical_type);
-}
+{return priv_->canonical_type.lock();}
/// Getter of the canonical type pointer.
///
/// Getter of the underlying type
shared_ptr<type_base>
qualified_type_def::get_underlying_type() const
-{
- if (priv_->underlying_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->underlying_type_);
-}
+{return priv_->underlying_type_.lock();}
/// Non-member equality operator for @ref qualified_type_def
///
/// @return the pointed-to type.
const type_base_sptr
pointer_type_def::get_pointed_to_type() const
-{
- if (priv_->pointed_to_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->pointed_to_type_);
-}
+{return priv_->pointed_to_type_.lock();}
/// Getter of a naked pointer to the pointed-to type.
///
type_base_sptr
reference_type_def::get_pointed_to_type() const
-{
- if (pointed_to_type_.expired())
- return type_base_sptr();
- return type_base_sptr(pointed_to_type_);
-}
+{return pointed_to_type_.lock();}
bool
reference_type_def::is_lvalue() const
/// @return the underlying type.
type_base_sptr
array_type_def::subrange_type::get_underlying_type() const
-{
- if (priv_->underlying_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->underlying_type_);
-}
+{return priv_->underlying_type_.lock();}
/// Setter of the underlying type of the subrange, that is, the type
/// that defines the range.
/// @return the type of an array element.
const type_base_sptr
array_type_def::get_element_type() const
-{
- if (priv_->element_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->element_type_);
-}
+{return priv_->element_type_.lock();}
/// Setter of the type of array element.
///
/// @return the underlying_type.
type_base_sptr
typedef_decl::get_underlying_type() const
-{
- if (priv_->underlying_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->underlying_type_);
-}
+{return priv_->underlying_type_.lock();}
/// This implements the ir_traversable_base::traverse pure virtual
/// function.
/// @return the type of the variable.
const type_base_sptr
var_decl::get_type() const
-{
- if (priv_->type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->type_);
-}
+{return priv_->type_.lock();}
/// Getter of the type of the variable.
///
/// @return the return type.
type_base_sptr
function_type::get_return_type() const
-{
- if (priv_->return_type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->return_type_);
-}
+{return priv_->return_type_.lock();}
/// Setter of the return type of the current instance of @ref
/// function_type.
/// @return the type of the current instance of @ref function_decl.
const shared_ptr<function_type>
function_decl::get_type() const
-{
- if (priv_->type_.expired())
- return function_type_sptr();
- return function_type_sptr(priv_->type_);
-}
+{return priv_->type_.lock();}
/// Fast getter of the type of the current instance of @ref function_decl.
///
const type_base_sptr
function_decl::parameter::get_type()const
-{
- if (priv_->type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->type_);
-}
+{return priv_->type_.lock();}
/// @return a copy of the type name of the parameter.
interned_string
/// @return the naming typedef, if any. Otherwise, returns nil.
typedef_decl_sptr
class_or_union::get_naming_typedef() const
-{
- if (priv_->naming_typedef_.expired())
- return typedef_decl_sptr();
- return typedef_decl_sptr(priv_->naming_typedef_);
-}
+{return priv_->naming_typedef_.lock();}
/// Set the naming typedef of the current instance of @ref class_decl.
///
/// @return the definition of this decl-only class.
const class_or_union_sptr
class_or_union::get_definition_of_declaration() const
-{
- if (priv_->definition_of_declaration_.expired())
- return class_or_union_sptr();
- return class_or_union_sptr(priv_->definition_of_declaration_);
-}
+{return priv_->definition_of_declaration_.lock();}
/// If this @ref class_or_union is declaration-only, get its
/// definition, if any.
/// @return the base class.
class_decl_sptr
class_decl::base_spec::get_base_class() const
-{
- if (priv_->base_class_.expired())
- return class_decl_sptr();
- return class_decl_sptr(priv_->base_class_);
-}
+{return priv_->base_class_.lock();}
/// Getter of the "is-virtual" proprerty of the base class specifier.
///
const template_decl_sptr
template_parameter::get_enclosing_template_decl() const
-{
- if (priv_->template_decl_.expired())
- return template_decl_sptr();
- return template_decl_sptr(priv_->template_decl_);
-}
+{return priv_->template_decl_.lock();}
bool
template_parameter::get_hashing_has_started() const
/// @return the type of the template parameter.
const type_base_sptr
non_type_tparameter::get_type() const
-{
- if (priv_->type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->type_);
-}
+{return priv_->type_.lock();}
/// Get the hash value of the current instance.
///
/// @return the composed type.
const type_base_sptr
type_composition::get_composed_type() const
-{
- if (priv_->type_.expired())
- return type_base_sptr();
- return type_base_sptr(priv_->type_);
-}
+{return priv_->type_.lock();}
/// Setter for the resulting composed type.
///