diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-05-26 20:57:30 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-05-26 20:57:30 +0200 |
commit | f20bc0c2d9148bfb77c6aff1a94821334529a98e (patch) | |
tree | bd366298340d6d03a01d8fcca4eb8269009d6c6e /src/ortho/llvm-nodebug/ortho_llvm.adb | |
parent | 71caf242ed53d8de99b24e969b8d536408f5f4d2 (diff) | |
download | ghdl-f20bc0c2d9148bfb77c6aff1a94821334529a98e.tar.gz ghdl-f20bc0c2d9148bfb77c6aff1a94821334529a98e.tar.bz2 ghdl-f20bc0c2d9148bfb77c6aff1a94821334529a98e.zip |
Apply previous patch to llvm-nodebug
Diffstat (limited to 'src/ortho/llvm-nodebug/ortho_llvm.adb')
-rw-r--r-- | src/ortho/llvm-nodebug/ortho_llvm.adb | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ortho/llvm-nodebug/ortho_llvm.adb b/src/ortho/llvm-nodebug/ortho_llvm.adb index b0fdddcae..17e60af80 100644 --- a/src/ortho/llvm-nodebug/ortho_llvm.adb +++ b/src/ortho/llvm-nodebug/ortho_llvm.adb @@ -1108,11 +1108,16 @@ package body Ortho_LLVM is Idx : constant ValueRefArray (1 .. 2) := (ConstInt (Int32Type, 0, 0), Index.LLVM); + Tmp : ValueRef; begin - return O_Lnode' - (Direct => False, - LLVM => BuildGEP (Builder, Arr.LLVM, Idx, Idx'Length, Empty_Cstring), - Ltype => Arr.Ltype.Arr_El_Type); + if Unreach then + Tmp := Null_ValueRef; + else + Tmp := BuildGEP (Builder, Arr.LLVM, Idx, Idx'Length, Empty_Cstring); + end if; + return O_Lnode'(Direct => False, + LLVM => Tmp, + Ltype => Arr.Ltype.Arr_El_Type); end New_Indexed_Element; --------------- @@ -2017,10 +2022,14 @@ package body Ortho_LLVM is pragma Unreferenced (Res); begin -- FIXME: check Unreach - Label := (Bb_Entry => AppendBasicBlock (Cur_Func, Empty_Cstring), - Bb_Exit => AppendBasicBlock (Cur_Func, Empty_Cstring)); - Res := BuildBr (Builder, Label.Bb_Entry); - PositionBuilderAtEnd (Builder, Label.Bb_Entry); + if Unreach then + Label := (Null_BasicBlockRef, Null_BasicBlockRef); + else + Label := (Bb_Entry => AppendBasicBlock (Cur_Func, Empty_Cstring), + Bb_Exit => AppendBasicBlock (Cur_Func, Empty_Cstring)); + Res := BuildBr (Builder, Label.Bb_Entry); + PositionBuilderAtEnd (Builder, Label.Bb_Entry); + end if; end Start_Loop_Stmt; ---------------------- |