From patchwork Tue May 21 16:49:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 2598281 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EAE4B3FE81 for ; Tue, 21 May 2013 16:50:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753452Ab3EUQuI (ORCPT ); Tue, 21 May 2013 12:50:08 -0400 Received: from mout.gmx.net ([212.227.15.18]:57104 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752726Ab3EUQuH (ORCPT ); Tue, 21 May 2013 12:50:07 -0400 Received: from mailout-de.gmx.net ([10.1.76.31]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0M3PbS-1UNALt0mrg-00qxZz for ; Tue, 21 May 2013 18:50:05 +0200 Received: (qmail invoked by alias); 21 May 2013 16:50:05 -0000 Received: from dslb-084-062-226-016.pools.arcor-ip.net (EHLO debian.debian) [84.62.226.16] by mail.gmx.net (mp031) with SMTP; 21 May 2013 18:50:05 +0200 X-Authenticated: #41721828 X-Provags-ID: V01U2FsdGVkX18QATgPgCIQFVyexun47V7aDMU0TT4W5Nqb1jRKqY f5+qR5xnVgt2TM From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: linux-sparse@vger.kernel.org Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Christopher Li , Pekka Enberg , Xi Wang Subject: [PATCH] lib: rename die_if_error to error_happened Date: Tue, 21 May 2013 18:49:04 +0200 Message-Id: <1369154944-11352-1-git-send-email-j.neuschaefer@gmx.net> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org The variable in question is set when an error message is output, and doesn't control termination at all, so I think the new name matches the semantics better. Cc: Christopher Li Cc: Pekka Enberg Cc: Xi Wang Signed-off-by: Jonathan Neuschäfer --- Updated version: rebase on Xi's patch "sparse, llvm: die if error". --- lib.c | 4 ++-- lib.h | 2 +- sparse-llvm.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib.c b/lib.c index 7e822eb..4ed08e0 100644 --- a/lib.c +++ b/lib.c @@ -30,7 +30,7 @@ #include "version.h" int verbose, optimize, optimize_size, preprocessing; -int die_if_error = 0; +int error_happened = 0; #ifndef __GNUC__ # define __GNUC__ 2 @@ -132,7 +132,7 @@ void warning(struct position pos, const char * fmt, ...) static void do_error(struct position pos, const char * fmt, va_list args) { static int errors = 0; - die_if_error = 1; + error_happened = 1; show_info = 1; /* Shut up warnings after an error */ max_warnings = 0; diff --git a/lib.h b/lib.h index 5ab2bd9..67c6465 100644 --- a/lib.h +++ b/lib.h @@ -25,7 +25,7 @@ #endif extern int verbose, optimize, optimize_size, preprocessing; -extern int die_if_error; +extern int error_happened; extern int repeat_phase, merge_phi_sources; extern int gcc_major, gcc_minor, gcc_patchlevel; diff --git a/sparse-llvm.c b/sparse-llvm.c index 7219290..6ab12ff 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -1147,7 +1147,7 @@ int main(int argc, char **argv) dbg_dead = 1; FOR_EACH_PTR_NOTAG(filelist, file) { symlist = sparse(file); - if (die_if_error) + if (error_happened) return 1; compile(module, symlist); } END_FOR_EACH_PTR_NOTAG(file);