Commit graph

230 commits

Author SHA1 Message Date
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
7974c33c61 Merge branch 'master' into merge-2.061-2. 2013-01-12 14:31:54 +01:00
David Nadlinger
4a6444c320 Revert "Fix overly conservative inlining prediction".
The commit itself should be fine, but the more aggressive
inlining being done on the GC code (due to the gcbits functions
being in available in gc.gcx) seems to have uncovered a
misoptimization bug in LLVM (at least in 3.2) on x86, leading to
various unit tests failing in relase mode.

This reverts part of commit f02e4b1925.
2013-01-12 14:30:59 +01:00
David Nadlinger
30caa4bfe6 Merge branch 'master' into merge-2.061-2 2013-01-12 01:27:02 +01:00
David Nadlinger
f02e4b1925 Fix overly conservative inlining prediction.
A "statementsToo" flag was added to DMD, which disables inlining
of pretty much any functions that actually return a value – set it
to false for our purposes.

The other parts of the diff are just cosmetic.
2013-01-12 01:23:55 +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
55fb4798a7 Added workaround for DMD accepts-invalid regression 9268. 2013-01-04 06:22:57 +01:00
David Nadlinger
08708917bc D1 build fix.
The workaround could later be merged to D1 if the same problem
starts to appear there as well.
2012-12-31 06:27:11 +01:00
David Nadlinger
39e3e3a678 Replace template symbol module fix with more localized hack.
This reverts commit c4adbedcc, which would have fixed the
problem at its roots, but caused strange template function
attribute inference failures in D-YAML, presumably due to
the different order of semantic3 execution on the templates.
2012-12-31 05:46:29 +01:00
kai
2898e5cac3 Add support for PPC 128bit doubledouble type.
On a PowerPC target the datatype real is mapped to PPC 128bit doubledouble type.
Please note that this yet does not work if you cross compile from a different
architecture.
2012-12-30 17:18:36 +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
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
2988bc46e0 Removed long obsolete (and broken) LLVM IR annotation code.
If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
2012-12-19 01:50:48 +01:00
David Nadlinger
1bb14c45d2 Removed trailing whitespace. 2012-12-16 17:19:15 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
kai
a7c7b514c0 Add changes for LLVM 3.2
- The Attributes class was changed again
- TargetData was renamed to DataLayout

Compiles again with LLVm 3.0, 3.1 and trunk(3.2).
2012-10-13 18:54:42 +02:00
Jernej Krempuš
7966abeb5e Bitcast the LLValue to the correct type. 2012-10-05 21:58:19 +02:00
Jernej Krempuš
39300283c0 Made casts between vector types work. 2012-10-05 19:38:43 +02:00
David Nadlinger
4e49814afb Vector -> static array casts are by address.
Fixes #176 (GitHub).
2012-10-05 17:23: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
8968103b8b Some verbose logging output prettification. 2012-09-21 18:54:23 +02:00
kai
d57eaa49ae Use new functions appendToGlobalCtors() and appendToGlobalDtors.
This simplifies the code in module.cpp a bit. But it is also the base to implement a pragma to place an arbitrary function in llvm.global_ctors and llvm.global_dtors.
2012-09-09 20:41:51 +02:00
kai
e78ff5a131 Fix broken build with LLVM 3.0.
The method ConstantVector::getSplat() does not existin LLVM 3.0. Workarouund is to create a vector and use ConstantVector::get().
2012-09-09 20:36:48 +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
45d9efb203 Call element postblit on "return array[0]".
Fixes 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
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
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
Alexey Prokhin
f4d8021e5a Merge branch 'master' of github.com:ldc-developers/ldc 2012-04-22 12:17:01 +04:00
Alexey Prokhin
d739588d4a Fix dmd bug 7504: Cannot assign an object of type 'typeof(null)' to an array 2012-04-21 22:37:36 +04:00
Eldar Insafutdinov
feefad412c Move cl_options out of LDCShared 2012-04-02 14:53:52 +01:00
kai
53f9964b95 Fix LDC1 compile error. 2012-02-18 18:08:26 +01:00
Alexey Prokhin
ae7f0ca7e7 Preliminary vector support 2012-02-16 14:42:23 +04:00
Alexey Prokhin
adebe4c732 DMD Issue 4269 - Regression(2.031): invalid type accepted if evaluated while errors are gagged 2012-02-15 13:23:23 +04:00
Alexey Prokhin
f2ed2e96b0 Use optimized array operators implemented in druntime 2012-02-15 13:16:34 +04:00
Alexey Prokhin
dbb6528c95 Fixed #54 — Error: invalid cast from 'typeof(null)' to 'void*' 2012-01-09 15:14:05 +04:00
Alexey Prokhin
eb6809a530 Fixed #41 — Casting Associative Arrays To Immutable 2011-12-09 12:22:12 +04:00
Alexey Prokhin
bb3908f290 Fixed #36 — ICE: DValue::getLVal(): Assertion '0' failed 2011-12-05 13:19:33 +04:00
David Nadlinger
3916835380 Merge remote-tracking branch 'AlexeyProkhin/master' into merge-3.0
Conflicts:
	CMakeLists.txt
	druntime
	runtime/CMakeLists.txt
2011-12-04 18:38:09 +01:00
David Nadlinger
fe19ee84f5 Merge branch 'llvm3.0' into merge-3.0
Conflicts:
	gen/configfile.cpp
2011-12-04 18:16:36 +01:00
David Nadlinger
d0ea856024 Emit all D inline asm labels as local labels.
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:

---
import core.exception;

void main() {
  asm {
    jmp Lfoo;
Lfoo:
    ;
  }
  throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
  assert(0);
}
---
2011-12-04 18:13:33 +01:00
Alexey Prokhin
784e3f1542 Fixed cases when debug info of a variable was emitted several times 2011-12-04 15:34:41 +04:00
Alexey Prokhin
91f4e5d015 Added emission of dwarf lexical blocks.
Also, dropped support for DISABLE_DEBUG_INFO definition.
2011-12-04 15:34:35 +04:00
Alexey Prokhin
b8721a8515 Emit debug info for variables that are used in nested functions 2011-12-03 23:45:58 +04:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00