Commit Graph
436 Commits
Author SHA1 Message Date
Alexey Prokhin b819975c84 Eliminate the need for TypeFunction::funcdecl 2013-10-05 19:03:03 +04:00
David Nadlinger f35176efad Fix SymOffExp::toConstElem.
I am surprised and horrified at the same time that the test suite
(on platforms other than Windows, where the code path is triggered
in core.stdc.stdio) did not catch this at all.

The elemSize-dependent path probably doesn't make too much sense for
global variables, as it always refers to the total size of the global.
Should add a special case for arrays for clearer codegen in those cases.

GitHub: Fixes #477.
2013-09-21 18:53:26 +02:00
David Nadlinger b17a6421a4 Merge pull request #475 from klickverbot/assert-release-trap
Emit trap for assert(0) in release mode.
2013-09-15 23:46:26 -07:00
David Nadlinger 945f4882c2 Emit trap for assert(0) in release mode. 2013-09-15 23:53:52 +02: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
David Nadlinger 90127ab87a Fix broken indentation in debug log output. 2013-09-12 10:21:01 +02:00
kai 6875d8a20f Mark frontend generated strings with attribute unnamed_addr.
This is part of a fix for issue #133.
2013-08-18 23:34:41 +02:00
kai f769406216 Fix for issue #119.
Instead of creating individual stores to the array elements an constant
array is created and assigned to the destination memory. This is much
less IR than before. With -O it is optimized to a memset.
2013-08-18 19:36:58 +02: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 8b783da523 Fixed cases where the destructor is called on an uninitialized temporary 2013-07-10 18:15:05 +04:00
Alexey Prokhin 1999749415 Issue #426 part 2. Generate a try-finally block only if it is required
(i.e. there are actually some destructor calls that are needed to be put into finally)
2013-07-10 13:34:52 +04:00
Alexey Prokhin 71023952d4 Issue #426 part 1. Wrap destructor calls of temporary variables in a try/finally expression. 2013-07-10 13:34:52 +04:00
Kai Nacke ebadc7fcb3 Merge pull request #412 from AlexeyProkhin/cpp
extern(C++) interfaces
2013-06-30 15:37:10 -07:00
kai 67a9391f79 Replace an old-style cast. 2013-06-30 22:30:13 +02:00
Alexey Prokhin 90bb32d2d8 extern(C++) interfaces 2013-06-22 17:33:00 +04:00
David Nadlinger 235bb94878 Make -release only disable bounds checking in non-@safe code. 2013-06-17 13:31:21 +02:00
David Nadlinger 1215ffacd3 Complete IrStruct->IrAggr rename. 2013-06-17 13:14:15 +02:00
David Nadlinger 897c4382af Do not re-codegen struct literals on taking address of globals.
The AST the frontend generates is arguably invalid, but we
have to deal with that.

Fixes DMD testcase 'interpret'.
2013-06-16 01:02:46 +02:00
David Nadlinger 2e0941c194 Add names for globals to make LDC compile against LLVM 3.1. 2013-06-15 16:16:47 +02:00
David Nadlinger c813ccdcf7 Small debug diagnostics improvements. 2013-06-15 15:04:48 +02:00
David Nadlinger bca5dac669 Fixed ClassReferenceExp codegen, handle self-referential literals. 2013-06-15 15:04:48 +02:00
David Nadlinger 041e8e8b54 Remove LDC-specific .classinfo AST rewrite.
Apart from reducing the diff to upstream DMD, this also fixes a
"cannot interpret" CTFE issue.
2013-06-14 21:49:44 +02:00
David Nadlinger 9dc387aa91 Do not invoke postblit twice on struct literal creation.
The frontend seems to explicitly insert __cpctor now.

