PR411 Has Landed


After 2.5 years of working on it the Symbol Tables now have no type
planes and PR411 has been resolved. (Okay, I didn't work on it solid for
2.5 years :slight_smile: )

This change means that all names must be unique within their scope. That
is, functions and global variables must be unique within their module
and instruction names must be unique within their function. Generally
this is the case anyway, but in case your front-end allowed overloading
by type, this is no longer supported. To overload, you must rename (e.g.
name mangling in C++ front end).

On the bright side, this should speed up llvm linking and a few other
parts of llvm. It also makes the memory consumption for the symbol table
significantly smaller.

And for once, this doesn't involve a bytecode format change. :slight_smile:


To give a specific example, before you'd see LLVM code like this:

   %X = add i32 %a, %b
   %X = add i16 %a, %b

which was allowed because the two X's had different types. This confused a lot of people and made the internal implementation of LLVM slower than it needed to be.

Now, the only time you can have symbols with the same name is if one is a global value "@X" and one is local "%X". In this case, the prefix specifies what flavor of symbol it is.