Commit Graph

2398 Commits

Author SHA1 Message Date
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
kai
4b0c4bf4ae Get rid of global.params.dataLayout.
The string representation of the data layout is retrieved from the TargetData class (in main) and passed via global.params.dataLayout to the module. Since the gTargetData is also a global variable it makes no sense to pass this information using another global variable.
2012-09-08 20:25:42 +02:00
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
e333b76759 Use monitor_.d instead of monitor.c for Win64.
The compile error in monitor.c using MSVC is then irrelevant.
2012-09-07 23:56:04 +02:00
kai
9b93382417 Some fixes in the operands of 64bit assembler. 2012-09-07 23:45:45 +02:00
kai
b49f41fc62 Accidently removed monitor_.d from build. 2012-09-07 19:33:06 +02:00
kai
5bc41c963f Add Win64 support.
- Add new files and remove unused files.
- Only create .bc files if requested.
  (Creating .bc and .obj files at the same time confuses the LIB tool. Maybe a CMake bug....)
- Add references to new commits for Win64 in druntime and phobos.
2012-09-07 18:54:29 +02:00
David Nadlinger
bf0d8afc88 Merge branch 'dmd-2.060' into master.
Conflicts:
	dmd2/func.c
	dmd2/mars.c
2012-09-07 04:15:44 +02:00
David Nadlinger
2750541d0a druntime and dmd-testsuite updates. 2012-09-07 03:51:33 +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
57b2eb3dad Fixed crash on nested functions with parameters that have a postblit.
Implementing the recursion in DeclarationExp::apply, which seems more
natural, lead to a "cannot interpret" CTFE error in Phobos.

An upstream bug will be raised about this.
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
05b9b14fa9 Fixed -debuglib in LDMD. 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
207033c427 Removed LDC-only dead code.
Helps avoid broken merges.
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
6b1b84a28d Pass library file arguments to linker _before_ custom switches.
This allows specifying a static D library specified at the LDC
command line to pick up symbols from druntime/Phobos.

Fixes DMD testcase 'test39'.
2012-09-07 03:51:32 +02:00
David Nadlinger
4b23e794ca Removed linkExecutable() (dead code). 2012-09-07 03:51:32 +02:00
David Nadlinger
1cb982f568 druntime updates. 2012-09-07 03:51:32 +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
kai
8987f2da30 Fix format for MSVC. 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
c941640d17 Fixed '-debug' and '-version' handling in LDMD.
No idea how the old version once passed the test suite.
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
9ac1582726 Update druntime/Phobos library version. 2012-09-07 03:51:31 +02:00
David Nadlinger
0fe41a1f30 druntime updates. 2012-09-07 03:51:31 +02:00
David Nadlinger
31e732911a Fixed templated interface member call codegen.
Fixes DMD testcase 'test7618'.
2012-09-07 03:51:31 +02:00
David Nadlinger
270979ffd6 Testsuite updates. 2012-09-07 03:51:31 +02:00
David Nadlinger
d163799758 Imported D2 testsuite (v2.060) as submodule. 2012-09-07 03:51:31 +02:00
David Nadlinger
1645eff596 Created separate tests directory for D1. 2012-09-07 03:51:31 +02:00
David Nadlinger
837ef30fec Merged DMD 2.060 frontend.
Upstream Git tag v2.060 (e8fe11c20249cb9e42538be88c99b74ede4d12e3).
2012-09-07 03:51:31 +02:00
David Nadlinger
e03e027002 Removed all CRLF line endings from DMD source.
Some files in our copy of the DMD 2 source had CRLF line endings.
This was not only inconsistent, but also made merging DMD patches
(where LF is used throughout) unnecessarily painful.
2012-09-07 03:51:31 +02:00
kai
9a3cdf2e10 Use .obj extension on Windows.
The Windows linker LINK insists on the .obj extension. The following changes are made:
- CMake uses the same extension as the C compiler
- global.obj_ext_alt (aka .obj) is recognized as objectfile extension
- global.obj_ext_alt is used on Windows
2012-09-05 19:23:34 +02:00
kai
af69672dc7 Fixed a bug regarding lifetime of C strings.
The string returned by c_str() is only valid as long as the object exists. Now the object 'triple' exists until the end.
2012-08-28 06:52:29 +02:00
kai
7c7a9e564a Add source_group.
This information is used by VisualStudio to group files togetther.
2012-08-26 15:28:35 +02:00
kai
521921e5d3 Fix some whitespace issues. 2012-08-25 14:41:33 +02:00
kai
1205e3ea83 Use TargetData to get size of certain types (instead of hard-coded values). 2012-08-25 01:29:42 +02:00
kai
2173b52aea Make LDC1 compile with LLVM 3.2 trunk. 2012-08-17 15:44:20 +02:00
kai
692d624db4 Make LDC1 compile again. 2012-08-17 15:34:17 +02:00