home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / compiler / 1389 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  2.0 KB

  1. Xref: sparky comp.compilers:1389 comp.lang.c:12404
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!rutgers!faatcrl!iecc!compilers-sender
  3. From: markh@csd4.csd.uwm.edu (Hunk)
  4. Newsgroups: comp.compilers,comp.lang.c
  5. Subject: Re: Two-pass C compilers
  6. Keywords: C
  7. Message-ID: <92-08-088@comp.compilers>
  8. Date: 16 Aug 92 19:06:31 GMT
  9. References: <92-08-081@comp.compilers> <92-08-086@comp.compilers>
  10. Sender: compilers-sender@iecc.cambridge.ma.us
  11. Reply-To: markh@csd4.csd.uwm.edu (Hunk)
  12. Organization: Computing Services Division, University of Wisconsin - Milwaukee
  13. Lines: 31
  14. Approved: compilers@iecc.cambridge.ma.us
  15.  
  16. behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens) writes:
  17. >Hmmm ... beat me if I something silly, but: Is there any way around
  18. >a two-pass compiler? (Or even more passes)
  19. >
  20. >First pass: Reading in the source, preprocessing it, building a symbol table.
  21. >Second pass: Generate p-Code
  22. >Third pass: Optimize p-Code (Note: Do not mix with 2nd pass or you are
  23. >in deep trouble)
  24. >Fourth pass: Generate native code in linkable object file
  25.  
  26. Pass 1: Generate optimized binaries, into an object file.
  27.         Back-patch forward references, Dump table of external and globals.
  28.  
  29. The object file format is dictated by this method.  All memory images must
  30. be written before the tables and after the header.  The header must be
  31. fixed in size, and must contain all the needed pointers to access the
  32. tables.
  33.  
  34. The code generation rules are carefully written with optimization built
  35. into them.  For example, they can be derived by knowledge engineering
  36. techniques from an expert human compiler (presunably the person doing the
  37. compiler-writing would qualify).
  38.  
  39. Global analysis, data flow, register allocation, control flow are all done
  40. on the fly during parsing.  Whatever intermediate structures are needed
  41. are stored in memory.
  42.  
  43. Pass 1.5: Linking object files and resolving the remaining unresolved objects.
  44. -- 
  45. Send compilers articles to compilers@iecc.cambridge.ma.us or
  46. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  47.