From: H.J. Lu Date: Sat, 12 Feb 2005 00:13:33 +0000 (+0000) Subject: 2005-02-11 H.J. Lu X-Git-Tag: binutils-2_16-branchpoint~308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07450571864fbcc902268dac8cfb90cfa8533289;p=platform%2Fupstream%2Fbinutils.git 2005-02-11 H.J. Lu * config/tc-ia64.c (unwind_diagnostic): Return -1 for warning and 0 for error. (in_procedure): Return -1 for warning. (in_prologue): Likewise. (in_body): Likewise. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 01eb42ae221..2a9dd66fc4c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2005-02-11 H.J. Lu + + * config/tc-ia64.c (unwind_diagnostic): Return -1 for warning + and 0 for error. + (in_procedure): Return -1 for warning. + (in_prologue): Likewise. + (in_body): Likewise. + 2005-02-11 H.J. Lu (dot_xdata): Undo the last change. Section name is used by diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index 2fb49d7d184..d65218a973e 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -3055,50 +3055,80 @@ dot_special_section (which) set_section ((char *) special_section_name[which]); } -static void +/* Return -1 for warning and 0 for error. */ + +static int unwind_diagnostic (const char * region, const char *directive) { if (md.unwind_check == unwind_check_warning) - as_warn (".%s outside of %s", directive, region); + { + as_warn (".%s outside of %s", directive, region); + return -1; + } else { as_bad (".%s outside of %s", directive, region); ignore_rest_of_line (); + return 0; } } +/* Return 1 if a directive is in a procedure, -1 if a directive isn't in + a procedure but the unwind directive check is set to warning, 0 if + a directive isn't in a procedure and the unwind directive check is set + to error. */ + static int in_procedure (const char *directive) { if (unwind.proc_start && (!unwind.saved_text_seg || strcmp (directive, "endp") == 0)) return 1; - unwind_diagnostic ("procedure", directive); - return 0; + return unwind_diagnostic ("procedure", directive); } +/* Return 1 if a directive is in a prologue, -1 if a directive isn't in + a prologue but the unwind directive check is set to warning, 0 if + a directive isn't in a prologue and the unwind directive check is set + to error. */ + static int in_prologue (const char *directive) { - if (in_procedure (directive)) + int in = in_procedure (directive); + if (in) { /* We are in a procedure. Check if we are in a prologue. */ if (unwind.prologue) return 1; - unwind_diagnostic ("prologue", directive); + /* We only want to issue one message. */ + if (in == 1) + return unwind_diagnostic ("prologue", directive); + else + return -1; } return 0; } +/* Return 1 if a directive is in a body, -1 if a directive isn't in + a body but the unwind directive check is set to warning, 0 if + a directive isn't in a body and the unwind directive check is set + to error. */ + static int in_body (const char *directive) { - if (in_procedure (directive)) + int in = in_procedure (directive); + if (in) { /* We are in a procedure. Check if we are in a body. */ if (unwind.body) return 1; - unwind_diagnostic ("body region", directive); + /* We only want to issue one message. */ + if (in == 1) + return unwind_diagnostic ("body region", directive); + else + return -1; } return 0; }