Commit graph

75 commits

Author SHA1 Message Date
Kai Nacke
92c4361f2e LLVM 3.7: Mote GEP-related changes 2015-04-09 22:53:20 +02:00
Johan Engelen
505f18ca2a Add coverage analysis ("-cov=...") to ldc2 2015-04-07 22:11:02 +02:00
kai
908815256f LLVM 3.7: Explicit string conversion required for DataLayout. 2015-03-06 22:08:08 +01:00
kai
e73a7f2e23 Several updates to debug info generation.
- 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().
2015-02-22 21:10:28 +01:00
kai
441c98532c Add changes related to the llvm::Metadata refactoring in LLVM 3.6.
In LLVM 3.6, the llvm::Metadata hierarchy is distinct from the llvm::Value hierarchy.
This refactoring causes several changes.
2014-12-25 19:02:15 +01:00
David Nadlinger
e4aa92deb3 Get rid of more superfluous casts with DMD arrays.
There are still a few more left.
2014-11-16 08:00:17 +01:00
kai
37349a7fb4 First set of changes to compile LDC on AIX 7.1. 2014-11-16 05:55:50 +01:00
Kai Nacke
fce5f432b9 Allow overriding of header files.
This is the same behavior as DMD.
2014-10-25 18:05:28 +02:00
Alexey Prokhin
66a392a5c2 Rename Type::irtype to ctype for consistency with dmd and gdc 2014-10-05 16:55:12 +04:00
Kai Nacke
382ad184d8 Merge branch 'master' into merge-2.066
Conflicts:
	dmd2/builtin.c
	gen/classes.cpp
	gen/functions.cpp
	gen/llvmhelpers.cpp
	gen/statements.cpp
	gen/toir.cpp
	runtime/druntime
	runtime/phobos
2014-09-13 23:11:54 +02:00
Alexey Prokhin
18f33b1815 Make IrDsymbol to be a typesafe union to reduce memory usage 2014-09-12 14:43:49 +04:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
kai
f4e2d8486b Fix a typo in variable name 2014-07-14 06:47:42 +02:00
kai
bdd346c3ae Change type of ldc.dso_initialized to i8.
Also being only a flag, it is safer to use the i8 type and compare against 0.
This adds only an icmp instruction to the IR and should not change the generated machine code.
2014-07-14 06:47:39 +02:00
David Nadlinger
314c052f27 Fix broken merge. 2014-07-11 18:28:50 +02:00
David Nadlinger
3503206ccc Do not try to verify/emit LLVM module on codegen error. 2014-07-11 18:11:16 +02:00
David Nadlinger
04570399d4 Implement previously inoperative pragma(LDC_no_moduleinfo).
GitHub: Fixes #571.
2014-07-10 01:20:31 +02:00
kai
45fca1f3b5 Add line number to error message of -nogc switch.
This was suggested by bearophile in the news group.
It also changes all Loc objects to be passed by reference.
2014-07-04 07:15:05 +02:00
David Nadlinger
d8a7ae1841 Use --gc-sections on Linux.
This was painful.
2014-06-30 16:18:15 +02:00
David Nadlinger
2e80741d5e Remove unused 'seenTemplateInstances' mechanism. 2014-06-30 15:28:16 +02:00
David Nadlinger
b0ff0de9c1 Make function entry basic blocks unnamed.
The performance impact should be completely immeasurable,
but the main benefit is that this makes IR dumps slightly
nicer to look at (as the redundant "empty:" labels are
now omitted entirely).
2014-06-29 16:47:44 +02:00
kai
2b6dbb03f4 Add IF_LOG to more logging statements.
Evaluating arguments which call toChars() or toPrettyChars() are much more expensive then checking Logger::enabled().
2014-06-26 06:54:38 +02:00
Kai Nacke
fb18a7ab82 Merge branch 'merge-2.064' into merge-2.065 2014-05-13 06:56:23 +02:00
Kai Nacke
ec63589a36 Remove some casts. 2014-05-10 22:55:23 +02:00
Kai Nacke
92c06dede0 Merge branch 'merge-2.064' into merge-2.065
Conflicts:
	runtime/druntime
