Return a reference to smart pointer for the void type node

This is just a small optimization in the passing

	* src/abg-ir.h (type_decl::get_void_type_decl): Return a reference
	to the smart pointer initially returned.
	* src/abg-ir.cc (type_decl::get_void_type_decl): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2015-05-05 10:45:15 +02:00
parent 9b4d20db90
commit 5852910238
2 changed files with 2 additions and 2 deletions

View File

@ -1118,7 +1118,7 @@ public:
location locus, const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT);
static type_decl_sptr
static type_decl_sptr&
get_void_type_decl();
static type_decl_sptr&

View File

@ -4645,7 +4645,7 @@ type_decl::type_decl(const std::string& name,
/// Get a singleton representing a void type node.
///
/// @return the void type node.
type_decl_sptr
type_decl_sptr&
type_decl::get_void_type_decl()
{
static type_decl_sptr void_type_decl;