[llvm-commits] Function aliases

Anton Korobeynikov asl at math.spbu.ru
Thu Apr 19 12:03:45 PDT 2007


Chris,

> Ok, does this also apply to functions with bodies?
No. Declarations only. AsmParser takes care of this.

> If they can have bodies, why not just make this an instance variable  
> in the Function class?  If the string is empty, there is no alias.
:) This was my initial proposal (some week ago), you've responded
something like "this will be waste of space and memory, since only few
functions will use this feature".

> Ok, they should be fixed! :)
Ok.

> void foo() alias bar {}
This isn't allowed. foo acts as bar's mirror, so body of foo is
redefinition.

> Do the two functions (the extern of bar and the decl of foo) get  
> linked up?  What happens if the foo declaration was a prototype with  
> no body?
They won't be linked. External functions can still call foo();

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.





More information about the llvm-commits mailing list