Commit graph

134 commits

Author SHA1 Message Date
kai
9ef4c8f421 Implement _d_arraycatnTX and remove _d_arraycatnT.
With this commit, the first simple applications can be linked and run!
2015-03-21 17:37:51 +01:00
Martin
b19e95df46 Fix forward-declared LL signature of function _d_eh_personality. 2015-02-26 15:51:29 +01:00
Martin
e7bfb78632 Refactor attributes system.
By introducing abstractions for attribute builder and set since they differ
greatly between LLVM 3.1-3.3.
2015-02-23 22:52:11 +01:00
Martin
f5592048e5 Get rid of obsolete TargetABI::newFunctionType() and doneWithFunctionType(). 2015-02-23 22:52:11 +01:00
Alexey Prokhin
4e2d45a409 Move irFty fields to backend ir classes 2014-10-05 16:55:22 +04:00
Alexey Prokhin
87b74363ac Fix #698 — ICE with minimal D runtime and basic extern(C) int main() function 2014-09-21 22:10:16 +04:00
Alexey Prokhin
6d5944f80b Refactoring: Synchronized is rewritten to try-finally statement. Remove it 2014-08-24 13:59:18 +04:00
Alexey Prokhin
76f3fd02bd Call _d_arraybounds for bounds checking instead of _d_array_bounds.
It expects file name as a first argument instead of pointer to Module.
2014-08-22 16:01:35 +04:00
Alexey Prokhin
50f729d415 Use _d_newarrayU instead of _d_newarrayvT 2014-08-22 16:01:34 +04: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
kai
0f6349efc6 Remove -noruntime as adverticed 2014-06-30 12:50:56 +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
038855e4a0 Deprecate -noruntime switch (which has now no function). 2013-12-12 20:02:45 +01:00
Kai Nacke
bea0b597ae Add -nogc switch.
This is a replacement for the -noruntime switch. With the new DSO implementation
every module generates runtime calls. The main motivation for the -noruntime switch
is to avoid implicit GC calls. Therefore a dedicated -nogc switch is introduced.
2013-12-10 18:33:49 +01:00
Kai Nacke
d25d28f914 Extend error message if -noruntime is used.
The name of the implicit called runtime function gives a hint about
what goes wrong.
2013-12-08 20:24:08 +01:00
Kai Nacke
bdc1f44088 Merge remote-tracking branch 'origin/master' into merge-2.064
Conflicts:
	gen/runtime.cpp
	runtime/CMakeLists.txt
2013-12-08 19:29:10 +01:00
Kai Nacke
43acc1f9c8 Check if basic types are read from object.di before usage.
If object.di was not read or is incomplete then basic types may be missing.
This results in a crash if they are used during runtime initialization.
This fixes #551.
2013-12-08 17:30:02 +01:00
Kai Nacke
a225ee934d _d_hidden_func needs a parameter.
The DMD implementation is a bit odd. A parameter is passed to the function but the function
itself is declared without a parameter. Then inline assembly is required to retrieve the
parameter.
Just do the same as gdc: declare the passed parameter.
2013-11-01 19:01:29 +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
82c202bb60 Adjust _d_assert_msg return type. 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
David Nadlinger
b052b30442 Correct signature of _d_newclass runtime call.
Fixes programs trying to directly access it (e.g. the
GtkD bindings). Not sure why this didn't come up earlier.
2013-10-24 00:27:09 +02:00
David Nadlinger
1f59740524 _d_allocclass -> "_d_newclass".
The define is a leftover from the times when we supported
both D1 and D2.
2013-10-24 00:25:36 +02:00
Alexey Prokhin
b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
David Nadlinger
3556f52b95 Fix _d_invariant mangling on MinGW/Win32.
This is getting uglier and uglier, should probably just switch back
to extern(C) irrespective of what upstream DMD does.
2013-09-15 19:57:25 +02:00
Alexey Prokhin
09c471ae74 Properly implement exception chaining 2013-06-18 17:06:00 +04:00
David Nadlinger
b15588ed15 Finally fix the _d_invariant declaration on x86. 2013-06-17 13:14:14 +02:00
David Nadlinger
e86a87ab6d Complete switch to extern(D) _d_invariant. 2013-06-17 00:03:52 +02:00
David Nadlinger
acd508945a Allow multiple declarations to share the same mangled name/LLVM global.
This is necessary to enable aliasing compiler-generated
symbols with pragma(mangle, …).

Note that globals for internal use are still directly
created.
2013-06-16 00:28:02 +02:00
David Nadlinger
bc910004a4 Adapt codegen to removal of old _d_invariant from druntime.
We should think about using symbolic constants for runtime function
names though, this is not maintainable in the long run.
2013-06-12 20:34:50 +02:00
David Nadlinger
0a376b9c71 Avoid unnecessary memset when allocating array literals.
This completes the merge of pull request #294. Thanks a lot to
Chris Holdsworth who originally wrote the patch!

GitHub: Fixes #294.
GitHub: Fixes #141.
2013-05-04 21:20:09 +02:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
8ff3a8060a Use llvm_unreachable instead of assert(0).
Also removed some unused functions.
2013-02-07 03:38:15 +01:00
kai
69d5576141 Merge branch 'master' into merge-2.061-2
Conflicts:
	gen/runtime.cpp
2013-01-28 06:58:26 +01:00
kai
145978bb51 Replace vector/SmallVector with C array for parameter lists.
This has several advantages:
- the code is shorter
- no need to specify number of elements
- only ArrayRef object is created
2013-01-27 23:12:37 +01:00
kai
a3fcdafd1f Merge branch 'master' into merge-2.061-2
Conflicts:
	gen/runtime.cpp
2013-01-27 00:20:21 +01:00
kai
ed5ede3fda Replace std::vector with llvm::SmallVector in gen/runtime.cpp.
The vector arrays for the parameter lists are a perfect fit for
llvm::SmallVector: the vector size is small and known in advance.
2013-01-26 21:01:33 +01:00
kai
bc182ab901 Merge branch 'master' into merge-2.061-2 2013-01-24 07:35:58 +01:00
kai
b4aca21422 More LLVM 3.3 changes.
There is ongoing rework on the AttributeSet class. Also the constructor
of APFloat changed.
2013-01-23 18:22:45 +01:00
David Nadlinger
30caa4bfe6 Merge branch 'master' into merge-2.061-2 2013-01-12 01:27:02 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
5c518a16ec Merged 2.061 frontend. 2013-01-04 06:22:53 +01:00
kai
5f37ae30cf LLVM 3.3: class Attributes is renamed to Attribute.
Some other renamings took place in "llvm/Attributes.h" but only this causes
compile errors in LDC.
Also uses new location of "llvm/IRBuilder.h".
2012-12-21 17:32:17 +01:00
David Nadlinger
4804cbcdbb Cleanup: Removed unused variable. 2012-12-20 03:29:06 +01:00
David Nadlinger
4118cddd1f Cleanup: GCC warning fixes. 2012-12-20 01:21:10 +01:00
David Nadlinger
ab357a41c7 Removed useless debug log messages. 2012-12-20 01:21:10 +01:00
David Nadlinger
0cd78dd579 Cleanup: Clang warning fixes.
No warnings left on a '-Wall' build except for a single tautological
compare in gen/asm-x86-32.h, which indeed seems like a bug.
2012-12-20 01:00:55 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
kai
1a06130cfa AttrListPtr is renamed to AttributeSet in LLVM 3.3. 2012-12-09 19:48:39 +01:00