summaryrefslogtreecommitdiff
path: root/gcc/dumpfile.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2018-10-04 17:41:08 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2018-10-04 17:41:08 +0000
commit7db960c5b6adad2fd11789870aa514985ea0da04 (patch)
treed01b112eba4bb441f9238c70760336301eaddcd7 /gcc/dumpfile.c
parent5e1b4477fa0c1eca86d2b67808ffee5ac969acd4 (diff)
downloadgcc-7db960c5b6adad2fd11789870aa514985ea0da04.tar.gz
Add -fopt-info-internals
This patch introduces a verbosity level to dump messages: "user-facing" vs "internals". By default, messages at the top-level dump scope are "user-facing", whereas those that are in nested scopes are implicitly "internals", and are filtered out by -fopt-info unless a new "-internals" sub-option of "-fopt-info" is supplied (intended purely for use by GCC developers). Dumpfiles are unaffected by the change. Given that the vectorizer is the only subsystem using AUTO_DUMP_SCOPE (via DUMP_VECT_SCOPE), this only affects the vectorizer. Filtering out these implementation-detail messages goes a long way towards making -fopt-info-vec-all more accessible to advanced end-users; the follow-up patch restores the most pertinent missing details. gcc/ChangeLog: * doc/invoke.texi (-fopt-info): Document new "internals" sub-option. * dump-context.h (dump_context::apply_dump_filter_p): New decl. * dumpfile.c (dump_options): Update for renaming of MSG_ALL to MSG_ALL_KINDS. (optinfo_verbosity_options): Add "internals". (kind_as_string): Update for renaming of MSG_ALL to MSG_ALL_KINDS. (dump_context::apply_dump_filter_p): New member function. (dump_context::dump_loc): Use apply_dump_filter_p rather than explicitly masking the dump_kind. (dump_context::begin_scope): Increment the scope depth first. Use apply_dump_filter_p rather than explicitly masking the dump_kind. (dump_context::emit_item): Use apply_dump_filter_p rather than explicitly masking the dump_kind. (dump_dec): Likewise. (dump_hex): Likewise. (dump_switch_p_1): Default to MSG_ALL_PRIORITIES. (opt_info_switch_p_1): Default to MSG_PRIORITY_USER_FACING. (opt_info_switch_p): Update handling of default MSG_OPTIMIZED_LOCATIONS to cope with default of MSG_PRIORITY_USER_FACING. (dump_basic_block): Use apply_dump_filter_p rather than explicitly masking the dump_kind. (selftest::test_capture_of_dump_calls): Update test_dump_context instances to use MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING rather than MSG_ALL. Generalize scope test to be run at all four combinations of with/without MSG_PRIORITY_USER_FACING and MSG_PRIORITY_INTERNALS, adding examples of explicit priority for each of the two values. * dumpfile.h (enum dump_flag): Add comment about the MSG_* flags. Rename MSG_ALL to MSG_ALL_KINDS. Add MSG_PRIORITY_USER_FACING, MSG_PRIORITY_INTERNALS, and MSG_ALL_PRIORITIES, updating the values for TDF_COMPARE_DEBUG and TDF_ALL_VALUES. (AUTO_DUMP_SCOPE): Add a note to the comment about the interaction with MSG_PRIORITY_*. * tree-vect-loop-manip.c (vect_loop_versioning): Mark versioning dump messages as MSG_PRIORITY_USER_FACING. * tree-vectorizer.h (DUMP_VECT_SCOPE): Add a note to the comment about the interaction with MSG_PRIORITY_*. gcc/testsuite/ChangeLog: * gcc.dg/plugin/dump-1.c: Update expected output for test_scopes due to "-internals" not being selected. * gcc.dg/plugin/dump-2.c: New test, based on dump-1.c, with "-internals" added to re-enable the output from test_scopes. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add dump-2.c. From-SVN: r264851
Diffstat (limited to 'gcc/dumpfile.c')
-rw-r--r--gcc/dumpfile.c248
1 files changed, 174 insertions, 74 deletions
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index d359e41f750..e15edc7a31c 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -141,7 +141,7 @@ static const kv_pair<dump_flags_t> dump_options[] =
{"optimized", MSG_OPTIMIZED_LOCATIONS},
{"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE},
- {"optall", MSG_ALL},
+ {"optall", MSG_ALL_KINDS},
{"all", dump_flags_t (TDF_ALL_VALUES
& ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH
| TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID
@@ -157,7 +157,8 @@ static const kv_pair<dump_flags_t> optinfo_verbosity_options[] =
{"optimized", MSG_OPTIMIZED_LOCATIONS},
{"missed", MSG_MISSED_OPTIMIZATION},
{"note", MSG_NOTE},
- {"all", MSG_ALL},
+ {"all", MSG_ALL_KINDS},
+ {"internals", MSG_PRIORITY_INTERNALS},
{NULL, TDF_NONE}
};
@@ -449,7 +450,7 @@ dump_user_location_t::from_function_decl (tree fndecl)
static const char *
kind_as_string (dump_flags_t dump_kind)
{
- switch (dump_kind & MSG_ALL)
+ switch (dump_kind & MSG_ALL_KINDS)
{
default:
gcc_unreachable ();
@@ -524,6 +525,35 @@ dump_context::refresh_dumps_are_enabled ()
|| m_test_pp);
}
+/* Determine if a message of kind DUMP_KIND and at the current scope depth
+ should be printed.
+
+ Only show messages that match FILTER both on their kind *and*
+ their priority. */
+
+bool
+dump_context::apply_dump_filter_p (dump_flags_t dump_kind,
+ dump_flags_t filter) const
+{
+ /* Few messages, if any, have an explicit MSG_PRIORITY.
+ If DUMP_KIND does, we'll use it.
+ Otherwise, generate an implicit priority value for the message based
+ on the current scope depth.
+ Messages at the top-level scope are MSG_PRIORITY_USER_FACING,
+ whereas those in nested scopes are MSG_PRIORITY_INTERNALS. */
+ if (!(dump_kind & MSG_ALL_PRIORITIES))
+ {
+ dump_flags_t implicit_priority
+ = (m_scope_depth > 0
+ ? MSG_PRIORITY_INTERNALS
+ : MSG_PRIORITY_USER_FACING);
+ dump_kind |= implicit_priority;
+ }
+
+ return (dump_kind & (filter & MSG_ALL_KINDS)
+ && dump_kind & (filter & MSG_ALL_PRIORITIES));
+}
+
/* Print LOC to the appropriate dump destinations, given DUMP_KIND.
If optinfos are enabled, begin a new optinfo. */
@@ -534,14 +564,14 @@ dump_context::dump_loc (dump_flags_t dump_kind, const dump_location_t &loc)
location_t srcloc = loc.get_location_t ();
- if (dump_file && (dump_kind & pflags))
+ if (dump_file && apply_dump_filter_p (dump_kind, pflags))
::dump_loc (dump_kind, dump_file, srcloc);
- if (alt_dump_file && (dump_kind & alt_flags))
+ if (alt_dump_file && apply_dump_filter_p (dump_kind, alt_flags))
::dump_loc (dump_kind, alt_dump_file, srcloc);
/* Support for temp_dump_context in selftests. */
- if (m_test_pp && (dump_kind & m_test_pp_flags))
+ if (m_test_pp && apply_dump_filter_p (dump_kind, m_test_pp_flags))
::dump_loc (dump_kind, m_test_pp, srcloc);
if (optinfo_enabled_p ())
@@ -1067,22 +1097,24 @@ dump_context::get_scope_depth () const
}
/* Push a nested dump scope.
+ Increment the scope depth.
Print "=== NAME ===\n" to the dumpfile, if any, and to the -fopt-info
destination, if any.
- Emit a "scope" optinfo if optinfos are enabled.
- Increment the scope depth. */
+ Emit a "scope" optinfo if optinfos are enabled. */
void
dump_context::begin_scope (const char *name, const dump_location_t &loc)
{
- if (dump_file && (MSG_NOTE & pflags))
+ m_scope_depth++;
+
+ if (dump_file && apply_dump_filter_p (MSG_NOTE, pflags))
::dump_loc (MSG_NOTE, dump_file, loc.get_location_t ());
- if (alt_dump_file && (MSG_NOTE & alt_flags))
+ if (alt_dump_file && apply_dump_filter_p (MSG_NOTE, alt_flags))
::dump_loc (MSG_NOTE, alt_dump_file, loc.get_location_t ());
/* Support for temp_dump_context in selftests. */
- if (m_test_pp && (MSG_NOTE & m_test_pp_flags))
+ if (m_test_pp && apply_dump_filter_p (MSG_NOTE, m_test_pp_flags))
::dump_loc (MSG_NOTE, m_test_pp, loc.get_location_t ());
pretty_printer pp;
@@ -1100,8 +1132,6 @@ dump_context::begin_scope (const char *name, const dump_location_t &loc)
}
else
delete item;
-
- m_scope_depth++;
}
/* Pop a nested dump scope. */
@@ -1155,14 +1185,14 @@ dump_context::end_any_optinfo ()
void
dump_context::emit_item (optinfo_item *item, dump_flags_t dump_kind)
{
- if (dump_file && (dump_kind & pflags))
+ if (dump_file && apply_dump_filter_p (dump_kind, pflags))
fprintf (dump_file, "%s", item->get_text ());
- if (alt_dump_file && (dump_kind & alt_flags))
+ if (alt_dump_file && apply_dump_filter_p (dump_kind, alt_flags))
fprintf (alt_dump_file, "%s", item->get_text ());
/* Support for temp_dump_context in selftests. */
- if (m_test_pp && (dump_kind & m_test_pp_flags))
+ if (m_test_pp && apply_dump_filter_p (dump_kind, m_test_pp_flags))
pp_string (m_test_pp, item->get_text ());
}
@@ -1278,10 +1308,12 @@ template void dump_dec (dump_flags_t, const poly_widest_int &);
void
dump_dec (dump_flags_t dump_kind, const poly_wide_int &value, signop sgn)
{
- if (dump_file && (dump_kind & pflags))
+ if (dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, pflags))
print_dec (value, dump_file, sgn);
- if (alt_dump_file && (dump_kind & alt_flags))
+ if (alt_dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, alt_flags))
print_dec (value, alt_dump_file, sgn);
}
@@ -1290,10 +1322,12 @@ dump_dec (dump_flags_t dump_kind, const poly_wide_int &value, signop sgn)
void
dump_hex (dump_flags_t dump_kind, const poly_wide_int &value)
{
- if (dump_file && (dump_kind & pflags))
+ if (dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, pflags))
print_hex (value, dump_file);
- if (alt_dump_file && (dump_kind & alt_flags))
+ if (alt_dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, alt_flags))
print_hex (value, alt_dump_file);
}
@@ -1698,7 +1732,7 @@ dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob)
return 0;
ptr = option_value;
- flags = TDF_NONE;
+ flags = MSG_ALL_PRIORITIES;
while (*ptr)
{
@@ -1794,7 +1828,11 @@ opt_info_switch_p_1 (const char *arg, dump_flags_t *flags,
ptr = option_value;
*filename = NULL;
- *flags = TDF_NONE;
+
+ /* Default to filtering out "internals" messages, and retaining
+ "user-facing" messages. */
+ *flags = MSG_PRIORITY_USER_FACING;
+
*optgroup_flags = OPTGROUP_NONE;
if (!ptr)
@@ -1883,8 +1921,8 @@ opt_info_switch_p (const char *arg)
}
file_seen = xstrdup (filename);
- if (!flags)
- flags = MSG_OPTIMIZED_LOCATIONS;
+ if (!(flags & MSG_ALL_KINDS))
+ flags |= MSG_OPTIMIZED_LOCATIONS;
if (!optgroup_flags)
optgroup_flags = OPTGROUP_ALL;
@@ -1896,9 +1934,11 @@ opt_info_switch_p (const char *arg)
void
dump_basic_block (dump_flags_t dump_kind, basic_block bb, int indent)
{
- if (dump_file && (dump_kind & pflags))
+ if (dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, pflags))
dump_bb (dump_file, bb, indent, TDF_DETAILS);
- if (alt_dump_file && (dump_kind & alt_flags))
+ if (alt_dump_file
+ && dump_context::get ().apply_dump_filter_p (dump_kind, alt_flags))
dump_bb (alt_dump_file, bb, indent, TDF_DETAILS);
}
@@ -2104,7 +2144,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Test of dump_printf. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf (MSG_NOTE, "int: %i str: %s", 42, "foo");
ASSERT_DUMPED_TEXT_EQ (tmp, "int: 42 str: foo");
@@ -2120,7 +2161,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Test of dump_printf with %T. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf (MSG_NOTE, "tree: %T", integer_zero_node);
ASSERT_DUMPED_TEXT_EQ (tmp, "tree: 0");
@@ -2137,7 +2179,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Test of dump_printf with %E. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf (MSG_NOTE, "gimple: %E", stmt);
ASSERT_DUMPED_TEXT_EQ (tmp, "gimple: return;");
@@ -2154,7 +2197,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Test of dump_printf with %G. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf (MSG_NOTE, "gimple: %G", stmt);
ASSERT_DUMPED_TEXT_EQ (tmp, "gimple: return;\n");
@@ -2176,7 +2220,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
- multiple dump-specific format codes: some consecutive, others
separated by text, trailing text after the final one. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf_loc (MSG_NOTE, loc, "before %T and %T"
" %i consecutive %E%E after\n",
integer_zero_node, test_decl, 42, stmt, stmt);
@@ -2203,7 +2248,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Tree, via dump_generic_expr. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_printf_loc (MSG_NOTE, loc, "test of tree: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, integer_zero_node);
@@ -2222,7 +2268,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Tree, via dump_generic_expr_loc. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_generic_expr_loc (MSG_NOTE, loc, TDF_SLIM, integer_one_node);
ASSERT_DUMPED_TEXT_EQ (tmp, "test.txt:5:10: note: 1");
@@ -2241,7 +2288,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
{
/* dump_gimple_stmt_loc. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_gimple_stmt_loc (MSG_NOTE, loc, TDF_SLIM, stmt, 2);
ASSERT_DUMPED_TEXT_EQ (tmp, "test.txt:5:10: note: return;\n");
@@ -2256,7 +2304,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* dump_gimple_stmt. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_gimple_stmt (MSG_NOTE, TDF_SLIM, stmt, 2);
ASSERT_DUMPED_TEXT_EQ (tmp, "return;\n");
@@ -2271,7 +2320,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* dump_gimple_expr_loc. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_gimple_expr_loc (MSG_NOTE, loc, TDF_SLIM, stmt, 2);
ASSERT_DUMPED_TEXT_EQ (tmp, "test.txt:5:10: note: return;");
@@ -2286,7 +2336,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* dump_gimple_expr. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_gimple_expr (MSG_NOTE, TDF_SLIM, stmt, 2);
ASSERT_DUMPED_TEXT_EQ (tmp, "return;");
@@ -2302,7 +2353,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* poly_int. */
{
- temp_dump_context tmp (with_optinfo, MSG_ALL);
+ temp_dump_context tmp (with_optinfo,
+ MSG_ALL_KINDS | MSG_PRIORITY_USER_FACING);
dump_dec (MSG_NOTE, poly_int64 (42));
ASSERT_DUMPED_TEXT_EQ (tmp, "42");
@@ -2315,45 +2367,92 @@ test_capture_of_dump_calls (const line_table_case &case_)
}
}
- /* scopes. */
- {
- temp_dump_context tmp (with_optinfo, MSG_ALL);
- dump_printf_loc (MSG_NOTE, stmt, "msg 1\n");
+ /* Scopes. Test with all 4 combinations of
+ filtering by MSG_PRIORITY_USER_FACING
+ and/or filtering by MSG_PRIORITY_INTERNALS. */
+ for (int j = 0; j < 3; j++)
{
- AUTO_DUMP_SCOPE ("outer scope", stmt);
- dump_printf_loc (MSG_NOTE, stmt, "msg 2\n");
+ dump_flags_t dump_filter = MSG_ALL_KINDS;
+ if (j % 2)
+ dump_filter |= MSG_PRIORITY_USER_FACING;
+ if (j / 2)
+ dump_filter |= MSG_PRIORITY_INTERNALS;
+
+ temp_dump_context tmp (with_optinfo, dump_filter);
+ /* Emit various messages, mostly with implicit priority. */
+ dump_printf_loc (MSG_NOTE, stmt, "msg 1\n");
+ dump_printf_loc (MSG_NOTE | MSG_PRIORITY_INTERNALS, stmt,
+ "explicitly internal msg\n");
{
- AUTO_DUMP_SCOPE ("middle scope", stmt);
- dump_printf_loc (MSG_NOTE, stmt, "msg 3\n");
+ AUTO_DUMP_SCOPE ("outer scope", stmt);
+ dump_printf_loc (MSG_NOTE, stmt, "msg 2\n");
{
- AUTO_DUMP_SCOPE ("inner scope", stmt);
- dump_printf_loc (MSG_NOTE, stmt, "msg 4\n");
+ AUTO_DUMP_SCOPE ("middle scope", stmt);
+ dump_printf_loc (MSG_NOTE, stmt, "msg 3\n");
+ {
+ AUTO_DUMP_SCOPE ("inner scope", stmt);
+ dump_printf_loc (MSG_NOTE, stmt, "msg 4\n");
+ dump_printf_loc (MSG_NOTE | MSG_PRIORITY_USER_FACING, stmt,
+ "explicitly user-facing msg\n");
+ }
+ dump_printf_loc (MSG_NOTE, stmt, "msg 5\n");
}
- dump_printf_loc (MSG_NOTE, stmt, "msg 5\n");
+ dump_printf_loc (MSG_NOTE, stmt, "msg 6\n");
}
- dump_printf_loc (MSG_NOTE, stmt, "msg 6\n");
- }
- dump_printf_loc (MSG_NOTE, stmt, "msg 7\n");
+ dump_printf_loc (MSG_NOTE, stmt, "msg 7\n");
- ASSERT_DUMPED_TEXT_EQ (tmp,
- "test.txt:5:10: note: msg 1\n"
- "test.txt:5:10: note: === outer scope ===\n"
- "test.txt:5:10: note: msg 2\n"
- "test.txt:5:10: note: === middle scope ===\n"
- "test.txt:5:10: note: msg 3\n"
- "test.txt:5:10: note: === inner scope ===\n"
- "test.txt:5:10: note: msg 4\n"
- "test.txt:5:10: note: msg 5\n"
- "test.txt:5:10: note: msg 6\n"
- "test.txt:5:10: note: msg 7\n");
- if (with_optinfo)
- {
- optinfo *info = tmp.get_pending_optinfo ();
- ASSERT_TRUE (info != NULL);
- ASSERT_EQ (info->num_items (), 1);
- ASSERT_IS_TEXT (info->get_item (0), "msg 7\n");
- }
- }
+ switch (dump_filter & MSG_ALL_PRIORITIES)
+ {
+ default:
+ gcc_unreachable ();
+ case 0:
+ ASSERT_DUMPED_TEXT_EQ (tmp, "");
+ break;
+ case MSG_PRIORITY_USER_FACING:
+ ASSERT_DUMPED_TEXT_EQ
+ (tmp,
+ "test.txt:5:10: note: msg 1\n"
+ "test.txt:5:10: note: explicitly user-facing msg\n"
+ "test.txt:5:10: note: msg 7\n");
+ break;
+ case MSG_PRIORITY_INTERNALS:
+ ASSERT_DUMPED_TEXT_EQ
+ (tmp,
+ "test.txt:5:10: note: explicitly internal msg\n"
+ "test.txt:5:10: note: === outer scope ===\n"
+ "test.txt:5:10: note: msg 2\n"
+ "test.txt:5:10: note: === middle scope ===\n"
+ "test.txt:5:10: note: msg 3\n"
+ "test.txt:5:10: note: === inner scope ===\n"
+ "test.txt:5:10: note: msg 4\n"
+ "test.txt:5:10: note: msg 5\n"
+ "test.txt:5:10: note: msg 6\n");
+ break;
+ case MSG_ALL_PRIORITIES:
+ ASSERT_DUMPED_TEXT_EQ
+ (tmp,
+ "test.txt:5:10: note: msg 1\n"
+ "test.txt:5:10: note: explicitly internal msg\n"
+ "test.txt:5:10: note: === outer scope ===\n"
+ "test.txt:5:10: note: msg 2\n"
+ "test.txt:5:10: note: === middle scope ===\n"
+ "test.txt:5:10: note: msg 3\n"
+ "test.txt:5:10: note: === inner scope ===\n"
+ "test.txt:5:10: note: msg 4\n"
+ "test.txt:5:10: note: explicitly user-facing msg\n"
+ "test.txt:5:10: note: msg 5\n"
+ "test.txt:5:10: note: msg 6\n"
+ "test.txt:5:10: note: msg 7\n");
+ break;
+ }
+ if (with_optinfo)
+ {
+ optinfo *info = tmp.get_pending_optinfo ();
+ ASSERT_TRUE (info != NULL);
+ ASSERT_EQ (info->num_items (), 1);
+ ASSERT_IS_TEXT (info->get_item (0), "msg 7\n");
+ }
+ }
}
/* Verify that MSG_* affects optinfo->get_kind (); we tested MSG_NOTE
@@ -2361,7 +2460,7 @@ test_capture_of_dump_calls (const line_table_case &case_)
{
/* MSG_OPTIMIZED_LOCATIONS. */
{
- temp_dump_context tmp (true, MSG_ALL);
+ temp_dump_context tmp (true, MSG_ALL_KINDS);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, "test");
ASSERT_EQ (tmp.get_pending_optinfo ()->get_kind (),
OPTINFO_KIND_SUCCESS);
@@ -2369,7 +2468,7 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* MSG_MISSED_OPTIMIZATION. */
{
- temp_dump_context tmp (true, MSG_ALL);
+ temp_dump_context tmp (true, MSG_ALL_KINDS);
dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, "test");
ASSERT_EQ (tmp.get_pending_optinfo ()->get_kind (),
OPTINFO_KIND_FAILURE);
@@ -2378,7 +2477,8 @@ test_capture_of_dump_calls (const line_table_case &case_)
/* Verify that MSG_* affect AUTO_DUMP_SCOPE and the dump calls. */
{
- temp_dump_context tmp (false, MSG_OPTIMIZED_LOCATIONS);
+ temp_dump_context tmp (false,
+ MSG_OPTIMIZED_LOCATIONS | MSG_ALL_PRIORITIES);
dump_printf_loc (MSG_NOTE, stmt, "msg 1\n");
{
AUTO_DUMP_SCOPE ("outer scope", stmt);