summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ortho/llvm/ortho_llvm.adb14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ortho/llvm/ortho_llvm.adb b/src/ortho/llvm/ortho_llvm.adb
index db78bd6..ed11b5f 100644
--- a/src/ortho/llvm/ortho_llvm.adb
+++ b/src/ortho/llvm/ortho_llvm.adb
@@ -2492,11 +2492,15 @@ package body Ortho_LLVM is
Res : ValueRef;
Old_Vals : ValueRefArray_Acc;
begin
- Res := BuildCall (Builder, Assocs.Subprg.LLVM,
- Assocs.Vals.all, Assocs.Vals'Last, Empty_Cstring);
- Old_Vals := Assocs.Vals;
- Free (Old_Vals);
- Set_Insn_Dbg (Res);
+ if not Unreach then
+ Res := BuildCall (Builder, Assocs.Subprg.LLVM,
+ Assocs.Vals.all, Assocs.Vals'Last, Empty_Cstring);
+ Old_Vals := Assocs.Vals;
+ Free (Old_Vals);
+ Set_Insn_Dbg (Res);
+ else
+ Res := Null_ValueRef;
+ end if;
return O_Enode'(LLVM => Res, Etype => Assocs.Subprg.Dtype);
end New_Function_Call;