diff options
| author | gingerBill <bill@gingerbill.org> | 2022-08-11 13:01:54 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-08-11 13:01:54 +0100 |
| commit | 38102f14c19f83ef1e0c13a824448bab4e80877e (patch) | |
| tree | 15aa1dcfeb2a8e427bf6859f4b10848be2d19bff /src/llvm_backend_utility.cpp | |
| parent | 0997df4fcf735830ee6a03867712ce89aa4255e1 (diff) | |
Add `#load(path) or_else default` in favour of `#load_or(path, default)`
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index ce7b43321..09c45cb7a 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -351,6 +351,10 @@ lbValue lb_emit_try_has_value(lbProcedure *p, lbValue rhs) { lbValue lb_emit_or_else(lbProcedure *p, Ast *arg, Ast *else_expr, TypeAndValue const &tv) { + if (arg->state_flags & StateFlag_DirectiveWasFalse) { + return lb_build_expr(p, else_expr); + } + lbValue lhs = {}; lbValue rhs = {}; lb_emit_try_lhs_rhs(p, arg, tv, &lhs, &rhs); |