Skip to content

Instantly share code, notes, and snippets.

@jyasskin
Created July 16, 2010 16:04
Show Gist options
  • Save jyasskin/478544 to your computer and use it in GitHub Desktop.
Save jyasskin/478544 to your computer and use it in GitHub Desktop.
static void
update_class_location(tree cls, location_t new_location)
{
tree instantiations, tmpl_info, tmpl_decl;
DECL_SOURCE_LOCATION (TYPE_NAME (cls)) = new_location;
if ((tmpl_info = CLASSTYPE_TEMPLATE_INFO (cls)))
{
tmpl_decl = TI_TEMPLATE (tmpl_info);
for (instantiations = DECL_TEMPLATE_INSTANTIATIONS (tmpl_decl);
instantiations;
instantiations = TREE_CHAIN (instantiations))
{
tree inst_decl = TYPE_NAME (TREE_VALUE (instantiations));
if (COMPLETE_TYPE_P (inst_decl))
continue;
DECL_SOURCE_LOCATION (inst_decl) = new_location;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment