This is likely an LLVM bug: The code in InlineFunctions.cpp
only updates the source location metadata for the instructions
in the inlined callee when the call site has a source location
set. When the caller has no location metadata, the scope for
the inlined instructions thus still points to the DISubprogram
for the original callee. This then leads to an assertion during
codegen.
GitHub: Fixes#998.
This fixes a crash with debug info for lambdas, where DMD appends
the lambda function declaration to the wrong module.
But the comparison is supposed to be tautological anyway, as we
only ever call it from DtoDefineFunction. Furthermore, it seems as
passing false can never work unless you manually (without going
through llvm::DIBuilder) resolve the Vars node later. Clang does
not try to do this either.
The functions for all arrayops are compiler-generated but the functions
which are also defined in druntime are never emitted. This prevents
inlining of the function body and causes issue #938.
The fix is to emit the arrayops if inlining is enabled and otherwise
use the druntime provided implementations.
An alternative approach could be to always emit the arrayops and
never use the druntime version.
- the debug info is now stored in the IrFunction object
-> saves the lookup from VarDeclaration to IrVar
- uses a llvm::DenseMap instead of std::map
-> no comparison method required
-> hashing should be faster then a tree lookup
Debug info for nested local variables must be created for each
function (with different address expression). The resulting
debug info was not stored per function which resulted in the
use of the last created debug info even if it was wrong.
This commit fixes the bug and the current assertion with LLVM 3.7.
Includes all tagged with v2.067.0-b2. Does not includes latest druntime changes from ldc (head) branch.
This is known to be broken. I only merged the frontend stuff but did not try to compile something...
- Do not create debug info after we called finalize.
- Clean up debug info generation for module ctor/dtor.
- Rename EmitSubProgramInternal() to EmitModuleCTor().
- Remove unused parameter from CreateTypeDescription().