Commit graph

233 commits

Author SHA1 Message Date
kinke
20084000b0 Merge pull request #2142 from kinke/archiver
Integrate LLD for MSVC targets; prepare for other targets
2017-06-04 04:02:22 +02:00
Martin
383c2d3a59 Range-ify usages of front-end Arrays 2017-06-04 00:29:44 +02:00
Elie Morisse
caa515a69b For classes DIBuilder::CreateCompositeType was producing DIType with wrong sizes.
Resulting in incorrect values in GDB.
2017-05-21 21:41:29 -03:00
Elie Morisse
3338bbf9c0 DIType for types involving classes were incorrect in some cases.
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.
2017-05-21 21:41:25 -03:00
Johan Engelen
d61452c6a8 Add internal global option to enable outputting of source line info 2017-05-03 00:10:52 +02:00
Johan Engelen
c2b539c348 Fix LLVM 5.0 compilation 2017-03-14 23:45:56 +01:00
Martin
dca21939e1 Merge 2.072.2 front-end
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
2017-01-29 15:48:03 +01:00
kinke
89e5d27415 Put debuginfo on GEP instead of on the alloca with an offset. (#1984)
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.
2017-01-25 00:36:00 +01:00
Ivan Butygin
a26bfc1223 Refactor code to hide direct IrFunction->func usage and add convenient functions (#1911) 2017-01-17 22:40:32 +01:00
Johan Engelen
5e9914ad29 Fix LLVM trunk build. (#1936) 2016-12-22 17:59:03 +01:00
Remi Thebault
3b63effd3f Implement -gline-tables-only (PR #1861)
As per ldc-developers/ldc#1844 .
2016-11-12 20:16:41 +01:00
Rainer Schuetze
08e1c496dc fix build against current LLVM master @ 9b4e8286785f538e73d2e3eaa96f88c3d98b9960 2016-10-27 08:08:19 +02:00
Martin
6b6cafcd60 Win64 workaround: Emit slice and vector params as DI locals
This works for both cdb/Windbg and Visual Studio debuggers, otherwise the
DI values are garbage in both debuggers too.
2016-10-10 20:36:17 +02:00
Martin
8be1e3e719 Adapt emission of debuginfos for parameters
Emit all parameters (except for captured ones) as DI parameters.
2016-10-09 20:17:39 +02:00
kinke
4e5c9616e3 Merge pull request #1804 from rainers/cv10
CodeView: arguments passed by reference not shown
2016-10-08 23:00:43 +02:00
David Nadlinger
ba180bbde2 Merge pull request #1813 from rainers/cv11
DI: display typeof(null) as void*
2016-10-08 11:37:10 +01:00
Rainer Schuetze
9d1637f410 DI: display typeof(null) as void* 2016-10-08 10:03:07 +02:00
Nicholas Wilson
45a4f64ac1 [NFC] Refactor debuginfo emission check. (#1797) 2016-10-07 15:14:19 +02:00
Rainer Schuetze
4635446bd8 CodeView: arguments passed by reference not shown because of wrong size 2016-10-07 09:41:32 +02:00
Rainer Schuetze
3ed8f25ae2 Debuginfo: try harder to find a suitable filename is location is empty 2016-10-06 00:18:38 +02:00
Rainer Schuetze
5bcfb49b1b Enable gdb tests in dmd-testsuite (#1784)
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.
2016-09-27 01:26:15 +02:00
Rainer Schuetze
fd80d5eada Merge pull request #1768 from rainers/cv6
CodeView: fix vector types void16 and void32
2016-09-25 10:42:21 +02:00
Rainer Schuetze
767f8614ca Debug info: fix vector types void16 and void32 2016-09-25 09:14:52 +02:00
Rainer Schuetze
2dec29b825 CodeView: fix display of dynamic array arguments (#1761) 2016-09-24 21:06:58 +02:00
Rainer Schuetze
daa404d523 Debuginfo: use inheritance information for base classes instead of listing base class members in derived classes 2016-09-23 08:37:41 +02:00
Johan Engelen
807e94011d Fix unused var warning.
(I chose this over `(void)...`.)
2016-09-15 21:07:28 +02:00
Johan Engelen
a561b6a496 Fix LLVM 4.0 build, there was another debuginfo change. 2016-09-14 11:07:58 +02:00
Johan Engelen
b71e8ee439 The type of DIFlag parameters changed from unsigned to DIFlags in LLVM 4.0. 2016-09-13 10:50:00 +02:00
Rainer Schuetze
c8eb07d720 CodeView: add support for imaginary and complex types 2016-09-02 09:18:06 +02:00
Rainer Schuetze
36dec7389d * DebugInfo fixes:
- 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)"
2016-08-30 08:17:39 +02:00
Martin
29152f5b94 Refactor DIBuilder
Incl. some subtle changes/fixes.
2016-07-22 22:34:31 +02:00
Martin
c9cb63fb54 Misc. debuginfo fixes
As LLVM's CodeView component now uses additional asserts, e.g.,
to make sure the size of a static array equals N * elementSize.
2016-07-22 15:01:55 +02:00
Elie Morisse
302d71a9de MSVC: Attach !dbg info to _d_eh_enter_catch, _d_enter_cleanup and _d_leave_cleanup calls. 2016-07-03 16:46:51 -03:00
Elie Morisse
7ac1216292 Nested variables debug info fixes.
- 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.
2016-06-30 14:13:51 -03:00
Elie Morisse
c3ee617d8a Fix LLVM >=3.8 debug info by assigning DISubprograms to their corresponding function. 2016-06-30 14:13:13 -03:00
Martin
6a6f6be2e3 MSVC: Don't truncate debug info names anymore
Newest LLVM takes care of this for us.
2016-03-16 19:45:35 +01:00
Rainer Schuetze
1131e6fc24 fix function name mangling for debug info 2016-03-13 17:31:22 +01:00
Rainer Schuetze
6f3adaea46 add debug info to thunks as a workaround for https://llvm.org/bugs/show_bug.cgi?id=26833 2016-03-13 17:29:44 +01:00
Martin
5ba7ce9b1d MSVC: Limit debug info display names to ~64k
A limitation of the MS linker/COFF format and enforced by LLVM.
Fixes issue #930.
2016-03-12 16:30:49 +01:00
Johan Engelen
2898ce340d Fix bug introduced by f626a3f340 2016-02-14 18:06:33 +01:00
Johan Engelen
f626a3f340 Fix for dmd-testsuite/compilable/ice13792.d: compilation with -gc of fwd declared enum (opaque enum type). 2016-02-14 17:35:09 +01:00
Johan Engelen
acdcc4a8c1 Merge branch 'master' into merge-2.069 2016-02-13 20:12:17 +01:00
Johan Engelen
29ce4012af dmd2 --> ddmd. Merge (almost all of) our changes to dmd source into the new D source of dmd 2.069.2.
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
2016-01-28 19:03:58 +01:00
Rainer Schuetze
f94c34ea33 The size of the alloca must match the size described by debug info. 2016-01-22 16:07:38 +01:00
Johan Engelen
4399271762 Fix a few compiler warnings. 2015-12-22 12:36:28 +01:00
Martin
71912511a5 Adaptations for recent LLVM 3.8 master changes 2015-11-08 14:06:16 +01:00
David Nadlinger
0d53ca7aea dibuilder: Reduce number of version conditions that cut statements
The code ends up being a bit longer, but imho much more readable.
2015-11-03 11:21:35 +02:00
David Nadlinger
05d45350aa clang-tidy: Add readability-else-after-return 2015-11-02 11:30:40 +02:00
David Nadlinger
9df487edff gen/ir: clang-tidy the world 2015-11-02 11:30:40 +02:00
David Nadlinger
44b0f7b615 driver/gen/ir: clang-format the world
This uses the LLVM style, which makes sense for sharing code
with other LLVM projects. The DMD code we use will soon all
be in D anyway.
2015-11-02 00:28:01 +02:00