Commit Graph
1397 Commits
Author SHA1 Message Date
kai 0a53cb2ac0 Add -vectorize to the optimizer. This is available starting with LLVM 3.1. 2012-09-08 13:36:31 +02:00
kai 4ae64dd2e7 Fix size returned by os_critsecsize() and construct type for D_CRITIAL_SECTION on Windows. 2012-09-08 11:49:37 +02:00
kai 9b93382417 Some fixes in the operands of 64bit assembler. 2012-09-07 23:45:45 +02:00
David Nadlinger 81b462b129 D1 build fix. 2012-09-07 03:51:33 +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 139e1a9c2a Implement stripModifiers using castMod(0).
Reduces the potentail for bugs in the fragile code; castMod(0) is
used like this in DMD code.
2012-09-07 03:51:33 +02:00
David Nadlinger 88f08cf927 Workaround for LLVM bug 11479.
The LLVM module name doesn't really seem to impact much aynway.
2012-09-07 03:51:33 +02:00
David Nadlinger 6275c66a89 Fixed segfault on invalid naked functions.
Emitting a frontend error during codegen is somewhat problematic in
any case, but stopping if an error ocurred should work just fine here.
2012-09-07 03:51:33 +02:00
David Nadlinger 45d9efb203 Call element postblit on "return array[0]".
Fixes DMD testcase 'sdtor'.
2012-09-07 03:51:33 +02:00
David Nadlinger 1cecab16cf Emit correct TypeInfo argument for _d_arrayassign.
Fixes part of DMD testcase 'sdtor'.
2012-09-07 03:51:33 +02:00
David Nadlinger d4eafe53e0 Removed obsolete nested context styles.
NChybrid was the only one that didn't instantly trigger a "not
implemented" assertion on any code using nested function for a long
time, and removing the cruft greatly improves code readability
(maintainability is a moot point anyway given its current state).
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 16847dd5d5 Disregard modifiers when checking for initializer type match.
Previously, only const'ness was dropped, but DMD 2.060 started to
emit initializers with incompatible shared modifiers as well.
2012-09-07 03:51:32 +02:00
David Nadlinger 4ae14449ea Emit new TypeInfo layout.
Includes untested support for RTInfo.
2012-09-07 03:51:32 +02:00
David Nadlinger 8ebd2ce5a6 More CRLF->LF line ending conversion. 2012-09-07 03:51:32 +02:00
David Nadlinger 6fea7358dc Fixed several asm-related error message formats. 2012-09-07 03:51:32 +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 364cfb6714 Improved initializer ICE error message. 2012-09-07 03:51:32 +02:00
David Nadlinger 508652fd8b Initialization of vector types with single value.
Fixes DMD testcase 'testargtypes'.
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
kai e6a07ffdfe Several changes to optimizer related code.
- New functions codeGenOptLevel() and verifyModule() to remove code duplication
- Hidden option no-verify renamed to disable-verify and moved to optimizer (like opt tool)
- Removed global.params.noVerify
2012-08-16 23:26:52 +02:00
kai 34d595de26 Enable FunctionAttrsPass again.
This pass requires an alias analysis, which is also added.
2012-08-11 19:17:18 +02:00
Jernej Krempuš 100907ffa2 Added pragma shufflevector. 2012-08-06 20:50:33 +02:00
Jernej Krempuš 3d108ee684 Fixed a bug in gen/tollvm.cpp. 2012-08-05 18:46:52 +02:00
kai 5216fa48d8 Remove conditional compiled code by favouring the 3.1 solution. 2012-08-03 22:57:01 +02:00
kai 6e427fe818 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-03 06:36:35 +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
kai b53544b389 Simplify code by using the right type.
Removes some comditional compiling by replacing unsigned with llvm::Attributes.
2012-07-29 18:18:36 +02:00
kai dbb5a34eda Add changes for LLVM 3.2. 2012-07-29 17:31:50 +02:00
kai bf2aaaca84 More unification work. 2012-07-29 16:13:52 +02:00
kai e13b115583 More unification work. 2012-07-29 14:22:56 +02:00
kai 9bf65bc9a2 Start unification of master and llvm-3.1 branch. 2012-07-29 13:50:30 +02:00
kai 508dd9ff70 Simplify CMakeLists.txt.
This version works with LLVM 3.0 and 3.1.
2012-07-24 23:33:15 +02:00
kai fcd3ac6a11 Do not add a second underscore to naked functions on Windows.
This leads to missing symbols during linking on Windows x64. If
this changes breaks other Windows platforms then we have to analyze
the triple instead of global.params.os.
2012-07-14 18:25:27 +02:00
David Nadlinger f7e5245e03 Fix #138 – in precondition of methods broken in D1.
Not sure why the code was special-cased for D2 in the first place –
are there any cases where we expect a »full« context struct in the
contracts for D1. At least, they don't occur in DStress/Tango/….

