Not all type declarations yet (e.g., some TypeInfo subtypes are still
accessed directly), but those already wrapped as LazyType in the
gen/runtime.cpp module (with check and proper error msg in case object.d
doesn't contain a required declaration).
This fixes issue #2450 for primitive data types, i.e., performs the
rvalue load from lvalues (passed by value) right after evaluating the
argument expression. Previously, all expressions were evaluated in a
dedicated prior pass, so side effects in later argument expressions were
incorrectly visible.
Arguments rewritten by the TargetABI are rewritten immediately too now,
so I guess most of them are fine.
Lvalues passed with the byval attribute still need to be fixed
(dedicated alloca+memcpy).
Tie the state to an LLVM module/object file instead of having a global
one. And finalize it once per LLVM module instead of once per D module
(previously, as part of ModuleInfo generation).
Fixes issue #2388.
* Remove default label in switch which covers all enumeration values.
This fixes the warning "default label in switch which covers all enumeration values". We will already get a warning when _not_ all enumeration values are covered.
This is the last warning left on OSX/Clang, so with this change, we can build with -Werror.
* Fix warning: enumeral and non-enumeral type in conditional expression
* Fix warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 5
* "fallthrough" is recognized by the compiler warning system
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.
Previously, the transitory state only needed and valid during
generation of the LLVM IR for the function body was conflated
with the general codegen metadata for the function declaration
in IrFunction.
There is further potential for cleanup regarding the use of
gIR->func() and so on all over the code base, but this is out
of scope of this commit, which is only concerned with those
IrFunction members moved to FuncGenState.
GitHub: Fixes#1661.
Use the existing public field directly instead.
It's shorter and different than LLValue's getType() (making it easier
to discriminate DValues and LLValues for experienced LDC devs imho).
Allow ABIRewrites to return the D parameter's LL value directly.
Most rewrites store to memory anyway, so let the D parameter point
directly to that memory instead of a dedicated alloca bitcopy.