[PATCH] sparse, llvm: 'Verify' the LLVM module before writing it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <penberg@xxxxxxxxxx>
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
---
 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 <llvm-c/Core.h>
 #include <llvm-c/BitWriter.h>
+#include <llvm-c/Analysis.h>
 
 #include <stdbool.h>
 #include <stdio.h>
@@ -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);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux