Commit Graph

1778 Commits

Author SHA1 Message Date
Alexey Prokhin
b8721a8515 Emit debug info for variables that are used in nested functions 2011-12-03 23:45:58 +04:00
Alexey Prokhin
cedb4c0e68 When generating debug info, handle recursive types properly 2011-12-03 14:35:55 +04:00
Alexey Prokhin
1f3d9b98d0 Removed old hack for llvm 2.8, it is not required anymore 2011-12-03 14:20:54 +04:00
Alexey Prokhin
6357c421ac Updated ldc version and homepage 2011-12-03 13:52:05 +04:00
Alexey Prokhin
1f4de64360 Fixed appending to an array 2011-12-03 12:24:53 +04:00
Alexey Prokhin
014d6bdd4d Merged 2.056 2011-12-02 21:50:52 +04:00
Alexey Prokhin
250d8ed214 Sanity check — can't create a directory with an empty path 2011-12-02 13:59:49 +04:00
Alexey Prokhin
5e0a2b7761 Merge branch 'llvm3.0' into master 2011-12-02 13:26:31 +04:00
kai
8db112dd68 Stream for object file must have binary flags. 2011-11-27 21:26:44 +01: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
kai
aa20673c72 Fix indentation (TAB -> SPACE in 2 cases). 2011-11-21 20:47:38 +01:00
kai
1ecd536f45 Replace deprecated LLVM functions.
Several functions regarding file handling are deprecated. This commit replaces these functions with the new one from llvm::sys::fs and llvm::sys::path. It also removes some warnings about signed/unsigned mismatches.
2011-11-16 19:05:23 +01:00
David Nadlinger
1afc01df72 Whitespace cleanup. 2011-11-14 21:25:56 +01:00
David Nadlinger
abd1d160f4 Tabs->spaces. 2011-11-14 20:10:45 +01:00
Robert Clipsham
4add11b78f Fix bug #22. 2011-11-13 14:14:19 +00:00
David Nadlinger
2c7f77eabd Fixed leftover llvm::Type const qualifier. 2011-11-12 20:17:29 +01:00
David Nadlinger
ffe37c4a62 Merge remote-tracking branch 'upstream/llvm3.0' 2011-11-12 19:51:30 +01:00
David Nadlinger
dc46ae547c Merge remote-tracking branch 'upstream/ldc-merge-2.056'. 2011-11-12 19:31:19 +01:00
David Nadlinger
23f360c988 Use llvm::InitializeNativeTargetAsmPrinter() now that it is available.
This enables us to remove the whole ugly config file parsing hack.

Also includes some minor CMake beautifications (nobody should really be at 2.4 anymore, 2.6 is more than three years old now).
2011-11-12 18:42:01 +01:00
David Nadlinger
7eda270d6b Search for config next to the binary before trying global dirs.
This solves the problem of LDC picking up a pre-existing system-wide config when druntime and Phobos are compiled as part of the build process.

This order was intended by Christian in 919f8d6, but then backed out again in eb3cd887 with no comment as to why – I hope this doesn't have any unwanted implications.
2011-11-12 14:35:30 +01:00
David Nadlinger
5e18625266 Define MinGW in addition to mingw32 for consistency with GDC.
When we get Win64 support, it should be defined there as well.
2011-11-08 21:27:02 +01:00
Alexey Prokhin
4ab6869c50 Fix a crash which occurs when compiling std/conv.d with unittests 2011-11-01 17:06:13 +04:00
Alexey Prokhin
6ef7ee6d32 Unimplemented toConstElem is not a fatal error if errors are gagged.
Because ldc uses gagging to check whether an expression is constant.
2011-11-01 14:35:28 +04:00
Alexey Prokhin
22d0f00027 Rewritten DtoArrayInit().
It does not create calls to runtime functions and generates a faster code, especially if optimizations are on.
2011-11-01 14:31:00 +04:00
Alexey Prokhin
40fa7653e2 Sync TypeInfoClass flags with dmd 2011-11-01 12:07:59 +04:00
Alexey Prokhin
b52c224d57 Merge v2.056 2011-11-01 11:44:03 +04:00
Alexey Prokhin
7431d58702 Rewritten initialization of global variables. 2011-10-25 15:43:49 +04:00
Alexey Prokhin
66a30803f3 Fixed an assert in DtoNewClass when initializing an inner-class outer reference 2011-10-25 15:43:49 +04:00
Alexey Prokhin
bf463d61da Readded 'relocation-model' and 'code-model' options 2011-10-25 15:43:49 +04:00
Alexey Prokhin
45426ca60d Implemented atomic intrinsics for llvm 3.0
Unline older versions, llvm 3.0 provides atomic instructions, not intrinsics.
The patch wraps the instructions into intrinsics, so they will be accessible
from d code.
2011-10-25 15:43:49 +04:00
Alexey Prokhin
81426b8cc8 Fix DelegateExp::toElem return type 2011-10-25 15:43:49 +04:00
Alexey Prokhin
b97b32759e Use LLVM Machine Code (MC) to emit object files. Finilize debug info 2011-10-25 15:43:49 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
Alexey Prokhin
fb77c05dfd DMD Issue 3632 - modify float is float to do a bitwise compare 2011-09-15 13:56:22 +04:00
Alexey Prokhin
a75b08bc00 Fixed accessing struct members via alias this 2011-09-13 21:01:39 +04:00
Alexey Prokhin
4879a8bc17 Fixed initialization of nested structs 2011-09-13 21:01:39 +04:00
Alexey Prokhin
a0e4737c2e Treat warnings as errors like dmd does 2011-09-13 21:01:39 +04:00
Alexey Prokhin
9a9999854f Named Return Value Optimization 2011-09-13 21:01:38 +04:00
Alexey Prokhin
0e754b5acd Merge dmd v2.055 2011-09-13 21:01:32 +04:00
Alexey Prokhin
8f4a15c868 Fix ldc1 regressions 2011-09-10 13:24:29 +04:00
Alexey Prokhin
f3c901af9d Use _d_arraycatT to append an element to an array instead of reallocating the array 2011-09-10 13:23:47 +04:00
Alexey Prokhin
0caba6672d Call postblit on a struct when appending it to an array. Use _d_arraycatnT to concatenate multiple arrays.
Before, _d_arraycatT was used to concatenate multiple arrays. That caused an issue when postblit
was called on a struct multiple times. The next code asserted due to the issue:

void main()
{
    static struct S
    {
        int x;
        int pad;
        this(this)
        {
            ++x;
        }
    }

    auto sarr = new S[1];
    auto sarr2 = sarr ~ sarr ~ sarr;
    assert(sarr2[0].x == 1);
    assert(sarr2[1].x == 1);
    assert(sarr2[2].x == 1);
    assert(sarr[0].x == 0);
}
2011-09-10 13:22:05 +04:00
David Nadlinger
9864129fb8 Merge branch 'master' into merge-2.054
Conflicts:
	gen/statements.cpp (returning void from main() was fixed on both branches)
2011-08-17 16:09:28 +02:00
David Nadlinger
3f448afa37 Another nested context crash fix.
The test case that would previously crash:

a.d
---
module a;

@property bool empty(T)(in T[] a) {
  return !a.length;
}

void find(alias pred,R1)(R1 haystack) {
  simpleMindedFind!pred(haystack);
}

void simpleMindedFind(alias pred, R1)(R1 haystack) {
  bool haystackTooShort() {
    return haystack.empty;
  }
}
---

b.d
---
module b;

import c;

void getTimeZone() {
  indexOf();
}
---

c.d
---
module c;

import a;

void indexOf()() {
  find!({})("");
}
---
2011-08-17 02:33:33 +02:00
David Nadlinger
11f19eec5a D1: Don't crash when returning a void expression from void main(). 2011-08-12 20:14:55 +02:00
David Nadlinger
21a05aa971 Merge branch 'default' into 'merge'. 2011-07-29 00:37:30 +02:00
David Nadlinger
618051022f Fixed crash in DtoCreateNestedContextType().
In some cases, like the following, DtoDeclareFunction() hasn't already been called when DtoCreateNestedContextType() is invoked. This seems to have been anticipated when the function was originally written, but DtoDeclareFunction() was previously called after the ir func was already accessed in fd->ir.irFunc->nestedContextCreated.

---
void main() {
  mixin({
    string foo() {
      return "";
    }

    string bar()() {
      return foo();
    }

    return bar();
  }());
}
---
2011-07-28 23:17:20 +02:00
David Nadlinger
e397b29722 Fixed #448 for D2 and restored opOpAssign expression cache for D1.
When clearing the lvalue cache, the added-then-backed-out-then-added-back-for-D2-only code by Alexey permanently removed all casts from e1 (e1 is a member variable!), instead of only skipping them for the cachedLvalue assignment.
2011-07-28 23:10:22 +02:00
David Nadlinger
15c5316e26 Prevent two function with same mangled name but different types from being declared.
Previously, LDC would crash in the backend due to the fact that the IR is typed in such cases (we recently had such an instance with Tango, where an extern( C ) function was declared once with int and once with size_t).
2011-07-27 23:01:22 +02:00
Alexey Prokhin
71a0a968ef Fixed #6 2011-07-26 09:48:10 +04:00