Static arrays of classes, pointers to class (and perhaps global class variables) ended up with a wrong DIType because of wrong CreateTypeDescription() calls for class types.
Ex.: Array!FuncDeclaration caused an infinite recursion crash in GDB, because for its « FuncDeclaration[SMALLARRAYCAP] smallarray » field DIBuilder::CreateSArrayType() had DIBuilder return a value type instead of a reference type for FuncDeclaration.
The part needing most attention was ddmd.root.ctfloat, ddmd.target (incl.
gen/target.cpp) and ddmd.builtin. The front-end is now prepared for
elaborate compile-time floating-point types to allow for proper cross-
compilation.
This version still uses the host's `real` type for compile-time reals,
except for MSVC hosts, which still use 64-bit doubles (when compiled with
DMD host compiler too).
Some other changes:
* semantic*() of Statements extracted from statement.d to statementsem.d
* mangle() -> mangleToBuffer()
* Identifier::string -> toChars()
* Token::float80value => floatvalue
* Dsymbol::isAggregateMember() => isMember()
* BoolExp is no more
* ddmd.root.ctfloat: LDC-specific CTFE builtins
For nested variables. Resolves issue #1933 at the expense of a debuginfo
regression wrt. captured this pointer, see PR #1963.
Also add DWARF deref for non-ref/out variables captured by reference.
Introduce a hidden `-dwarf-version=<uint>` switch to support old gdb versions
used by Travis. Older versions only supporting DWARF-2 and/or not supporting
TLS correctly are detected in dmd-testsuite's CMakefile.
- byte,ubyte should be encoded as DW_ATE_signed_char/DW_ATE_unsigned_char, not DW_ATE_signed/DW_ATE_unsigned
- encode wchar,dchar as UTF
- do not declare struct/class definitions as FlagFwdDecl
- pass deco as unique identifier to UDTs
- dynamic arrays: use type name, don't leave it empty
- use proper type name for delegates
- add support for type "void" and "typeof(null)"
- Fix the value of closure variables in the parent function. Previously the passed value was the GEP instruction into .frame, and that instruction corresponds to a register so resulted in "DWARF-2 expression error: DW_OP_reg operations must be used either alone(...)" (also the address was incorrect anyway because the offset would get doubled by 'addr')
- When emitting debug info for a parent function parameter that is accessed from a nested function, call DIBuilder.createAutoVariable instead of createParameterVariable. Two different variables for the same parameter index was triggering an assert in llvm::DbgVariable::addMMIEntry. This fixes the compilation of druntime and phobos when building against LLVM 3.8.
Also adds the CMake infrastructure to compile and link the D source files.
The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals