friend void keep_type_alive(type_base_sptr);
}; // end class environment
+class location_manager;
/// @brief The source location of a token.
///
/// This represents the location of a token coming from a given
class location
{
unsigned value_;
+ // The location manager to use to decode the value above. There is
+ // one location manager per translation unit, and the location
+ // manager's life time is managed by its translation unit.
+ location_manager* loc_manager_;
- location(unsigned v) : value_(v) {}
+ location(unsigned v, location_manager* m)
+ : value_(v), loc_manager_(m)
+ {}
+
+ /// Get the location manager to use to decode the value of this
+ /// location.
+ ///
+ /// @return the location manager for the current location value.
+ location_manager*
+ get_location_manager() const
+ {return loc_manager_;}
public:
- location() : value_(0) { }
+ /// Copy constructor of the location.
+ ///
+ /// @param l the location to copy from.
+ location(const location& l)
+ : value_(l.value_),
+ loc_manager_(l.loc_manager_)
+ {}
+
+ /// Default constructor for the @ref location type.
+ location()
+ : value_(), loc_manager_()
+ {}
+ /// Get the value of the location.
unsigned
get_value() const
{return value_;}
+ /// Convert the location into a boolean.
+ ///
+ /// @return true iff the value of the location is different from
+ /// zero.
operator bool() const
- { return !!value_; }
+ {return !!value_;}
+ /// Equality operator of the @ref location type.
+ ///
+ /// @param other the other location to compare against.
+ ///
+ /// @return true iff both locations are equal.
bool
operator==(const location other) const
{return value_ == other.value_;}
+ /// "Less than" operator of the @ref location type.
+ ///
+ /// @parm other the other location type to compare against.
+ ///
+ /// @return true iff the current instance is less than the @p other
+ /// one.
bool
operator<(const location other) const
- { return value_ < other.value_; }
+ {return value_ < other.value_;}
+
+ /// Expand the current location into a tripplet file path, line and
+ /// column number.
+ ///
+ /// @param path the output parameter this function sets the expanded
+ /// path to.
+ ///
+ /// @param line the output parameter this function sets the expanded
+ /// line number to.
+ ///
+ /// @param column the output parameter this function sets the
+ /// expanded column number to.
+ void
+ expand(std::string& path, unsigned& line, unsigned& column) const;
friend class location_manager;
}; // end class location
create_new_location(const std::string& fle, size_t lne, size_t col);
void
- expand_location(const location location, std::string& path,
+ expand_location(const location& location, std::string& path,
unsigned& line, unsigned& column) const;
};
void
set_environment(environment*);
- void
- set_corpus(const corpus*);
-
const corpus*
get_corpus() const;
+ void
+ set_translation_unit(const translation_unit*);
+
+ const translation_unit*
+ get_translation_unit() const;
+
virtual bool
traverse(ir_node_visitor&);
set_context_rel(context_rel_sptr c);
public:
- decl_base(const std::string& name, location locus,
+ decl_base(const std::string& name, const location& locus,
const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT);
- decl_base(location);
+ decl_base(const location&);
decl_base(const decl_base&);
void
set_is_in_public_symbol_table(bool);
- location
+ const location&
get_location() const;
void
public:
struct hash;
- scope_decl(const std::string& name, location locus,
+ scope_decl(const std::string& name, const location& locus,
visibility vis = VISIBILITY_DEFAULT)
: type_or_decl_base(),
decl_base(name, locus, /*mangled_name=*/name, vis)
{}
- scope_decl(location l) : decl_base("", l)
+ scope_decl(location& l) : decl_base("", l)
{}
virtual size_t
struct hash;
type_decl(const std::string& name,
- size_t size_in_bits, size_t alignment_in_bits,
- location locus, const std::string& mangled_name = "",
+ size_t size_in_bits,
+ size_t alignment_in_bits,
+ const location& locus,
+ const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT);
virtual bool
struct hash;
scope_type_decl(const std::string& name, size_t size_in_bits,
- size_t alignment_in_bits, location locus,
+ size_t alignment_in_bits, const location& locus,
visibility vis = VISIBILITY_DEFAULT);
virtual bool
{
public:
- namespace_decl(const std::string& name, location locus,
+ namespace_decl(const std::string& name, const location& locus,
visibility vis = VISIBILITY_DEFAULT);
virtual string
CV_RESTRICT = 1 << 2
};
- qualified_type_def(type_base_sptr type, CV quals, location locus);
+ qualified_type_def(type_base_sptr type, CV quals, const location& locus);
virtual size_t
get_size_in_bits() const;
struct hash;
pointer_type_def(const type_base_sptr& pointed_to_type, size_t size_in_bits,
- size_t alignment_in_bits, location locus);
+ size_t alignment_in_bits, const location& locus);
virtual bool
operator==(const decl_base&) const;
reference_type_def(const type_base_sptr pointed_to_type,
bool lvalue, size_t size_in_bits,
- size_t alignment_in_bits, location locus);
+ size_t alignment_in_bits, const location& locus);
virtual bool
operator==(const decl_base&) const;
/// Hasher for an instance of array::subrange
struct hash;
- subrange_type(size_t lower_bound, size_t upper_bound,
- location loc);
+ subrange_type(size_t lower_bound,
+ size_t upper_bound,
+ const location& loc);
- subrange_type(size_t upper_bound, location loc);
+ subrange_type(size_t upper_bound, const location& loc);
size_t
get_upper_bound() const;
bool
operator==(const subrange_type& o) const;
- location
+ const location&
get_location() const;
};
array_type_def(const type_base_sptr type,
const std::vector<subrange_sptr>& subs,
- location locus);
+ const location& locus);
virtual bool
operator==(const decl_base&) const;
virtual bool
traverse(ir_node_visitor& v);
- location
+ const location&
get_location() const;
const std::vector<subrange_sptr>&
/// @param mangled_name the mangled name of the enum type.
///
/// @param vis the visibility of instances of this type.
- enum_type_decl(const string& name, location locus,
+ enum_type_decl(const string& name, const location& locus,
type_base_sptr underlying_type,
enumerators& enms, const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT);
struct hash;
typedef_decl(const string& name, const shared_ptr<type_base> underlying_type,
- location locus, const std::string& mangled_name = "",
+ const location& locus, const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT);
virtual size_t
var_decl(const std::string& name,
shared_ptr<type_base> type,
- location locus,
+ const location& locus,
const std::string& mangled_name,
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_NONE);
function_decl(const std::string& name,
function_type_sptr function_type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& mangled_name,
visibility vis,
binding bind);
function_decl(const std::string& name,
shared_ptr<type_base> fn_type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_GLOBAL);
parameter(const type_base_sptr type,
unsigned index,
const std::string& name,
- location loc,
+ const location& loc,
bool variadic_marker = false);
parameter(const type_base_sptr type,
unsigned index,
const std::string& name,
- location loc,
+ const location& loc,
bool variadic_marker,
bool is_artificial);
parameter(const type_base_sptr type,
const std::string& name,
- location loc,
+ const location& loc,
bool variadic_marker = false,
bool is_artificial = false);
/// Hasher.
struct hash;
- template_decl(const string& name,
- location locus,
- visibility vis = VISIBILITY_DEFAULT);
+ template_decl(const string& name,
+ const location& locus,
+ visibility vis = VISIBILITY_DEFAULT);
void
add_template_parameter(const template_parameter_sptr p);
type_tparameter(unsigned index,
template_decl_sptr enclosing_tdecl,
const std::string& name,
- location locus);
+ const location& locus);
virtual bool
operator==(const type_base&) const;
non_type_tparameter(unsigned index,
template_decl_sptr enclosing_tdecl,
const std::string& name,
- shared_ptr<type_base> type,
- location locus);
+ type_base_sptr type,
+ const location& locus);
virtual size_t
get_hash() const;
/// A hasher for instances of template_tparameter
struct hash;
- template_tparameter(unsigned index,
- template_decl_sptr enclosing_tdecl,
- const std::string& name,
- location locus);
+ template_tparameter(unsigned index,
+ template_decl_sptr enclosing_tdecl,
+ const std::string& name,
+ const location& locus);
virtual bool
operator==(const type_base&) const;
struct hash;
struct shared_ptr_hash;
- function_tdecl(location locus,
- visibility vis = VISIBILITY_DEFAULT,
- binding bind = BINDING_NONE);
+ function_tdecl(const location& locus,
+ visibility vis = VISIBILITY_DEFAULT,
+ binding bind = BINDING_NONE);
function_tdecl(function_decl_sptr pattern,
- location locus,
+ const location& locus,
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_NONE);
struct hash;
struct shared_ptr_hash;
- class_tdecl(location locus, visibility vis = VISIBILITY_DEFAULT);
+ class_tdecl(const location& locus, visibility vis = VISIBILITY_DEFAULT);
- class_tdecl(shared_ptr<class_decl> pattern,
- location locus, visibility vis = VISIBILITY_DEFAULT);
+ class_tdecl(class_decl_sptr pattern,
+ const location& locus,
+ visibility vis = VISIBILITY_DEFAULT);
virtual bool
operator==(const decl_base&) const;
class_decl(const std::string& name, size_t size_in_bits,
size_t align_in_bits, bool is_struct,
- location locus, visibility vis,
+ const location& locus, visibility vis,
base_specs& bases, member_types& mbrs,
data_members& data_mbrs, member_functions& member_fns);
class_decl(const std::string& name, size_t size_in_bits,
size_t align_in_bits, bool is_struct,
- location locus, visibility vis);
+ const location& locus, visibility vis);
class_decl(const std::string& name, bool is_struct,
bool is_declaration_only = true);
public:
- method_decl(const std::string& name, shared_ptr<method_type> type,
- bool declared_inline, location locus,
+ method_decl(const std::string& name, method_type_sptr type,
+ bool declared_inline, const location& locus,
const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_GLOBAL);
method_decl(const std::string& name,
- shared_ptr<function_type> type,
+ function_type_sptr type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_GLOBAL);
- method_decl(const std::string& name, shared_ptr<type_base> type,
- bool declared_inline, location locus,
+ method_decl(const std::string& name, type_base_sptr type,
+ bool declared_inline, const location& locus,
const std::string& mangled_name = "",
visibility vis = VISIBILITY_DEFAULT,
binding bind = BINDING_GLOBAL);
}
};
+/// Expand the location into a tripplet path, line and column number.
+///
+/// @param path the output parameter where this function sets the
+/// expanded path.
+///
+/// @param line the output parameter where this function sets the
+/// expanded line.
+///
+/// @param column the ouptut parameter where this function sets the
+/// expanded column.
+void
+location::expand(std::string& path, unsigned& line, unsigned& column) const
+{
+ assert(get_location_manager());
+ get_location_manager()->expand_location(*this, path, line, column);
+}
+
struct location_manager::priv
{
/// This sorted vector contains the expanded locations of the tokens
// Just append the new expanded location to the end of the vector
// and return its index. Note that indexes start at 1.
priv_->locs.push_back(l);
- return location(priv_->locs.size());
+ return location(priv_->locs.size(), this);
}
/// Given an instance of location type, return the triplet
/// @param line the resulting line of the source locus
/// @param column the resulting colum of the source locus
void
-location_manager::expand_location(const location location,
+location_manager::expand_location(const location& location,
std::string& path,
unsigned& line,
unsigned& column) const
// translation unit.
priv_->global_scope_->
set_environment(const_cast<environment*>(get_environment()));
- priv_->global_scope_->set_corpus(get_corpus());
+ priv_->global_scope_->set_translation_unit(this);
}
return priv_->global_scope_;
}
ftype->set_environment(const_cast<environment*>(env));
}
- if (const corpus* c = get_corpus())
- {
- if (const corpus* existing_corpus = ftype->get_corpus())
- assert(existing_corpus == c);
- else
- ftype->set_corpus(c);
- }
+ if (const translation_unit* existing_tu = ftype->get_translation_unit())
+ assert(existing_tu == this);
+ else
+ ftype->set_translation_unit(this);
}
/// This implements the ir_traversable_base::traverse virtual
{
bool hashing_started_;
environment* env_;
- const corpus* corpus_;
+ const translation_unit* translation_unit_;
priv()
: hashing_started_(),
env_(),
- corpus_()
+ translation_unit_()
{}
}; // end struct type_or_decl_base
type_or_decl_base::get_environment()
{return priv_->env_;}
-/// Set the @ref corpus this ABI artifact belongs to.
-///
-/// Note that adding an ABI artifact to a containining one should
-/// invoke this this member function.
-///
-/// @param c the new corpus.
-void
-type_or_decl_base::set_corpus(const corpus* c)
-{priv_->corpus_ = c;}
-
/// Get the @ref corpus this ABI artifact belongs to.
///
/// @return the corpus this ABI artifact belongs to, or nil if it
/// belongs to none for now.
const corpus*
type_or_decl_base::get_corpus() const
-{return priv_->corpus_;}
+{
+ const translation_unit* tu = get_translation_unit();
+ if (!tu)
+ return 0;
+ return tu->get_corpus();
+}
+
+/// Set the @ref translation_unit this ABI artifact belongs to.
+///
+/// Note that adding an ABI artifact to a containining on should
+/// invoke this member function.
+void
+type_or_decl_base::set_translation_unit(const translation_unit* tu)
+{priv_->translation_unit_ = tu;}
+
+/// Get the @ref translation_unit this ABI artifact belongs to.
+///
+/// @return the translation unit this ABI artifact belongs to, or nil
+/// if belongs to none for now.
+const translation_unit*
+type_or_decl_base::get_translation_unit() const
+{return priv_->translation_unit_;}
/// Traverse the the ABI artifact.
///
visibility_(VISIBILITY_DEFAULT)
{}
- priv(const std::string& name, location locus,
+ priv(const std::string& name, const location& locus,
const std::string& linkage_name, visibility vis)
: in_pub_sym_tab_(false),
location_(locus),
{}
};// end struct decl_base::priv
-decl_base::decl_base(const std::string& name,
- location locus,
- const std::string& linkage_name,
- visibility vis)
+/// Constructor for the @ref decl_base type.
+///
+/// @param name the name of the declaration.
+///
+/// @param locus the location where to find the declaration in the
+/// source code.
+///
+/// @pram linkage_name the linkage name of the declaration.
+///
+/// @param vis the visibility of the declaration.
+decl_base::decl_base(const std::string& name,
+ const location& locus,
+ const std::string& linkage_name,
+ visibility vis)
: priv_(new priv(name, locus, linkage_name, vis))
{}
-decl_base::decl_base(location l)
+/// Constructor for the @ref decl_base type.
+///
+/// @param l the location where to find the declaration in the source
+/// code.
+decl_base::decl_base(const location& l)
: priv_(new priv(l))
{}
/// translation_unit::get_loc_mgr().
///
/// @return the location of the current instance of @ref decl_base.
-location
+const location&
decl_base::get_location() const
{return priv_->location_;}
if (environment* env = get_environment())
set_environment_for_artifact(member, env);
- if (const corpus* c = get_corpus())
+ if (const translation_unit* tu = get_translation_unit())
{
- if (const corpus* existing_corpus = member->get_corpus())
- assert(c == existing_corpus);
+ if (const translation_unit* existing_tu = member->get_translation_unit())
+ assert(tu == existing_tu);
else
- member->set_corpus(c);
+ member->set_translation_unit(tu);
}
maybe_update_types_lookup_map(this, member);
if (environment* env = get_environment())
set_environment_for_artifact(member, env);
- if (const corpus* c = get_corpus())
+ if (const translation_unit* tu = get_translation_unit())
{
- if (const corpus* existing_corpus = member->get_corpus())
- assert(c == existing_corpus);
+ if (const translation_unit* existing_tu = member->get_translation_unit())
+ assert(tu == existing_tu);
else
- member->set_corpus(c);
+ member->set_translation_unit(tu);
}
maybe_update_types_lookup_map(this, member);
/// yet added to a translation unit.
translation_unit*
get_translation_unit(const decl_base& decl)
-{
- const global_scope* global = get_global_scope(decl);
-
- if (global)
- return global->get_translation_unit();
- return 0;
-}
+{return const_cast<translation_unit*>(decl.get_translation_unit());}
/// Return the translation unit a declaration belongs to.
///
type_decl::type_decl(const std::string& name,
size_t size_in_bits,
size_t alignment_in_bits,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis)
// <scope_type_decl definitions>
-scope_type_decl::scope_type_decl(const std::string& name,
- size_t size_in_bits,
- size_t alignment_in_bits,
- location locus,
- visibility vis)
+scope_type_decl::scope_type_decl(const std::string& name,
+ size_t size_in_bits,
+ size_t alignment_in_bits,
+ const location& locus,
+ visibility vis)
: decl_base(name, locus, "", vis),
type_base(size_in_bits, alignment_in_bits),
scope_decl(name, locus)
// </scope_type_decl definitions>
// <namespace_decl>
-namespace_decl::namespace_decl(const std::string& name,
- location locus,
- visibility vis)
+namespace_decl::namespace_decl(const std::string& name,
+ const location& locus,
+ visibility vis)
: // We need to call the constructor of decl_base directly here
// because it is virtually inherited by scope_decl. Note that we
// just implicitely call the default constructor for scope_decl
/// @param quals a bitfield representing the const/volatile qualifiers
///
/// @param locus the location of the qualified type definition
-qualified_type_def::qualified_type_def(shared_ptr<type_base> type,
- CV quals,
- location locus)
+qualified_type_def::qualified_type_def(type_base_sptr type,
+ CV quals,
+ const location& locus)
: type_base(type->get_size_in_bits(),
type->get_alignment_in_bits()),
decl_base("", locus, "",
pointer_type_def::pointer_type_def(const type_base_sptr& pointed_to,
size_t size_in_bits,
size_t align_in_bits,
- location locus)
+ const location& locus)
: type_base(size_in_bits, align_in_bits),
decl_base("", locus, ""),
priv_(new priv)
bool lvalue,
size_t size_in_bits,
size_t align_in_bits,
- location locus)
+ const location& locus)
: type_base(size_in_bits, align_in_bits),
decl_base("", locus, ""),
is_lvalue_(lvalue)
size_t lower_bound_;
size_t upper_bound_;
location location_;
- priv(size_t ub, location loc)
+ priv(size_t ub, const location& loc)
: lower_bound_(0), upper_bound_(ub), location_(loc) {}
- priv(size_t lb, size_t ub, location loc)
+
+ priv(size_t lb, size_t ub, const location& loc)
: lower_bound_(lb), upper_bound_(ub), location_(loc) {}
};
-array_type_def::subrange_type::subrange_type(size_t lower_bound,
- size_t upper_bound,
- location loc)
+array_type_def::subrange_type::subrange_type(size_t lower_bound,
+ size_t upper_bound,
+ const location& loc)
: priv_(new priv(lower_bound, upper_bound, loc))
{}
-array_type_def::subrange_type::subrange_type(size_t upper_bound, location loc)
+array_type_def::subrange_type::subrange_type(size_t upper_bound,
+ const location& loc)
: priv_(new priv(upper_bound, loc))
{}
&& get_upper_bound() == o.get_upper_bound());
}
-location
+const location&
array_type_def::subrange_type::get_location() const
{return priv_->location_;}
/// @param locus the source location of the array type definition.
array_type_def::array_type_def(const type_base_sptr e_type,
const std::vector<subrange_sptr>& subs,
- location locus)
+ const location& locus)
: type_base(0, e_type->get_alignment_in_bits()),
decl_base(locus),
priv_(new priv(e_type))
return v.visit_end(this);
}
-location
+const location&
array_type_def::get_location() const
{return decl_base::get_location();}
{}
}; // end class enum_type_decl::priv
-enum_type_decl::enum_type_decl(const string& name, location locus,
+enum_type_decl::enum_type_decl(const string& name,
+ const location& locus,
type_base_sptr underlying_type,
- enumerators& enums, const string& mangled_name,
+ enumerators& enums,
+ const string& mangled_name,
visibility vis)
: type_base(underlying_type->get_size_in_bits(),
underlying_type->get_alignment_in_bits()),
/// @param vis the visibility of the typedef type.
typedef_decl::typedef_decl(const string& name,
const type_base_sptr underlying_type,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis)
: type_base(underlying_type->get_size_in_bits(),
var_decl::var_decl(const std::string& name,
shared_ptr<type_base> type,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis,
binding bind)
function_decl::function_decl(const std::string& name,
function_type_sptr function_type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& mangled_name,
visibility vis,
binding bind)
function_decl::function_decl(const std::string& name,
shared_ptr<type_base> fn_type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis,
binding bind)
function_decl::parameter::parameter(const type_base_sptr type,
unsigned index,
const std::string& name,
- location loc,
+ const location& loc,
bool is_variadic)
: decl_base(name, loc),
priv_(new priv(type, index, is_variadic, /*is_artificial=*/false))
function_decl::parameter::parameter(const type_base_sptr type,
unsigned index,
const std::string& name,
- location loc,
+ const location& loc,
bool is_variadic,
bool is_artificial)
: decl_base(name, loc),
function_decl::parameter::parameter(const type_base_sptr type,
const std::string& name,
- location loc,
+ const location& loc,
bool is_variadic,
bool is_artificial)
: decl_base(name, loc),
/// class_decl.
class_decl::class_decl(const std::string& name, size_t size_in_bits,
size_t align_in_bits, bool is_struct,
- location locus, visibility vis,
+ const location& locus, visibility vis,
base_specs& bases, member_types& mbr_types,
data_members& data_mbrs,
member_functions& mbr_fns)
/// @param vis the visibility of instances of class_decl.
class_decl::class_decl(const std::string& name, size_t size_in_bits,
size_t align_in_bits, bool is_struct,
- location locus, visibility vis)
+ const location& locus, visibility vis)
: decl_base(name, locus, name, vis),
type_base(size_in_bits, align_in_bits),
scope_type_decl(name, size_in_bits, align_in_bits, locus, vis),
(const std::string& name,
shared_ptr<method_type> type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis,
binding bind)
class_decl::method_decl::method_decl(const std::string& name,
shared_ptr<function_type> type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis,
binding bind)
class_decl::method_decl::method_decl(const std::string& name,
shared_ptr<type_base> type,
bool declared_inline,
- location locus,
+ const location& locus,
const std::string& linkage_name,
visibility vis,
binding bind)
template_decl::get_template_parameters() const
{return priv_->parms_;}
-template_decl::template_decl(const string& name, location locus, visibility vis)
+template_decl::template_decl(const string& name,
+ const location& locus,
+ visibility vis)
: decl_base(name, locus, /*mangled_name=*/"", vis),
priv_(new priv)
{
type_tparameter::type_tparameter(unsigned index,
template_decl_sptr enclosing_tdecl,
const std::string& name,
- location locus)
+ const location& locus)
: decl_base(name, locus),
type_base(0, 0),
type_decl(name, 0, 0, locus),
template_decl_sptr enclosing_tdecl,
const std::string& name,
type_base_sptr type,
- location locus)
+ const location& locus)
: decl_base(name, locus, ""),
template_parameter(index, enclosing_tdecl),
priv_(new priv(type))
template_tparameter::template_tparameter(unsigned index,
template_decl_sptr enclosing_tdecl,
const std::string& name,
- location locus)
+ const location& locus)
: decl_base(name, locus),
type_base(0, 0),
type_decl(name, 0, 0, locus, name, VISIBILITY_DEFAULT),
///
/// @param bind the binding of the declaration. This is the binding
/// the functions instantiated from this template are going to have.
-function_tdecl::function_tdecl(location locus,
+function_tdecl::function_tdecl(const location& locus,
visibility vis,
binding bind)
: decl_base("", locus, "", vis),
/// @param bind the binding of the declaration. This is the binding
/// the functions instantiated from this template are going to have.
function_tdecl::function_tdecl(function_decl_sptr pattern,
- location locus,
+ const location& locus,
visibility vis,
binding bind)
: decl_base(pattern->get_name(), locus,
///
/// @param vis the visibility of the instance of class instantiated
/// from this template.
-class_tdecl::class_tdecl(location locus, visibility vis)
+class_tdecl::class_tdecl(const location& locus, visibility vis)
: decl_base("", locus, "", vis),
template_decl("", locus, vis),
scope_decl("", locus),
/// @param vis the visibility of the instances of class instantiated
/// from this template.
class_tdecl::class_tdecl(class_decl_sptr pattern,
- location locus, visibility vis)
+ const location& locus,
+ visibility vis)
: decl_base(pattern->get_name(), locus,
pattern->get_name(), vis),
template_decl(pattern->get_name(), locus, vis),