From 919206e884d423925170c3735421b9b5e35cd183 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 25 Jul 2018 21:37:01 +0200 Subject: llvm4: add --verify-llvm --- src/ortho/llvm4-nodebug/ortho_code_main.adb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ortho') diff --git a/src/ortho/llvm4-nodebug/ortho_code_main.adb b/src/ortho/llvm4-nodebug/ortho_code_main.adb index e09f38db5..4b36294d4 100644 --- a/src/ortho/llvm4-nodebug/ortho_code_main.adb +++ b/src/ortho/llvm4-nodebug/ortho_code_main.adb @@ -41,7 +41,10 @@ procedure Ortho_Code_Main is Output_Kind : Output_Kind_Type := Output_Object; -- True if the LLVM output must be displayed (set by '--dump-llvm') - Flag_Dump_Llvm : Boolean := False; + Flag_Dump_LLVM : Boolean := False; + + -- Verify generated LLVM code. + Flag_Verify_LLVM : Boolean := False; -- Index of the first file argument. First_File : Natural; @@ -92,7 +95,9 @@ begin begin if Arg (1) = '-' then if Arg = "--dump-llvm" then - Flag_Dump_Llvm := True; + Flag_Dump_LLVM := True; + elsif Arg = "--verify-llvm" then + Flag_Verify_LLVM := True; elsif Arg = "-o" then if Optind = Argc then Put_Line (Standard_Error, "error: missing filename to '-o'"); @@ -231,12 +236,12 @@ begin end loop; end if; - if Flag_Dump_Llvm then + if Flag_Dump_LLVM then DumpModule (Module); end if; -- Verify module. - if False then + if Flag_Verify_LLVM then if LLVM.Analysis.VerifyModule (Module, LLVM.Analysis.PrintMessageAction, Msg'Access) /= 0 then -- cgit v1.2.3