+ e->inline_failed = CIF_FUNCTION_NOT_CONSIDERED;
+ }
+}
+
+/* Computes the frequency of the call statement so that it can be stored in
+ cgraph_edge. BB is the basic block of the call statement. */
+int
+compute_call_stmt_bb_frequency (tree decl, basic_block bb)
+{
+ int entry_freq = ENTRY_BLOCK_PTR_FOR_FUNCTION
+ (DECL_STRUCT_FUNCTION (decl))->frequency;
+ int freq = bb->frequency;
+
+ if (profile_status_for_function (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
+ return CGRAPH_FREQ_BASE;
+
+ if (!entry_freq)
+ entry_freq = 1, freq++;
+
+ freq = freq * CGRAPH_FREQ_BASE / entry_freq;
+ if (freq > CGRAPH_FREQ_MAX)
+ freq = CGRAPH_FREQ_MAX;
+
+ return freq;
+}
+
+/* Mark address taken in STMT. */
+
+static bool
+mark_address (gimple stmt ATTRIBUTE_UNUSED, tree addr,
+ void *data ATTRIBUTE_UNUSED)
+{
+ if (TREE_CODE (addr) == FUNCTION_DECL)
+ {
+ struct cgraph_node *node = cgraph_node (addr);
+ cgraph_mark_address_taken_node (node);
+ ipa_record_reference ((struct cgraph_node *)data, NULL,
+ node, NULL,
+ IPA_REF_ADDR, stmt);
+ }
+ else
+ {
+ addr = get_base_address (addr);
+ if (addr && TREE_CODE (addr) == VAR_DECL
+ && (TREE_STATIC (addr) || DECL_EXTERNAL (addr)))
+ {
+ struct varpool_node *vnode = varpool_node (addr);
+ int walk_subtrees;
+
+ if (lang_hooks.callgraph.analyze_expr)
+ lang_hooks.callgraph.analyze_expr (&addr, &walk_subtrees);
+ varpool_mark_needed_node (vnode);
+ if (vnode->alias && vnode->extra_name)
+ vnode = vnode->extra_name;
+ ipa_record_reference ((struct cgraph_node *)data, NULL,
+ NULL, vnode,
+ IPA_REF_ADDR, stmt);
+ }