[LLVMdev] Valid names for symbols

Chris Lattner
Sat, 11 Sep 2010 18:41:35 -0000

On Sep 11, 2010, at 11:03 AM, David Given wrote:

> What's the set of valid characters that can occur in an LLVM symbol
name?
>
> The reason I ask is that my compiler is generating symbols based on
> method names. Some methods are operators, and I haven't got around to
> mangling the names yet. As a result it's producing symbols that look
> like _f_+ and _f_:=.
>
> LLVM seems to be coping fine with these so far and the IR output is
> quoting them, producing lines like:
>
> %7 = call fastcc i32 @"_f_+"(i8* %6, i32 1)
>
> Should I be mangling the names, or can I rely on LLVM to cope? If so,
> will LLVM correctly mangle the names itself to keep the platform
> assembler happy?

LLVM should be able to handle anything you throw at it.

-Chris