[LLVMdev] Compiler Driver Decisions

Reid Spencer reid at x10sys.com
Wed Aug 4 08:44:46 PDT 2004


On Wed, 2004-08-04 at 08:24, John Criswell wrote:

> o Configuration Files
> 
> If it isn't too much trouble, I think we should go with XML for the 
> following reasons:
> 
> 1) We wouldn't need to implement a parsing library.  There are several 
> XML parsing libraries available, and I'm guessing that they're available 
> in several different programming languages (Reid, am I right on that?).

Yes, there are many to choose from. But, some of them are larger than
LLVM :). We'd choose expat (fast, simple, small, good compatibility,
lacks features we don't need). Either that or just write a really simple
recursive descent parser.

> 
> 2) It makes it easier for other programmers to write tools that read, 
> modify, and/or write the configuration file correctly.  If my assumption 
> about XML libraries being available in several different languages is 
> correct, then that means we don't need to write a library for each 
> language that people want to use.

Not sure what you mean here. What's an XML library and are they supposed
to be available in different natural languages or different computer
languages or programming languages or ??Do you mean natural languages?

> 3) I believe it would keep the format flexibile enough for future 
> expansion (but again, Reid would know better here).

Yes. It wouldn't be painless, but going from DTD1 -> DTD2 is much less
painful than going from INI -> XML. That is, the ENTIRE format doesn't
have to change, its just incrementally changing its document type
definition within the XML format.

> 
> Having configuration files that can be manipulated accurately is 
> important for things like automatic installation, GUI's, configuration 
> tools, etc.

Yes, that was my main argument too .. precision for us and others.

> 
> o Object Files
> 
> I've noticed that there's a general agreement that we should not 
> encapsulate LLVM bytecode files inside of another object format (such as 
> ELF).  However, I'd like to pose a few potential benefits that 
> encapsulation in ELF might provide:
> 
> 1) It may provide a way for standard UNIX tools to handle bytecode files 
> without modification.  For example, programs like ar, nm, and file all 
> take advantage of the ELF format.  If we generated LLVM ELF files, we 
> wouldn't need to write our own nm and ar implementations and port them 
> to various platforms.

Consider this: both ar and nm look inside the .o file and read the ELF
format. While we could put the bytecode in a .llvm section, neither tool
would read that section. They would instead look for symbols in other
sections. So, to be useful, we would now have to bloat the .o file with
additional (normal) ELF sections that would allow tools like ar and nm
to discover the symbols in the file.  I think this is a big waste of
time when we already have ar and nm replacements. 

As for the file command, the /etc/magic file can contain a single line
that accurately identifies LLVM object files (first 4 chars are llvm)
 
> 
> 2) It could mark the bytecode file with other bits of useful 
> information, such as the OS and hardware on which the file was generated.

That's currently supported with the "target-triple" I just added to the
bytecode format.

> 
> 3) It may provide a convenient means of adding dynamic linking with 
> other bytecode files.

What did you have in mind?

> 
> 4) It may provide a convenient place to cache native translations for 
> use with the JIT.

It doesn't sound convenient to me. It would be faster to just mmap a
whole region of memory with some kind of index onto disk and reload it
later.

> 
> Here are the disadvantages I see:
> 
> 1) Increased disk usage.  For example, symbol table information would 
> duplicate the information already in the bytecode file.

Right ;>

> o Compiler Driver Name
> 
> I'd vote for either llvmcc (llvm compiler collection) or llvmcd (llvm 
> compiler driver).  To be more convenient, we could call it llc (LLvm 
> Compiler) or llcd (LLvm Compiler Driver).  Calling it llc would require 
> renaming llc to something else, which might be appropriate since I view 
> llc as a "code generator" and not as a "compiler" (although both terms 
> are technically accurate).

I'd vote to leave llc alone. However, I like your shortening idea. It
makes ll-build much more tenable.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040804/61722233/attachment.sig>


More information about the llvm-dev mailing list