Commit Graph
2408 Commits
Author SHA1 Message Date
kai 9bc844b6dd Refactor code to create directory into new function. 2012-09-16 12:00:14 +02:00
kai 1773f7c7d9 Refactor common code to execute a program.
The common code for linking, creating libraries and running the created program is moved into a new function `ExecuteToolAndWait`.
2012-09-16 10:54:28 +02:00
kai 6e554c6647 Add support for MS Lib.
If the target OS is Windows using the MS runtime then use LIB.EXE as the archiver.
2012-09-16 00:03:27 +02:00
kai c5fcd255ff Cleanup of intrinsics. 2012-09-15 20:13:50 +02:00
kai 69e305b10b Remove quotes from arguments for add_custom_target.
This fixes #163.
2012-09-15 16:29:30 +02:00
kai 2e47e98c2c Fix access violation.
Variable `args` was used without first checking for valid values. You could crash LDC by entering something like 'pragma(intrinsic) void crash();' in the source file.
2012-09-15 16:15:02 +02:00
kai 7d1ec52c68 Implement the xgetbv opcode.
This solves a FIXME in core.cpuid.
2012-09-14 21:10:39 +02:00
kai ebf5d8b92e Add missing return statement.
This fixes #159.
2012-09-11 18:05:13 +02:00
kai 9dfc638edf Fix path of included header IRBuilder.h
As usual this file has moved around from version to version.
2012-09-10 18:00:21 +02:00
David Nadlinger 1bc5dad066 druntime updates – fixes #158. 2012-09-09 23:20:18 +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
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