[PATCH] D92800: [Clang] Make nomerge attribute a function attribute as well as a statement attribute.
Zequan Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Dec 10 15:39:33 PST 2020
zequanwu added inline comments.
================
Comment at: clang/test/CodeGen/attr-nomerge.cpp:8
+ [[clang::nomerge]] void f();
+ [[clang::nomerge]] virtual void g();
+ [[clang::nomerge]] static void f1();
----------------
rnk wrote:
> Hm, virtual functions, there's something worth thinking about. In this case, the attribute must appear on the call site if we want it to work as the user expects. I don't see the indirect call site for the virtual call in the IR below. I think it's worth testing for that. Consider taking `A*` and `B*` parameters to defeat any frontend devirtualization optimizations.
If devirtualization failed, then only statement attribute would work.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92800/new/
https://reviews.llvm.org/D92800
More information about the cfe-commits
mailing list