DI Generation Improvements #928

Closed
wants to merge 187 commits into
from

Projects

None yet

2 participants

@LightBender

This pull request attempt to improve the automatic generation of DI files by DMD.

All function implementations are removed from DI files except for those inside templates and functions with auto return values.
Proper indenting for DI files.

There were some changes to OutBuffer::write() to fix an OutOfMemory error I was getting on Windows (x64).

If anybody has any questions/comments/rants/raves or finds anything broken let me know. I would love to hear feedback.

NOTE: I apologize in advance for the spurious commits, I was apparently misinformed as to how to properly update my git branch (fetch/merge instead of the proper rebasing).

Adam Wilson and others added some commits Dec 19, 2011
Adam Wilson Initial commit for DI generation improvements 4aa8895
Adam Wilson Fixed handling of const types 5ceef9f
Adam Wilson Merge remote-tracking branch 'upstream/master' ce590c0
Adam Wilson All privates now included. Templates class/functions retain implement…
…ation. Immutable variables now keep initializer.
dc6772b
Adam Wilson Merge remote-tracking branch 'upstream/master' 52ea71a
Adam Wilson Merge remote-tracking branch 'upstream/master' b62e855
Adam Wilson Fixed bug that would cause immutables inside template function implem…
…entions to lose their initializers.
bb539fe
Adam Wilson Fixed bug that would cause manifest constants to lose their initializ…
…ers.
e8f065c
Adam Wilson Fixed bug that would cause all function level variables to lose their…
… initializers.
390d2f4
Adam Wilson Merge remote-tracking branch 'upstream/master' c92a39c
Adam Wilson Merge remote-tracking branch 'upstream/master' 49e7c1f
Adam Wilson Merge remote-tracking branch 'upstream/master' 24e7dd1
Adam Wilson Merge remote-tracking branch 'upstream/master' 293b46d
Adam Wilson Merge remote-tracking branch 'upstream/master' 035dbb2
Adam Wilson Merge remote-tracking branch 'upstream/master' 2767224
Adam Wilson Merge remote-tracking branch 'upstream/master' f7faf00
Adam Wilson Merge remote-tracking branch 'upstream/master' 4b7f660
Adam Wilson Merge remote-tracking branch 'upstream/master' 30ca882
Adam Wilson Merge remote-tracking branch 'upstream/master' 15599e9
Adam Wilson Merge remote-tracking branch 'upstream/master' b4da79a
Adam Wilson Merge remote-tracking branch 'upstream/master' 528c456
Adam Wilson Merge remote-tracking branch 'upstream/master' d318588
Adam Wilson Merge remote-tracking branch 'upstream/master' e2d62a2
Adam Wilson Merge remote-tracking branch 'upstream/master' 3b8e2f7
Adam Wilson Merge remote-tracking branch 'upstream/master' 57bfe04
Adam Wilson Merge remote-tracking branch 'upstream/master' ea8b2f3
Adam Wilson Merge remote-tracking branch 'upstream/master' b85ff89
Adam Wilson Merge remote-tracking branch 'upstream/master' 1ea04d5
Adam Wilson Merge remote-tracking branch 'upstream/master' fcc235a
Adam Wilson Merge remote-tracking branch 'upstream/master' 848c4a7
Adam Wilson Merge remote-tracking branch 'upstream/master' 59ec5c6
Adam Wilson Merge remote-tracking branch 'upstream/master' cba7380
Adam Wilson Merge remote-tracking branch 'upstream/master' 429aa77
Adam Wilson Merge remote-tracking branch 'upstream/master' 8664080
Adam Wilson Merge remote-tracking branch 'upstream/master' ed98a4c
Adam Wilson Merge remote-tracking branch 'upstream/master' d7b8065
Adam Wilson Initial indent tracking commit, work not finished. a012440
Adam Wilson Merge remote-tracking branch 'upstream/master' 17fe8dd
Adam Wilson Merge remote-tracking branch 'upstream/master' e2768af
Adam Wilson Merge remote-tracking branch 'upstream/master' d0c7a86
Adam Wilson Initial indent tracking commit, work not finished. 5d6f9d9
Adam Wilson Fixed a merge conflict in statement.c function UnrolledLoopStatement:…
…:toCBuffer
ba922c7
Adam Wilson Merge remote-tracking branch 'upstream/master' dd61ab6
Adam Wilson Merge remote-tracking branch 'upstream/master' 8311847
Adam Wilson Merge remote-tracking branch 'upstream/master' b69e0de
Adam Wilson Merge remote-tracking branch 'upstream/master' 887b425
Adam Wilson Merge remote-tracking branch 'upstream/master' e192b34
Adam Wilson Merge remote-tracking branch 'upstream/master' 82c2071
Adam Wilson Merge remote-tracking branch 'upstream/master' 0f31090
Adam Wilson Merge remote-tracking branch 'upstream/master' 9416fdd
Adam Wilson Merge remote-tracking branch 'upstream/master' b69c06a
Adam Wilson Merge remote-tracking branch 'upstream/master' 45832cf
Adam Wilson Merge remote-tracking branch 'upstream/master' bd3c1e8
Adam Wilson Merge remote-tracking branch 'upstream/master' a16dea1
Adam Wilson Merge remote-tracking branch 'upstream/master' a78e8ed
Adam Wilson Merge remote-tracking branch 'upstream/master' 0d8dc6d
Adam Wilson Merge remote-tracking branch 'upstream/master' f0c77b2
Adam Wilson Merge remote-tracking branch 'upstream/master' 51626a6
Adam Wilson Merge remote-tracking branch 'upstream/master' 8f2aef8
Adam Wilson Merge remote-tracking branch 'upstream/master' e711de4
Adam Wilson Merge remote-tracking branch 'upstream/master' 6e46382
Adam Wilson Merge remote-tracking branch 'upstream/master' c6fa330
Adam Wilson Merge remote-tracking branch 'upstream/master' 40d00de
Adam Wilson Merge remote-tracking branch 'upstream/master' 9237ccc
Adam Wilson Merge remote-tracking branch 'upstream/master' 98532ed
Adam Wilson switched all indenting code to use buf->level 0476a0e
Adam Wilson Merge remote-tracking branch 'upstream/master' c7e5cc5
Adam Wilson Merge remote-tracking branch 'upstream/master' 7c74078
Adam Wilson updated to exclude types that non longer need indenting. 2fd2c06
Adam Wilson Merge remote-tracking branch 'upstream/master' cc75458
Adam Wilson Merge remote-tracking branch 'upstream/master' 7a1ca85
Adam Wilson Merge remote-tracking branch 'upstream/master' 8febdc6
Adam Wilson Merge remote-tracking branch 'upstream/master' 3d98f2e
Adam Wilson testing changes to debug a DMD assert error. 2e25dea
Adam Wilson Merge remote-tracking branch 'upstream/master' e39b6ef
Adam Wilson Merge remote-tracking branch 'upstream/master' 1bbe905
Adam Wilson Merge remote-tracking branch 'upstream/master' 995bfe9
Adam Wilson Merge remote-tracking branch 'upstream/master' bdf1e5c
Adam Wilson Merge remote-tracking branch 'upstream/master' 0b21c38
Adam Wilson Merge remote-tracking branch 'upstream/master' 2a8ddb2
Adam Wilson Merge remote-tracking branch 'upstream/master' 1c978e7
Adam Wilson Merge remote-tracking branch 'upstream/master' 127865a
Adam Wilson Merge remote-tracking branch 'upstream/master' 3f81329
Adam Wilson Merge remote-tracking branch 'upstream/master' abeba48
Adam Wilson Merge remote-tracking branch 'upstream/master' 1acce22
Adam Wilson Merge remote-tracking branch 'upstream/master' 7a9825e
Adam Wilson Merge remote-tracking branch 'upstream/master' b9c9020
Adam Wilson Merge remote-tracking branch 'upstream/master' becbf13
Adam Wilson Merge remote-tracking branch 'upstream/master' 591d005
Adam Wilson Merge remote-tracking branch 'upstream/master' ecf3e2a
Adam Wilson Merge remote-tracking branch 'upstream/master' af4662b
Adam Wilson Merge remote-tracking branch 'upstream/master' fd60d7e
Adam Wilson Merge remote-tracking branch 'upstream/master' 993371e
Adam Wilson Merge remote-tracking branch 'upstream/master' 9351cf9
Adam Wilson Merge remote-tracking branch 'upstream/master' 54fcb78
Adam Wilson Merge remote-tracking branch 'upstream/master' 923ca68
Adam Wilson Merge remote-tracking branch 'upstream/master' ff73c40
Adam Wilson Merge remote-tracking branch 'upstream/master' 017deee
Adam Wilson Merge remote-tracking branch 'upstream/master' cd6107d
Adam Wilson Merge remote-tracking branch 'upstream/master' a9c6c8f
Adam Wilson Merge remote-tracking branch 'upstream/master' 798c188
Adam Wilson Merge remote-tracking branch 'upstream/master' 0c06fb6
Adam Wilson Merge remote-tracking branch 'upstream/master' 0b439a3
Adam Wilson Merge remote-tracking branch 'upstream/master' b62435d
Adam Wilson Merge remote-tracking branch 'upstream/master' 645791c
Adam Wilson Merge remote-tracking branch 'upstream/master' 1985a37
Adam Wilson Merge remote-tracking branch 'upstream/master' 33ad892
Adam Wilson Fixed merge errors with DMD HEAD 36ab5df
Adam Wilson Merge remote-tracking branch 'upstream/master' fcf5016
Adam Wilson Merge remote-tracking branch 'upstream/master' fb2633e
Adam Wilson Merge remote-tracking branch 'upstream/master' 154fa60
Adam Wilson Merge remote-tracking branch 'upstream/master' 058484b
Adam Wilson Merge remote-tracking branch 'upstream/master' 0145ef1
Adam Wilson Merge remote-tracking branch 'upstream/master' 7302ee8
Adam Wilson Merge remote-tracking branch 'upstream/master' 7147d3d
Adam Wilson Merge remote-tracking branch 'upstream/master' fdd2030
Adam Wilson Merge remote-tracking branch 'upstream/master' 6ae406d
Adam Wilson Merge remote-tracking branch 'upstream/master' 2084998
Adam Wilson Merge remote-tracking branch 'upstream/master' 02517d7
Adam Wilson Merge remote-tracking branch 'upstream/master' eacaf5f
Adam Wilson Merge remote-tracking branch 'upstream/master' d97b4ce
Adam Wilson Merge remote-tracking branch 'upstream/master' bf328e4
Adam Wilson Merge remote-tracking branch 'upstream/master' 44e96eb
Adam Wilson Merge remote-tracking branch 'upstream/master' 474f1fd
Adam Wilson Merge remote-tracking branch 'upstream/master' cfa40b3
Adam Wilson Merge remote-tracking branch 'upstream/master' dca4387
Adam Wilson Merge remote-tracking branch 'upstream/master' 416e528
Adam Wilson Merge remote-tracking branch 'upstream/master' a780047
Adam Wilson Merge remote-tracking branch 'upstream/master' f7d6baa
Adam Wilson Merge remote-tracking branch 'upstream/master' be3fcda
Adam Wilson Merge remote-tracking branch 'upstream/master' 2e5ef5c
Adam Wilson Merge remote-tracking branch 'upstream/master' 4589790
Adam Wilson Merge remote-tracking branch 'upstream/master' d5427a8
Adam Wilson Merge remote-tracking branch 'upstream/master' a9b705b
Adam Wilson Merge remote-tracking branch 'upstream/master' d6a16cc
Adam Wilson Merge remote-tracking branch 'upstream/master' e949ec0
Adam Wilson Merge remote-tracking branch 'upstream/master' 1609c73
Adam Wilson Merge remote-tracking branch 'upstream/master' 8be3d56
Adam Wilson Merge remote-tracking branch 'upstream/master' 019a960
unknown Merge remote-tracking branch 'upstream/master' 200afe6
unknown Merge remote-tracking branch 'upstream/master' 9be6981
unknown Merge remote-tracking branch 'upstream/master' d4b2996
unknown Merge remote-tracking branch 'upstream/master' 0d82e7e
unknown Merge remote-tracking branch 'upstream/master' b2678de
unknown Merge remote-tracking branch 'upstream/master' 2aa5796
unknown Merge remote-tracking branch 'upstream/master' aa44359
unknown Merge remote-tracking branch 'upstream/master' ea12018
unknown Merge remote-tracking branch 'upstream/master' bc4acb5
unknown Merge remote-tracking branch 'upstream/master' ad3667c
unknown Merge remote-tracking branch 'upstream/master' c931f7e
unknown Merge remote-tracking branch 'upstream/master' 40f7049
unknown Merge remote-tracking branch 'upstream/master' 13be385
unknown Merge remote-tracking branch 'upstream/master' 305f5f4
unknown Merge remote-tracking branch 'upstream/master' a072aed
unknown Updated to account for Issue 7754 5ec8e39
Adam Wilson Merge remote-tracking branch 'upstream/master' 1c4a55e
Adam Wilson Merge remote-tracking branch 'upstream/master' a32b529
Adam Wilson Merge remote-tracking branch 'upstream/master' f37f3b2
Adam Wilson Merge remote-tracking branch 'upstream/master' 9e867ce
Adam Wilson Merge remote-tracking branch 'upstream/master' 3549a55
Adam Wilson Merge remote-tracking branch 'upstream/master' d08b438
Adam Wilson Merge remote-tracking branch 'upstream/master' 69199ec
Adam Wilson Merge remote-tracking branch 'upstream/master' de166c2
Adam Wilson Merge remote-tracking branch 'upstream/master' 0a5dbe7
Adam Wilson Fix merge conflict on cond.c 5bc0639
Adam Wilson Fixed collisions in class.c and struct.c d4c06b0
Adam Wilson Merge remote-tracking branch 'upstream/master' db3bfc8
Adam Wilson Merge remote-tracking branch 'upstream/master' cd638be
Adam Wilson Merge remote-tracking branch 'upstream/master' b551742
Adam Wilson Merge remote-tracking branch 'upstream/master' ecee9ca
Adam Wilson Merge remote-tracking branch 'upstream/master' 8c551d6
Adam Wilson Merge remote-tracking branch 'upstream/master' 1e7e39a
Adam Wilson Merge remote-tracking branch 'upstream/master' 0549056
Adam Wilson Variables now keep their initializers. Changed assert null check in m…
…type.c at line 5222 to if() null check to fix spurious assert.
0355522
Adam Wilson Cleaned up some dead code in prepartion for the pending pull request. 3d23ee1
Adam Wilson Replaced tabs with spaces per style requirements. d7aaa69
Adam Wilson Merge remote-tracking branch 'upstream/master' 24152fc
Adam Wilson Merge remote-tracking branch 'upstream/master' a366de9
Adam Wilson Merge remote-tracking branch 'upstream/master' f75f205
Adam Wilson Merge remote-tracking branch 'upstream/master' 7f1f7f9
Adam Wilson Merge remote-tracking branch 'upstream/master' b93a698
Adam Wilson Merge remote-tracking branch 'upstream/master' f26612a
Adam Wilson Merge remote-tracking branch 'upstream/master' ede62e7
Adam Wilson Merge remote-tracking branch 'upstream/master' 156bb5c
Adam Wilson Functions with auto return values must keep their implemenations for DMD
to perform type deduction. (Fixes posix build error)
Fixed delegates in template constraints not keeping their implementions.
(Fixes Windows build error)
2587414
Adam Wilson Removed tabs to conform to style guidelines. 35470c0
Adam Wilson Removed an extraneous function that was only used for testing. da7cbe9
@9rnsr
Member
9rnsr commented May 13, 2012

I think correct di generation should run AFTER semantic analysis. When it is necessary to keep original code (e.g. template declaration), we can save AST with syntaxCopy before semantic analysis, and use it after.

@9rnsr
Member
9rnsr commented May 13, 2012

I think this pull is terrible. You should create new branch for the pull request, instead of using master. And sometimes you can rebase the branch and push -f to your repo to track dmd head.

@LightBender

Walter put a big comment mars.c about how DI generation should never be done after semantic analysis. I was merely following his advice.

I think what I may have to do close this one and recreate my fork by hand. I was not well instructed in the proper procedures for DMD work when I started this project.

@LightBender

Closing to clean up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment