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
David Nadlinger
70dedd14e2
Some more assert(false) -> llvm_unreachable.
2013-02-08 16:46:05 +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
5f3ba41574
Removed redundant global.params.cpu field.
...
Now that we have global.params.targetTriple, the information
is only duplicated.
2013-02-07 17:36:54 +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
David Nadlinger
28a65ff689
Fix D1 build.
2013-02-07 00:49:52 +01:00
David Nadlinger
b99b78558b
Hack to make nested struct .init results an rvalue.
...
The code still needs closer scrunity, as the 'nested' test
from the DMD testsuite doesn't fully pass yet.
2013-01-11 21:34:45 +01:00
David Nadlinger
859177fe3d
Do not unnecessarily call postblit after rvalue array initializers.
...
Fixes DMD testcases 'sdtor' and 'structlit'.
2013-01-04 16:48:10 +01:00
David Nadlinger
bcd8f26b26
Removed completely wrong postblit invocation.
...
This piece of code was invoking the postblit on the _source_
of the copy operation.
2013-01-04 16:48:10 +01:00
David Nadlinger
c3d517e17f
Correctly handle ref variables in an outer frame.
...
Fixes DMD testcase 'testcontracts'.
2013-01-04 07:31:18 +01:00
David Nadlinger
b3f59134c1
Adapt to new DMD lambda inference mechanism.
...
Rewriting types this late is a questionable design and prone
to break non-DMD client code; this should be discussed
again with Kenji.
2013-01-04 06:22:57 +01:00
David Nadlinger
5c518a16ec
Merged 2.061 frontend.
2013-01-04 06:22:53 +01:00
kai
e684d10ac7
Cleanup of complex type handling.
...
- replace if .. else cascades with swicth
- replace assert(0) with llvm_unreachable as default case
- add some whitespaces in parameter lists
2012-12-30 14:56:53 +01:00
David Nadlinger
f1f0486b6e
Implement ordered delegate comparisons.
...
GitHub: Fixes #256 .
2012-12-28 18:08:49 +01:00
David Nadlinger
33093a7403
Factor out TOK to icmp predicate conversion into helper method.
2012-12-28 18:08:49 +01:00
David Nadlinger
59a4a02e49
Cleanup: Avoid signed/unsigned comparisons.
...
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
fca550e534
Cleanup: Remove warning overrides and fix two more warnings.
2012-12-20 01:00:57 +01:00
David Nadlinger
fb363972f0
Fix handling of NewExpression for structs with constructors.
...
The frontend treats the constructor as returning a reference to
the new instance, we just want the memory, i.e. a pointer.
GitHub: Fixes #246 .
2012-12-19 20:57:52 +01:00
David Nadlinger
e068df24b2
Workaround for AA literal initialization ICE.
...
Just executing toConstElem speculatively in
AssocArrayLiteralExp::toElem probably isn't the best idea
anyway, I would not be surprised if there are other similar bugs.
GitHub: Fixes #248 .
2012-12-19 02:09:19 +01:00
David Nadlinger
9458911839
Added LLVM-style license headers to all our files.
2012-12-16 17:19:14 +01:00
David Nadlinger
dfa1bd954d
Removed {insert, extract}element and shufflevector pragmas.
...
They have been superseeded by the inline IR pragma and ldc.simd,
and have only been around for a short time (and not in any
released version).
2012-12-08 21:38:54 +01:00