[PATCH] D122608: Fix behavior of ifuncs with 'used' extern "C" static functions
Tom Honermann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 1 12:47:00 PDT 2022
tahonermann added inline comments.
================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6393
+ // If Val is null, that implies there were multiple declarations that each
+ // had a claim to the unmangled name. In this case, generation of hte alias
+ // is suppressed. See CodeGenModule::MaybeHandleStaticInExterC.
----------------
You retyped my suggested comment instead of copy/paste? Or is the "hte" just intended to test my attention to detail? 😜
================
Comment at: clang/lib/CodeGen/CodeGenModule.h:1573-1575
+ /// Helper function for EmitStaticExternCAliases that clears the uses of
+ /// 'Elem' if it is used exclusively by ifunc resolvers. Returns 'true' if it
+ /// was successful erases Elem.
----------------
tahonermann wrote:
> Grammar is off in the last sentence.
>
> The comment doesn't really explain this function's purpose. I suggest:
> /// Helper function for EmitStaticExternCAliases() to redirect ifuncs that have a resolver
> /// name that matches 'Elem' to instead resolve to the name of 'CppFunc'. This
> /// redirection is necessary in cases where 'Elem' has a name that will be emitted as
> /// an alias of the name bound to 'CppFunc'; ifuncs may not reference aliases. Redirection
> /// is only performed if 'Elem' is only used by ifuncs in which case, 'Elem' is destroyed..
> /// 'true' is returned If redirection is successful, and 'false' is returned otherwise.
The parent comment is marked as done, but no change appears to have been applied.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122608/new/
https://reviews.llvm.org/D122608
More information about the cfe-commits
mailing list