Re: Semantic difference of source files

m.helvensteijn@gmail.com
Thu, 28 Aug 2008 08:49:54 -0700 (PDT)

          From comp.compilers

Related articles
[5 earlier articles]
Re: Semantic difference of source files gah@ugcs.caltech.edu (glen herrmannsfeldt) (2008-08-19)
Re: Semantic difference of source files marcov@stack.nl (Marco van de Voort) (2008-08-20)
Re: Semantic difference of source files gah@ugcs.caltech.edu (glen herrmannsfeldt) (2008-08-20)
Re: Semantic difference of source files DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-08-23)
Re: Semantic difference of source files marcov@stack.nl (Marco van de Voort) (2008-08-24)
Re: Semantic difference of source files Jatin_Bhateja@mentor.com (Jatin Bhateja) (2008-08-28)
Re: Semantic difference of source files m.helvensteijn@gmail.com (2008-08-28)
| List of all articles for this month |

From: m.helvensteijn@gmail.com
Newsgroups: comp.compilers
Date: Thu, 28 Aug 2008 08:49:54 -0700 (PDT)
Organization: Compilers Central
References: 08-08-025 08-08-087
Keywords: source, debug, optimize
Posted-Date: 28 Aug 2008 17:35:23 EDT

On Aug 28, 9:35 am, Jatin Bhateja <Jatin_Bhat...@mentor.com> wrote:


> >I propose that in addition to comparing modification dates, we
selectively
> >compare AST's (if the source file is newer). At the very least this
allows
> >the programmer to modify style, layout and comments without requiring any
> >recompilation at all. If the comparison utility is smart enough, you may
> >even perform trivial refactoring without losing semantic equivalence.
>
> As per your thought programmer can make cosmetic changes like changing
> the comments / spaces / tabs / new lines,
> any such cosmetic change will not lead to re-compilation. How are you
> going to keep the line number info updated ?
> It needed by source debugger to refer to correct source line analogous
> to current assembly/machine instruction .


Good question. It's something I did not initially consider. Of course,
when compiling in release mode, this is not a problem. But I agree
this is unacceptable, since it's exactly in debug mode where you want
the compilation to be fast.


I'm not sure how line-numbers and such are usually stored in a binary
file. However, I imagine it would be possible to store that
information in a separate section of the binary, clearly marked with a
unique bit-sequence. Then it is only that section of the binary that
would need to be updated by the compiler. This also requires nothing
more than the AST. The rest of the binary would be copied bit by bit.


I imagine something like that would probably break binary
compatibility for existing compilers. I can't say much about this with
my limited experience. But it may be a sacrifice worth making.


--
Michiel Helvensteijn


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.