From patchwork Sun Aug 19 00:50:22 2012 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: 1341811 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 39D74DF266 for ; Sun, 19 Aug 2012 00:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293Ab2HSAvG (ORCPT ); Sat, 18 Aug 2012 20:51:06 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:43342 "HELO mailout-de.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751211Ab2HSAvF (ORCPT ); Sat, 18 Aug 2012 20:51:05 -0400 Received: (qmail invoked by alias); 19 Aug 2012 00:51:03 -0000 Received: from dslb-084-060-219-034.pools.arcor-ip.net (EHLO debian.debian) [84.60.219.34] by mail.gmx.net (mp034) with SMTP; 19 Aug 2012 02:51:03 +0200 X-Authenticated: #41721828 X-Provags-ID: V01U2FsdGVkX1+uoGsMAniu1HqK8OVbN7WaTSE0KQl3KtXdM2aL9r tM0GoUJSyLLyXJ From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: linux-sparse@vger.kernel.org Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Pekka Enberg Subject: [PATCH] sparse, llvm: 'Verify' the LLVM module before writing it Date: Sun, 19 Aug 2012 02:50:22 +0200 Message-Id: <1345337422-22094-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 In later versions sparse-llvm should stop on wrong llvm code, instead of outputting it, but for now there are too many warnings being produced for this to be feasible (I think). Cc: Pekka Enberg Signed-off-by: Jonathan Neuschäfer --- sparse-llvm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sparse-llvm.c b/sparse-llvm.c index 5bcc758..e02e212 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -1253,6 +1254,8 @@ int main(int argc, char **argv) compile(module, sparse(file)); } END_FOR_EACH_PTR_NOTAG(file); + LLVMVerifyModule(module, LLVMPrintMessageAction, NULL); + LLVMWriteBitcodeToFD(module, STDOUT_FILENO, 0, 0); LLVMDisposeModule(module);