Commit graph

39 commits

Author SHA1 Message Date
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
Alexey Prokhin
15a903580b Partial fix for #69 — LDC1 from master fails to build Tango.
Fixed regression that has been introduced in commit 9889067.
2012-01-29 12:32:13 +04:00
Alexey Prokhin
9889067420 Fixed #53 — Assertion !isaStruct(t) 2012-01-10 19:46:32 +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
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +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
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
7a24e12736 Cleanup: Remove unused code in backend, silence some warnings.
This removed quite some clutter that has presumably piled up because LDC is seldom built with a lot of warnings enabled due to DMDFE.
2011-04-24 12:21:33 +02:00
David Nadlinger
8f5f93057c Changed DtoResolveNestedContext() return type to void – it didn't even have a return statement! 2011-04-24 11:39:53 +02:00
Kelly Wilson
72ea043124 Recommit klickverbot's patch for LLVM-2.9. 2011-04-20 09:28:37 -06:00
Kelly Wilson
7c81278b9c Backed out changeset 5253bfbb3890 2011-04-20 00:28:23 -06:00
Kelly Wilson
b26b0f4196 Upgrade to LLVM-2.9. Thanks to David Nadlinger for the patch. 2011-04-19 21:57:15 -06:00
Alexey Prokhin
70aee84c70 Fix passing of a padded struct to a function 2011-02-26 20:16:01 +03:00
Alexey Prokhin
21659b6a5d Check in DtoNestedVariable() whether the needed frame can be accessed 2011-01-04 19:06:25 +03:00
Alexey Prokhin
e7c880cd08 Store the right context frame in nested structs and classes. 2010-12-19 12:13:00 +03:00
Alexey Prokhin
71f653f19b Fixes for closures 2010-12-15 17:05:16 +03:00
Alexey Prokhin
3eb6b5e8c8 Fixed a crash when compiling test runnable/A16. 2010-12-14 14:35:52 +03:00
Alexey Prokhin
59d1ec5e0b Another fix for nested context in structs. 2010-11-05 11:55:23 +03:00
Alexey Prokhin
360a99caa9 Resolving nested context for structs.
* * *
Another fix for nested structs
* * *
Yet another fix for nested structs
2010-11-02 13:21:36 +03:00
Alexey Prokhin
e4c3179d43 Different fixes: phobos compiles now 2010-10-28 14:53:01 +04:00
Alexey Prokhin
b1e5993873 Started work on phobos 2010-10-27 18:13:46 +04:00
Benjamin Kramer
977fa551ee Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
2009-08-06 01:47:39 +02:00
Frits van Bommel
060d18b91e Fix a bug in DtoNestedInit and update an unrelated comment. 2009-06-03 12:32:35 +02:00
Tomas Lindquist Olsen
f5d635dfc7 Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 . 2009-05-14 13:26:40 +02:00
Frits van Bommel
081efcbb7d Copy alloca'd parameters referenced by nested functions to the nesting frame. 2009-04-18 00:34:20 +02:00
Frits van Bommel
46565f1adc Fix nested functions.
My last patch was a little over-zealous in passing `undef`, it always passed
`undef` to inner functions expecting a single context frame.
2009-04-17 13:50:01 +02:00
Frits van Bommel
0262a6ec8f Use 'undef' instead of null for unneeded contexts. 2009-04-17 03:47:56 +02:00
Frits van Bommel
1ef9941daf Name some types. 2009-04-15 21:37:01 +02:00
Frits van Bommel
c19ab2e539 Unify %.frames_list and %.frame into a single data structure, generalizing r1212
to all frames instead of just the outer-most one.
2009-04-15 20:59:19 +02:00
Frits van Bommel
376a825075 Fix a bug in nested context code that occured when calling a function nested in
the outermost scope with a context frame from a function using a more nested
context frame.
2009-04-13 12:19:18 +02:00
Frits van Bommel
5a04c4e9a1 For the outermost function needing a context frame, use the address of that
frame as the nest argument instead of the address of a single-element list
containing only that frame address.
This saves some stack space and reduces memory accesses.
2009-04-13 04:09:08 +02:00
Frits van Bommel
071bad95dc Add some alignment info where LLVM might otherwise be more pessimistic.
In particular, %.nest_arg is always aligned even though it's bitcast from i8*.

Pointers in vtables are also guaranteed to be stored at aligned addresses.
2009-04-12 21:56:43 +02:00
Frits van Bommel
751f528969 Implement -nested-ctx=hybrid 2009-04-12 20:23:00 +02:00
Frits van Bommel
8820024070 Add an option to change the way nested variables are handled.
Only one value is implemented, which is the old way.
2009-04-12 16:22:21 +02:00
Frits van Bommel
b5af30636e Isolate all knowledge of what a function's nested context looks like in a
single place. No functional change.
2009-04-12 13:08:24 +02:00