-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 15200 - ICE(glue.c) when compiling with -inline
Even if a function is expanded by inlining, the function itself don't have to put in object file. In short, adjusting `ti.minst` in `inline.d` is not correct. The unspeculation in `expandInline` was added in the PR #4944, but sadly it was just a hack and inherently unneeded. The changes in `TemplateInstance.appendToModuleMember` and `needsCodegen` those were added since 2.068.1-b1, now correctly handle codegen of nested template instances.
- Loading branch information
Showing
5 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // EXTRA_SOURCES: imports/ice15200a.d imports/ice15200b.d | ||
| // COMPILE_SEPARATELY | ||
|
|
||
| module ice15200; | ||
|
|
||
| import imports.ice15200a; | ||
|
|
||
| void main() | ||
| { | ||
| f(); | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import imports.ice15200b; | ||
|
|
||
| auto f() // not void | ||
| { | ||
| sub([0], false); | ||
| } | ||
| void sub(R)(R list, bool b) | ||
| { | ||
| foreach (i; list.filter!(delegate(e) => b)) | ||
| { | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| module imports.ice15200b; | ||
|
|
||
| template filter(alias pred) | ||
| { | ||
| auto filter(R)(R range) | ||
| { | ||
| return FilterResult!(pred, R)(range); | ||
| } | ||
| } | ||
|
|
||
| struct FilterResult(alias pred, R) | ||
| { | ||
| R _input; | ||
|
|
||
| this(R r) | ||
| { | ||
| _input = r; | ||
| while (_input.length && !pred(_input[0])) | ||
| { | ||
| _input = _input[1..$]; | ||
| } | ||
| } | ||
|
|
||
| @property bool empty() | ||
| { | ||
| return _input.length == 0; | ||
| } | ||
|
|
||
| @property auto ref front() | ||
| { | ||
| return _input[0]; | ||
| } | ||
|
|
||
| void popFront() | ||
| { | ||
| do | ||
| { | ||
| _input = _input[1..$]; | ||
| } while (_input.length && !pred(_input[0])); | ||
| } | ||
| } |