Propagate "nothrow" to LLVM IR (#1202)

Invoke nothrow callees only in try-blocks with at least 1 catch-block,
otherwise call them directly.

Errors thrown by nothrow callees can thus still be caught inside a
try-catch-statement (and this is apparently required for release builds
too).

Most calls will be direct calls though, and this small change will lead
to substantially less IR as we then skip the clean-ups after an Error.
Proper clean-up when unwinding after an Error seems not to be guaranteed
anyway. There are apparent RAII front-end optimizations for structs with
nothrow dtor - see PR #1656.
This commit is contained in:
Martin 2016-07-29 20:23:02 +02:00
parent 798cda0649
commit f4a22f232b
5 changed files with 97 additions and 5 deletions

View file

@ -14,7 +14,6 @@
#include "gen/tollvm.h"
#include "ir/irdsymbol.h"
IrFunction::IrFunction(FuncDeclaration *fd) : FMF() {
decl = fd;