[PATCH] D22666: Frontend: Fix mcount inlining bug

Honggyu Kim via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 7 20:02:19 PDT 2016


honggyu.kim added a comment.

In https://reviews.llvm.org/D22666#506884, @compnerd wrote:

> The `\01` is to prevent the mangler from touching the function name.  If you noticed the check tags in the quoted test, some targets expect it to be decorated and others do not.  What exactly do you mean that `lit` has a strings matching with `\01`?  Its not a string `\01`, its the octal character 1.


Hi Saleem,

It seems that name mangling is done before mcount call insertion so I think we don't have to put `\01` prefix for mcount names.  I have tested on x86-64 and ARM.  Are there any other targets that work in a different order?
I've checked this `clang::CodeGen::CodeGenModule::getMangledName()` is always executed before `clang::CodeGen::CodeGenFunction::StartFunction()`, which actually inserts mcount calls.
Please correct me if I'm wrong


https://reviews.llvm.org/D22666





More information about the cfe-commits mailing list