[Clang] Add option to disable -mconstructor-aliases with -mno-constructor-aliases
authormodimo <modimo@fb.com>
Tue, 30 Nov 2021 23:11:57 +0000 (15:11 -0800)
committermodimo <modimo@fb.com>
Tue, 30 Nov 2021 23:12:45 +0000 (15:12 -0800)
commit9b704d31b54a61615e7d172a1ed040bff7423e9b
tree3def178026eb746509bad9d7f5a59984acfc8e83
parenta503cb00d105b75744444c987fd159b05180c383
[Clang] Add option to disable -mconstructor-aliases with -mno-constructor-aliases

We've found that when profiling, counts are only generated for the real definition of constructor aliases (C2 in mangled name). However, when compiling the C1 version is present at the callsite and leads to a lack of counts due to this aliasing. This causes us to miss out on inlining an otherwise hot constructor.

-mconstructor-aliases is AFAICT an optimization, so having a disabling flag if wanted seems valuable.

Testing:
ninja check-all

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D114130
clang/include/clang/Driver/Options.td
clang/test/CodeGenCXX/constructor-alias.cpp