return new_binfo;
}
-/* Return the binfo value for ELEM in TYPE. */
-
-tree
-binfo_value (elem, type)
- tree elem;
- tree type;
-{
- if (get_base_distance (elem, type, 0, (tree *)0) == -2)
- compiler_error ("base class `%s' ambiguous in binfo_value",
- TYPE_NAME_STRING (elem));
- if (elem == type)
- return TYPE_BINFO (type);
- if (TREE_CODE (elem) == RECORD_TYPE && TYPE_BINFO (elem) == type)
- return type;
- return get_binfo (elem, type, 0);
-}
-
/* Return a TREE_LIST whose TREE_VALUE nodes along the
BINFO_INHERITANCE_CHAIN for BINFO, but in the opposite order. In
other words, while the BINFO_INHERITANCE_CHAIN goes from base
return ovl_cons (decl, chain);
}
-/* True if fn is in ovl. */
-
-int
-ovl_member (fn, ovl)
- tree fn;
- tree ovl;
-{
- if (ovl == NULL_TREE)
- return 0;
- if (TREE_CODE (ovl) != OVERLOAD)
- return ovl == fn;
- for (; ovl; ovl = OVL_CHAIN (ovl))
- if (OVL_FUNCTION (ovl) == fn)
- return 1;
- return 0;
-}
-
int
is_aggr_type_2 (t1, t2)
tree t1, t2;
tree *binfop;
{
tree decl, context;
-
+ tree binfo;
+
if (current_class_type
- && get_base_distance (type, current_class_type, 0, binfop) != -1)
+ && (binfo = lookup_base (current_class_type, type,
+ ba_ignore | ba_quiet, NULL)))
context = current_class_type;
else
{
/* Reference from a nested class member function. */
context = type;
- if (binfop)
- *binfop = TYPE_BINFO (type);
+ binfo = TYPE_BINFO (type);
}
+ if (binfop)
+ *binfop = binfo;
+
if (current_class_ref && context == current_class_type)
decl = current_class_ref;
else
return var;
}
+/* Record that we're about to start inlining FN, and return non-zero if
+ that's OK. Used for lang_hooks.tree_inlining.start_inlining. */
+
+int
+cp_start_inlining (fn)
+ tree fn;
+{
+ if (DECL_TEMPLATE_INSTANTIATION (fn))
+ return push_tinst_level (fn);
+ else
+ return 1;
+}
+
+/* Record that we're done inlining FN. Used for
+ lang_hooks.tree_inlining.end_inlining. */
+
+void
+cp_end_inlining (fn)
+ tree fn ATTRIBUTE_UNUSED;
+{
+ if (DECL_TEMPLATE_INSTANTIATION (fn))
+ pop_tinst_level ();
+}
+
/* Initialize tree.c. */
void