Fixes DMD testcase 'sdtor'.
2013-06-14 16:43:41 +02:00
David Nadlinger 4901877d24 Handle side-effects in TupleExp::e0.
Fixes DMD testcase 'aliasthis'.
2013-06-14 15:03:24 +02:00
David Nadlinger 83415eeeb8 Minor debug log fixes. 2013-06-14 15:03:24 +02:00
David Nadlinger c64c4f479a Handle static array typed SliceExps.
Fixes DMD testcase 'testbounds2'.
2013-06-13 18:45:07 +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 4c788699ae Initial, incomplete ClassReferenceExp::toConstElem implementation.
Allows us to get through a Phobos build without errors.
2013-06-12 20:23:27 +02:00
David Nadlinger a9e620d428 Work around invalid special ref var initializations in 2.063. 2013-06-12 20:16:37 +02:00
David Nadlinger 292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
David Nadlinger 9a016a1002 Refactor struct initializers codegen.
This not only reduces code duplication, but the unification
also enables code a la StructLiteralExp to handle classes
(for CTFE class constant support in 2.063).
2013-06-12 20:16:05 +02:00
David Nadlinger 5dadec2e70 Remove raw address from log output.
Makes comparing logs harder.
2013-06-12 17:16:46 +02:00
David Nadlinger 28f39cbdad Remove superfluous Expression::toConstElem overrides.
The error message can be printed by the non-overridden
Expression::toConstElem just as well.
2013-06-12 17:16:31 +02:00
David Nadlinger 978c2c1b6a Re-enable SymOffExp and remove associated LLVM-only modifications. 2013-06-11 00:40:48 +02:00
David Nadlinger f5e276d6a6 Revert meaning of AddExp/MinExp for pointers to DMD default.
It might be worth considering to move the stride multiplication
down to the glue layer in the upstream sources. But assigning a
different meaning to AST nodes was a giant maintenance
liability, especially with regard to CTFE.
2013-06-10 22:49:01 +02:00
David Nadlinger 049f784e5f Remove extra semicolons after macro invocation.
Silences some Clang warnings.
2013-06-10 19:54:19 +02:00
David Nadlinger bf0e03df98 Also avoid i1 in TupleExp::toElem. 2013-06-10 19:49:52 +02:00
David Nadlinger 848dee32d4 Store bools as i8.
I really hope we can refactor this to use a less leaky
abstraction later – it should at least be possible to merge
voidToI8 and i1ToI8.
2013-06-07 03:20:54 +02:00
David Nadlinger 1fed92b9b7 VarExp::toElem refactoring and global size assertion.
Frontend errors shouldn't be used for glue layer consistency
checks – maybe the error was actually hit in ancient versions.
2013-05-19 20:25:16 +02:00
David Nadlinger 7b435c2c87 Unify handling of struct initializers.
GitHub: Fixes #351.
2013-05-18 19:51:37 +02:00
David Nadlinger b577d1cf0b Handle different element initializer types in array literals. 2013-05-18 16:46:57 +02:00
David Nadlinger e1501c712f Moved constant array creation helper to llvmhelpers.h. 2013-05-12 01:25:12 +02:00
kai 7d65a311b1 More changes to std::vector usage.
Replace with std::vector with static array, llvm::SmallVector or
add code to reserve space.
2013-03-17 23:58:30 +01:00
David Nadlinger c8a54de074 Merge Kai's D1 removal commits. 2013-03-06 16:41:29 +01:00
kai c3801d65f5 Remove STRUCTTHISREF 2013-03-06 10:20:24 +01:00
kai 1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
kai 1ab2204e0b Fix big-endian code generation for btc, btr and bts.
These intrinsics operate on size_t words. The generated LLVM IR operates
on bytes and therefore assumes a little-endian architecture.
The fix is to change the generated IR to work on size_t words.
2013-03-02 19:30:34 +01:00
David Nadlinger 1a132d5d41 Integrate obj_includelib into its only caller. 2013-02-26 00:20:45 +01:00
Sebastian Graf 673a974260 Un-unroll static array,
[David Nadlinger] Note that DtoStructLiteralValues was/is used
only once across the codebase.
2013-02-11 04:20:59 +01:00
sgraf812 db9edaf053 Fix #265: Use declared struct type in initexpr. 2013-02-11 04:20:59 +01:00