September 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301


Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de


--- Comment #10 from Rainer Schuetze <r.sagitario@gmx.de> 2009-09-11 13:27:11 PDT ---
It has shown up a number of times, for example in #258 and #1592.

I have a patch for this (and the bugs mentioned above) that parses every file that is unconditionally imported before any semantic analysis.

As this introduces another compile step, I'm not sure if this is a good patch, and it will fail for conditional imports. So I'm hoping for a more general solution that works with the deferred semantic analysis and solves more of the forward reference problems.

Should I attach the patch anyway?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 12, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301


Eldar Insafutdinov <e.insafutdinov@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |e.insafutdinov@gmail.com


--- Comment #11 from Eldar Insafutdinov <e.insafutdinov@gmail.com> 2009-09-12 07:34:56 PDT ---
Yes indeed, this test case is reproducible on 1.041 as well, but 1.041 compiles QtD and gtkD well. And 1.047 doesn't. Does it mean that it is a separate issue?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 18, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301



--- Comment #12 from Rainer Schuetze <r.sagitario@gmx.de> 2009-09-18 00:38:57 PDT ---
Created an attachment (id=454)
do all imports before semantic analysis

Having done some investigation of the deferred semantic analysis mechanism, it might be best to try to keep its usage to a minimum, because it might have a negative impact on compilation speed and memory consumption. So my patch is probably not so bad after all.

Some details:
The problem is that, though the files are parsed, their symbol table might not
yet hold any identifiers, because the semantic analysis has not been run on the
module.

So I introduced another compile step after parsing, but before the semantic analysis. The files on the command line are scanned for import statements, loading and parsing the referenced modules and applying the same process on these files. In the same step, the global members of the module are added to the modules' symbol table (this has been moved from the semantic analysis).

The import statements must not be conditional, because the semantic analysis is needed to evaluate a "static if" statement. If the semantic analysis gets to the import statement, the additional compile step kicks in again for any module not already loaded.

This patch also fixes bugs #3286, #1592 and #258

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 19, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301



--- Comment #13 from Eldar Insafutdinov <e.insafutdinov@gmail.com> 2009-09-19 13:37:03 PDT ---
(In reply to comment #12)
> Created an attachment (id=454) [details]
> do all imports before semantic analysis
> 
> Having done some investigation of the deferred semantic analysis mechanism, it might be best to try to keep its usage to a minimum, because it might have a negative impact on compilation speed and memory consumption. So my patch is probably not so bad after all.
> 
> Some details:
> The problem is that, though the files are parsed, their symbol table might not
> yet hold any identifiers, because the semantic analysis has not been run on the
> module.
> 
> So I introduced another compile step after parsing, but before the semantic analysis. The files on the command line are scanned for import statements, loading and parsing the referenced modules and applying the same process on these files. In the same step, the global members of the module are added to the modules' symbol table (this has been moved from the semantic analysis).
> 
> The import statements must not be conditional, because the semantic analysis is needed to evaluate a "static if" statement. If the semantic analysis gets to the import statement, the additional compile step kicks in again for any module not already loaded.
> 
> This patch also fixes bugs #3286, #1592 and #258

Dear Rainer,
Your patch applied against dmd 1.047 fixes the issue with building both gtkD
and QtD. It would be cool if it were included in the upstream.

Thank you.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301


Tim M <tim.matthews7@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim.matthews7@gmail.com


--- Comment #14 from Tim M <tim.matthews7@gmail.com> 2009-09-26 21:54:55 PDT ---
(In reply to comment #13)
> Dear Rainer,
> Your patch applied against dmd 1.047 fixes the issue with building both gtkD
> and QtD. It would be cool if it were included in the upstream.
> 
> Thank you.

I had to use this to compile gtkD too and it worked well. The experimental dnet compiler being based on dmd's front end also has this issue and the patch did the job for that too.

Thanks Rainer.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301


Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #454 is|0                           |1
           obsolete|                            |


--- Comment #15 from Rainer Schuetze <r.sagitario@gmx.de> 2009-10-03 08:28:17 PDT ---
Created an attachment (id=469)
improved patch with version/debug support

I have improved the patch to look through version/debug conditionals, that would bring back all the troubles if used for the imports.

I've also moved the setScope calls into the importAll functions, which was already proposed in a comment nearby. At the same time, version/debug conditional declarations pass the scope to its included branch. StaticIfDeclarations cannot do this, because the semantic analysis is needed to evaluate the condition.

In the long run, I'd propose to take the setScope mechanism further, setting the scope as early as possible, allowing semantic analysis in arbitrary order.

I've run the qtd build with this patch and it still works. You'll also need the patch of issue 3353 for the build to complete, though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 13, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3301


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #16 from Walter Bright <bugzilla@digitalmars.com> 2009-10-13 13:47:26 PDT ---
Fixed dmd 1.049 and 2.034

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »