diff options
Diffstat (limited to 'src/ortho/llvm4-nodebug/ortho_llvm.adb')
-rw-r--r-- | src/ortho/llvm4-nodebug/ortho_llvm.adb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ortho/llvm4-nodebug/ortho_llvm.adb b/src/ortho/llvm4-nodebug/ortho_llvm.adb index c79fa1c62..15090e216 100644 --- a/src/ortho/llvm4-nodebug/ortho_llvm.adb +++ b/src/ortho/llvm4-nodebug/ortho_llvm.adb @@ -1541,10 +1541,13 @@ package body Ortho_LLVM is Decl : ValueRef; begin if Storage = O_Storage_Local then - Res := (Kind => ON_Local_Decl, - LLVM => BuildAlloca - (Decl_Builder, Get_LLVM_Type (Atype), Get_Cstring (Ident)), - Dtype => Atype); + if Unreach then + Decl := Null_ValueRef; + else + Decl := BuildAlloca + (Decl_Builder, Get_LLVM_Type (Atype), Get_Cstring (Ident)); + end if; + Res := (Kind => ON_Local_Decl, LLVM => Decl, Dtype => Atype); else if Storage = O_Storage_External then Decl := GetNamedGlobal (Module, Get_Cstring (Ident)); |