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.
- 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().
It is no longer needed now that we use DMD's model for determining
whether to emit templates. We might also be able to use the more
general tinst/minst machinery from DMD Git master if we ever need
something similar.
There is no debug information generated for several types.
As LLVM 3.4 does not support empty nodes, it is now time to
implement the missing debug info.
In Dwarf debug symbol generation the void type was modelled as
DIType(NULL). This triggers an assertion error with LLVM 3.4.
The solution is to use the unspecified type provided by Dwarf for
this purpose.