Commit graph

744 commits

Author SHA1 Message Date
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
David Nadlinger
d14a869c19 Only emit a single bitcast for struct literal padding.
Mostly a cosmetic change.
2012-11-10 20:22:56 +01:00
David Nadlinger
5944e9cc51 Correctly zero out real padding in struct literals.
Fixes the std.variant unit tests on x86_64.
2012-11-10 20:11:10 +01:00
David Nadlinger
07888f95e4 D1: Fixed accessing parameters in contracts.
This reverts the changes from commit f7e5245 and implements the
proper fix – in D1, contracts are treated as normal nested functions.

GitHub: Fix #138.
2012-10-21 01:11:04 +02:00
David Nadlinger
2d54a02295 Use null instead of undef for unneeded nested context pointers. 2012-10-06 13:07:17 +02:00
David Nadlinger
4f6ec96b27 Fixed vector initialization involving implicit conversions.
Fixes first part of GitHub #176.
2012-10-03 19:51:04 +02:00
Jernej Krempuš
fd3e79b7bb Corrections. 2012-10-03 15:26:43 +02:00
Jernej Krempuš
115bc7113e Improved error messages. 2012-10-03 03:44:34 +02:00
Jernej Krempuš
b798974f3a Added pragma insertelement. 2012-10-02 22:22:53 +02:00
Jernej Krempuš
2cf5d8c2a0 Added pragma extractelement 2012-10-02 21:37:27 +02:00
David Nadlinger
4b3662adfd Fixed unlisted vector handling bug.
Thanks to filwit on IRC for mentioning it.
2012-09-28 00:34:31 +02:00
David Nadlinger
c6abdcf4a4 Don't set TypePointer::isunsigned to true in the frontend.
The previous solution was problematic because the change was language-
visble via the isUnsigned trait. Now, pointers are simply explicitly
checked for in the relevant places. (Note that there might be cases in
the diff where a direct isunsigned() call would have been appropriate –
I only checked for instances where the type clearly cannot be a pointer,
but chose to go the safe route in replicating existing behavior
otherwise).

Fixes DMD testcase 'traits'.
2012-09-28 00:28:49 +02:00
David Nadlinger
4a1cbc2d33 Debug log prettification: Indent toElemDtor() children. 2012-09-27 22:01:53 +02:00
David Nadlinger
9e8ec9613c Removed superfluous newline in log message. 2012-09-27 21:55:09 +02:00
David Nadlinger
8968103b8b Some verbose logging output prettification. 2012-09-21 18:54:23 +02:00
David Nadlinger
bebc5cce28 Workaround for Voldemort return type handling issues.
See the comment in DtoCallFunction for an explanation of what is
going on.

The struct zero initialization code was also refactored out to
AssignExp::toElem and modified so that it is only triggered
on integer->struct assignments, not for any types where the
modifier-stripped types don't match up. This would have lead to
silently wrong code in the cases where the assert would have been
triggered otherwise.

Fixes the Phobos testsuite build.
2012-09-07 03:51:33 +02:00
David Nadlinger
ee4285f934 Properly handle DMD-internal "reference variables".
Previously, we just had a hack to make ref foreach statements work.
This commit enables them to work in other cases as well, like the
implicit __result variable for functions with out-contracts (which
is such a magic ref variable for ref-returning functions).

Fixes DMD testcase 'testcontracts'.
2012-09-07 03:51:33 +02:00
David Nadlinger
7a162b6f6d Fixed rvalue delegate property access.
Covered by DMD testcase 'test42'.
2012-09-07 03:51:32 +02:00
David Nadlinger
31e732911a Fixed templated interface member call codegen.
Fixes DMD testcase 'test7618'.
2012-09-07 03:51:31 +02:00
kai
692d624db4 Make LDC1 compile again. 2012-08-17 15:34:17 +02:00
Jernej Krempuš
100907ffa2 Added pragma shufflevector. 2012-08-06 20:50:33 +02:00
kai
5216fa48d8 Remove conditional compiled code by favouring the 3.1 solution. 2012-08-03 22:57:01 +02:00
kai
2dbee75523 Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-02 19:55:29 +02:00