As a general note, this is one of many bugs which would have not gone
unnoticed if we didn't use so many bitcasts.
2012-07-13 11:38:56 +02:00
David Nadlinger c630ab56ff Fix #136 - return static arrays as sret parameters on non-x86.
This should eventually be done on x86 and x86_64 as well, but as
discussed in GitHub issue #110/pull request #120, the ABI there needs a
closer look: at least on x86_64, we need to treat static arrays exactly
like if they were a struct containing T.length members of the same type
to be compatible with DMD (as soon as the ABI is correctly implemented
there, that is).

While for this reason I want to avoid a ABI change which could silently
break some code only to change the x86 ABI again shortly after, this
commit only touches the "default" ABI for unknown targets and thus
should be safe (as we give absoultely no ABI guarantees there anyway).
2012-07-07 23:53:46 +02:00
David Nadlinger cef19fb225 Fix #125 – Nested class context pointer invalid (D1).
Patch originally by Alexey Prokhin, thanks.
2012-06-24 16:18:47 +02:00
David Nadlinger 67f12fe8b5 Fixed DSource #330 – Many-at-a-time nested context crash (D1). 2012-06-24 11:30:32 +02:00
David Nadlinger 61e61e47f0 Fix #125 - fix generation of nested context chains.
Just declaring the type of the parent is obviously not enoguh, we need to have run this very code for determining level and context type (if the parent is also nested, that is).
2012-06-23 17:05:59 +02:00
David Nadlinger 6f236518b5 Fixes #123 – Linking of pre/post-condition in interface fails when interface implemented in separate module. 2012-06-19 22:37:46 +02:00
David Nadlinger 62bfda0259 Fix #113 - promotion of small static array arguments to registers. 2012-06-06 22:55:59 +02:00
David Nadlinger ba9fb721ed Removed trailing whitespace. 2012-06-06 20:41:46 +02:00
David Nadlinger d5084d9051 Factored out x86 ABI code to separate file. 2012-06-06 20:39:38 +02:00
David Nadlinger 260faae6ec Remove inreg attribute from static arrays when enregistering them. 2012-06-06 15:44:54 +02:00
Dan Sanduleac 2748cdaa88 Fix #49: Static arrays that don't fit in a register should be passed using byval 2012-06-05 02:52:25 +01:00
David Nadlinger d24592b3e7 Fix #77 - LDC1 fails to compile tango.io.vfs.ZipFolder.
I think the same rewrite for contract this should be valid in D1 - if I missed something crucial, feel free to revert.
2012-06-02 19:21:36 +02:00
kai 48f8ffeb0b Further changes to compile using MSVC. 2012-05-23 17:36:26 +02:00
Alexey Prokhin 8c5cf40bb5 Fixed compilation of ldc1 2012-04-22 12:26:25 +04:00
Alexey Prokhin f4d8021e5a Merge branch 'master' of github.com:ldc-developers/ldc 2012-04-22 12:17:01 +04:00