2014-05-10 21:38:37 +02:00
kai
a56be4af43 Fix compile errors on OpenIndiana (OpenSolaris) 2014-04-08 17:50:00 +02:00
kai
456924116b Merge branch 'merge-2.064' into merge-2.065 2014-04-05 22:37:27 +02:00
Kai Nacke
ecbd01a2fa Merge branch 'master' into merge-2.064 2014-04-05 22:23:36 +02:00
Kai Nacke
3a77228b69 Fix unresolved reference with shared libldc.so 2014-04-05 22:22:05 +02:00
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
Kai Nacke
d6b4000f8c Merge remote-tracking branch 'origin/master' into merge-2.064 2014-01-26 00:01:38 +01:00
Kai Nacke
704ab30001 Emit ldc version as llvm.ident metadata. 2014-01-26 00:00:21 +01:00
Kai Nacke
c193a3b4c8 Merge branch 'master' into merge-2.064 2014-01-13 18:17:51 +01:00
Kai Nacke
87afa717ae Fix more files for LLVM 3.5. 2014-01-13 18:16:22 +01:00
Kai Nacke
61720bf1ba Fix ouput for test diag8354 2014-01-03 18:02:29 +01:00
Kai Nacke
e7fdbafe2d Fix generation of position-independent code.
The new module discovery scheme requires the following section order:

.minfo_beg
.minfo
.minfo_end

This works for non-PIC code because the segments have the same attributes.
However, if -relocation-model=pic is passed to ldc2 then the .minfo section
becomes writeable and the sequence of sections is changed.

The quick fix is to mark the data always as writeable. Then all sections are
always writeable.

I think a better solution would be to base this in the used relocation model.
But this information is currently only available in the driver.

This fixes the failure in test case runnable/eh2.d
2013-12-18 16:54:49 +01:00
Kai Nacke
87965cdc19 Merge branch 'master' into merge-2.064
Conflicts:
	runtime/druntime
2013-11-26 08:00:10 +01:00
Kai Nacke
7f017608a8 Use enum literal instead of constant 2013-11-26 07:56:50 +01:00
David Nadlinger
d9b137bb45 Implement new ModuleInfo discovery/druntime startup scheme on Linux.
This is the same implementation that is used for DMD and
supports shared libraries (not yet tested).
2013-10-29 19:21:15 +01:00
David Nadlinger
cb341586e3 First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
2013-10-29 19:21:15 +01:00
Kai Nacke
90d0f6c12a Merge pull request #429 from redstar/moduleflags
Implement pragma(lib) on Windows using module metadata.
2013-10-14 00:26:17 -07:00
kai
4f7bc678fb Implement pragma(lib) using module metadata.
Since LLVM 3.3 pragma(lib) can be implemented like DMD does.
2013-10-13 20:35:34 +02:00
David Nadlinger
1242be25d0 Remove unused, empty Ir type.
The codegen parameter was changed to IRState instead of
removing it to set the stage for an eventual eradication
of the gIR global.
2013-10-13 19:44:29 +02:00
David Nadlinger
787c147986 Use Module::members -> Dsymbol::codegen to define symbols.
This commit fundamentally changes the way symbol emission in
LDC works: Previously, whenever a declaration was used in some
way, the compiler would check whether it actually needs to be
defined in the currently processed module, based only on the
symbol itself. This lack of contextual information proved to
be a major problem in correctly handling emission of templates
(see e.g. #454).

Now, the DtoResolve…() family of functions and similar only
ever declare the symbols, and definition is handled by doing
a single pass over Module::members for the root module. This
is the same strategy that DMD uses as well, which should
also reduce the maintainance burden down the road (which is
important as during the last few releases, there was pretty
much always a symbol emission related problem slowing us
down).

Our old approach might have been a bit better tuned w.r.t.
avoiding emission of unneeded template instances, but 2.064
will bring improvements here (DMD: FuncDeclaration::toObjFile).
Barring such issues, the change shoud also marginally improve
compile times because of declarations no longer being emitted
when they are not needed.

In the future, we should also consider refactoring the code
so that it no longer directly accesses Dsymbol::ir but uses
wrapper functions that ensure that the appropriate
DtoResolve…() function has been called.

GitHub: Fixes #454.
2013-10-13 19:18:24 +02:00
Kai Nacke
07cb4cca0d Merge pull request #434 from AlexeyProkhin/minimize-dmd-diff
Minimize dmd diff
2013-07-30 22:39:10 -07:00
kai
c28c7fb134 Introduce a debug info builder.
Moves all code from todebug into a new class.
Also caches the compilation unit in order to fix a LLVM 3.4 compile error.
2013-07-29 00:04:08 +02:00
Alexey Prokhin
21b07c783a Remove Module::moduleInfoType 2013-07-28 21:59:01 +04:00
Alexey Prokhin
69e7907875 Move implementation of Module::buildTargetFiles and Module::buildFilePath to gem/module.cpp 2013-07-28 21:17:25 +04:00
David Nadlinger
1215ffacd3 Complete IrStruct->IrAggr rename. 2013-06-17 13:14:15 +02:00
David Nadlinger
1d9804d03c Use '__ModuleInfoZ' for ModuleInfos, like DMD does.
This way, we stay at least compatible w.r.t. demanglers,
pragma(mangle, …) tricks.

Fixes DMD testcase 'mangle'.
2013-06-16 00:28:02 +02:00