Commit 4882ad24 by Frank Ch. Eigler Committed by Frank Ch. Eigler

builtins.c (std_gimplify_va_arg_expr): Mark INDIRECT_REF nodes generated from…

builtins.c (std_gimplify_va_arg_expr): Mark INDIRECT_REF nodes generated from standard va_arg expansion.

2004-09-07  Frank Ch. Eigler  <fche@redhat.com>

	* builtins.c (std_gimplify_va_arg_expr): Mark INDIRECT_REF nodes
	generated from standard va_arg expansion.
	* tree-mudflap.c (mx_xform_derefs_1): Omit instrumentation from
	marked nodes.
	(mf_varname_tree, mf_file_function_line_tree): Add some support
	for column numbers if compiled with USE_MAPPED_LOCATION.

From-SVN: r87170
parent 06f624ba
2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* builtins.c (std_gimplify_va_arg_expr): Mark INDIRECT_REF nodes
generated from standard va_arg expansion.
* tree-mudflap.c (mx_xform_derefs_1): Omit instrumentation from
marked nodes.
(mf_varname_tree, mf_file_function_line_tree): Add some support
for column numbers if compiled with USE_MAPPED_LOCATION.
2004-09-07 Ziemowit Laski <zlaski@apple.com> 2004-09-07 Ziemowit Laski <zlaski@apple.com>
* c-decl.c (groktypename_in_parm_context): Remove function. * c-decl.c (groktypename_in_parm_context): Remove function.
......
...@@ -4349,9 +4349,17 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) ...@@ -4349,9 +4349,17 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
addr = fold_convert (build_pointer_type (type), addr); addr = fold_convert (build_pointer_type (type), addr);
if (indirect) if (indirect)
{
addr = build_fold_indirect_ref (addr);
if (flag_mudflap) /* Don't instrument va_arg INDIRECT_REF. */
mf_mark (addr);
}
addr = build_fold_indirect_ref (addr); addr = build_fold_indirect_ref (addr);
if (flag_mudflap) /* Don't instrument va_arg INDIRECT_REF. */
mf_mark (addr);
return build_fold_indirect_ref (addr); return addr;
} }
/* Return a dummy expression of type TYPE in order to keep going after an /* Return a dummy expression of type TYPE in order to keep going after an
......
...@@ -112,12 +112,15 @@ mf_varname_tree (tree decl) ...@@ -112,12 +112,15 @@ mf_varname_tree (tree decl)
} }
pp_clear_output_area (buf); pp_clear_output_area (buf);
/* Add FILENAME[:LINENUMBER]. */ /* Add FILENAME[:LINENUMBER[:COLUMNNUMBER]]. */
{ {
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (decl)); expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (decl));
const char *sourcefile; const char *sourcefile;
unsigned sourceline = xloc.line; unsigned sourceline = xloc.line;
unsigned sourcecolumn = 0;
#ifdef USE_MAPPED_LOCATION
sourcecolumn = xloc.column;
#endif
sourcefile = xloc.file; sourcefile = xloc.file;
if (sourcefile == NULL && current_function_decl != NULL_TREE) if (sourcefile == NULL && current_function_decl != NULL_TREE)
sourcefile = DECL_SOURCE_FILE (current_function_decl); sourcefile = DECL_SOURCE_FILE (current_function_decl);
...@@ -130,12 +133,18 @@ mf_varname_tree (tree decl) ...@@ -130,12 +133,18 @@ mf_varname_tree (tree decl)
{ {
pp_string (buf, ":"); pp_string (buf, ":");
pp_decimal_int (buf, sourceline); pp_decimal_int (buf, sourceline);
if (sourcecolumn != 0)
{
pp_string (buf, ":");
pp_decimal_int (buf, sourcecolumn);
}
} }
} }
if (current_function_decl != NULL_TREE) if (current_function_decl != NULL_TREE)
{ {
/* Add (FUNCTION): */ /* Add (FUNCTION) */
pp_string (buf, " ("); pp_string (buf, " (");
{ {
const char *funcname = NULL; const char *funcname = NULL;
...@@ -189,11 +198,11 @@ mf_file_function_line_tree (location_t location) ...@@ -189,11 +198,11 @@ mf_file_function_line_tree (location_t location)
{ {
expanded_location xloc = expand_location (location); expanded_location xloc = expand_location (location);
const char *file = NULL, *colon, *line, *op, *name, *cp; const char *file = NULL, *colon, *line, *op, *name, *cp;
char linebuf[18]; char linecolbuf[30]; /* Enough for two decimal numbers plus a colon. */
char *string; char *string;
tree result; tree result;
/* Add FILENAME[:LINENUMBER]. */ /* Add FILENAME[:LINENUMBER[:COLUMNNUMBER]]. */
file = xloc.file; file = xloc.file;
if (file == NULL && current_function_decl != NULL_TREE) if (file == NULL && current_function_decl != NULL_TREE)
file = DECL_SOURCE_FILE (current_function_decl); file = DECL_SOURCE_FILE (current_function_decl);
...@@ -202,9 +211,14 @@ mf_file_function_line_tree (location_t location) ...@@ -202,9 +211,14 @@ mf_file_function_line_tree (location_t location)
if (xloc.line > 0) if (xloc.line > 0)
{ {
sprintf (linebuf, "%d", xloc.line); #ifdef USE_MAPPED_LOCATION
if (xloc.column > 0)
sprintf (linecolbuf, "%d:%d", xloc.line, xloc.column);
else
#endif
sprintf (linecolbuf, "%d", xloc.line);
colon = ":"; colon = ":";
line = linebuf; line = linecolbuf;
} }
else else
colon = line = ""; colon = line = "";
...@@ -676,6 +690,10 @@ mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp, ...@@ -676,6 +690,10 @@ mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp,
if (dirflag == integer_zero_node && flag_mudflap_ignore_reads) if (dirflag == integer_zero_node && flag_mudflap_ignore_reads)
return; return;
/* Don't instrument marked nodes. */
if (mf_marked_p (*tp))
return;
t = *tp; t = *tp;
type = TREE_TYPE (t); type = TREE_TYPE (t);
size = TYPE_SIZE_UNIT (type); size = TYPE_SIZE_UNIT (type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment