aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm4-nodebug
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-07-25 21:37:01 +0200
committerTristan Gingold <tgingold@free.fr>2018-07-25 21:37:01 +0200
commit919206e884d423925170c3735421b9b5e35cd183 (patch)
tree8352191ad270b5155c704da9d8f8ebce2a5bdb7d /src/ortho/llvm4-nodebug
parent8bef75cef3035ce2b935999b2bbfb939f8cb0c4e (diff)
downloadghdl-919206e884d423925170c3735421b9b5e35cd183.tar.gz
ghdl-919206e884d423925170c3735421b9b5e35cd183.tar.bz2
ghdl-919206e884d423925170c3735421b9b5e35cd183.zip
llvm4: add --verify-llvm
Diffstat (limited to 'src/ortho/llvm4-nodebug')
-rw-r--r--src/ortho/llvm4-nodebug/ortho_code_main.adb13
1 files changed, 9 insertions, 4 deletions
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