Usage of file name in EmitCXXGlobalInitFunc

EmitCXXGlobalInitFunc will include the filename of the current main
file in the symbol name. However, if the main file is a MemBuffer (as
in my case), this crashes. What is the purpose of including the
filename? What should be done if there is no filename? I'd be happy to
write up a patch, but I don't know what the right semantics are.

Thanks,
Keno

We used to use “__GLOBAL_I_a” before r208128. I would suggest you do the same when no filename exists.